[llvm] r188819 - ARM: Fix fast-isel copy/paste-o.
Jim Grosbach
grosbach at apple.com
Tue Aug 20 12:12:42 PDT 2013
Author: grosbach
Date: Tue Aug 20 14:12:42 2013
New Revision: 188819
URL: http://llvm.org/viewvc/llvm-project?rev=188819&view=rev
Log:
ARM: Fix fast-isel copy/paste-o.
Update testcase to be more careful about checking register
values. While regexes are general goodness for these sorts of
testcases, in this example, the registers are constrained by
the calling convention, so we can and should check their
explicit values.
rdar://14779513
Modified:
llvm/trunk/lib/Target/ARM/ARMFastISel.cpp
llvm/trunk/test/CodeGen/ARM/fast-isel-select.ll
Modified: llvm/trunk/lib/Target/ARM/ARMFastISel.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMFastISel.cpp?rev=188819&r1=188818&r2=188819&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMFastISel.cpp (original)
+++ llvm/trunk/lib/Target/ARM/ARMFastISel.cpp Tue Aug 20 14:12:42 2013
@@ -1762,7 +1762,7 @@ bool ARMFastISel::SelectSelect(const Ins
}
unsigned ResultReg = createResultReg(RC);
if (!UseImm) {
- Op2Reg = constrainOperandRegClass(TII.get(MovCCOpc), Op1Reg, 1);
+ Op2Reg = constrainOperandRegClass(TII.get(MovCCOpc), Op2Reg, 1);
Op1Reg = constrainOperandRegClass(TII.get(MovCCOpc), Op1Reg, 2);
BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, TII.get(MovCCOpc), ResultReg)
.addReg(Op2Reg).addReg(Op1Reg).addImm(ARMCC::NE).addReg(ARM::CPSR);
Modified: llvm/trunk/test/CodeGen/ARM/fast-isel-select.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/fast-isel-select.ll?rev=188819&r1=188818&r2=188819&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/ARM/fast-isel-select.ll (original)
+++ llvm/trunk/test/CodeGen/ARM/fast-isel-select.ll Tue Aug 20 14:12:42 2013
@@ -39,15 +39,16 @@ define i32 @t3(i1 %c, i32 %a, i32 %b) no
entry:
; ARM: t3
; ARM: cmp r0, #0
-; ARM: movne r{{[1-9]}}, r{{[1-9]}}
-; ARM: mov r0, r{{[1-9]}}
+; ARM: movne r2, r1
+; ARM: add r0, r2, r1
; THUMB: t3
; THUMB: cmp r0, #0
; THUMB: it ne
-; THUMB: movne r{{[1-9]}}, r{{[1-9]}}
-; THUMB: mov r0, r{{[1-9]}}
+; THUMB: movne r2, r1
+; THUMB: add.w r0, r2, r1
%0 = select i1 %c, i32 %a, i32 %b
- ret i32 %0
+ %1 = add i32 %0, %a
+ ret i32 %1
}
define i32 @t4(i1 %c) nounwind readnone {
More information about the llvm-commits
mailing list