FastEmit_i won't always succeed to materialize an i32 constant and just fail.
This would trigger a fall-back to SelectionDAG, which is really not necessary.
This fix will first fall-back to a constant pool load to materialize the constant
before giving up for good.
This fixes <rdar://problem/
18022633>.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@215682
91177308-0d34-0410-b5e6-
96231b3b80d8
}
if (Subtarget->useMovt(*FuncInfo.MF))
- return FastEmit_i(VT, VT, ISD::Constant, CI->getZExtValue());
+ if (FastEmit_i(VT, VT, ISD::Constant, CI->getZExtValue()))
+ return true;
// Load from constant pool. For now 32-bit only.
if (VT != MVT::i32)
call void @foo(i32 -2130706433)
ret void
}
+
+; Load from constant pool.
+define i32 @t10(i32 %a) {
+; ARM-LABEL: t10
+; ARM: ldr
+; THUMB-LABEL: t10
+; THUMB: movw r1, #52257
+; THUMB-NEXT: movt r1, #35037
+ %1 = xor i32 -1998730207, %a
+ ret i32 %1
+}
+