Skip to content

Commit f67442e

Browse files
luqmanaalexcrichton
authored andcommitted
Skip i8 case in FastISel divrem to avoid generating illegal instructions.
1 parent b1adb4d commit f67442e

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/Target/X86/X86FastISel.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1300,7 +1300,11 @@ bool X86FastISel::X86SelectDivRem(const Instruction *I) {
13001300
unsigned TypeIndex, OpIndex;
13011301
switch (VT.SimpleTy) {
13021302
default: return false;
1303-
case MVT::i8: TypeIndex = 0; break;
1303+
// Don't handle the i8 case since we might end up trying
1304+
// to use AH in a REX instruction. Instead just punt to
1305+
// ISelDAGToDAG which has the logic to handle that case.
1306+
case MVT::i8:
1307+
return false;
13041308
case MVT::i16: TypeIndex = 1; break;
13051309
case MVT::i32: TypeIndex = 2; break;
13061310
case MVT::i64: TypeIndex = 3;

0 commit comments

Comments
 (0)