[llvm] r189274 - ARM: Constrain regclass for TSTri instruction.
Jim Grosbach
grosbach at apple.com
Mon Aug 26 13:22:05 PDT 2013
Author: grosbach
Date: Mon Aug 26 15:22:05 2013
New Revision: 189274
URL: http://llvm.org/viewvc/llvm-project?rev=189274&view=rev
Log:
ARM: Constrain regclass for TSTri instruction.
Get the register class right for the TST instruction. This keeps the
machine verifier happy, enabling us to turn it on for another test.
rdar://12594152
Modified:
llvm/trunk/lib/Target/ARM/ARMFastISel.cpp
llvm/trunk/test/CodeGen/ARM/fast-isel-br-phi.ll
Modified: llvm/trunk/lib/Target/ARM/ARMFastISel.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMFastISel.cpp?rev=189274&r1=189273&r2=189274&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMFastISel.cpp (original)
+++ llvm/trunk/lib/Target/ARM/ARMFastISel.cpp Mon Aug 26 15:22:05 2013
@@ -1380,6 +1380,7 @@ bool ARMFastISel::SelectBranch(const Ins
(isLoadTypeLegal(TI->getOperand(0)->getType(), SourceVT))) {
unsigned TstOpc = isThumb2 ? ARM::t2TSTri : ARM::TSTri;
unsigned OpReg = getRegForValue(TI->getOperand(0));
+ OpReg = constrainOperandRegClass(TII.get(TstOpc), OpReg, 0);
AddOptionalDefs(BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL,
TII.get(TstOpc))
.addReg(OpReg).addImm(1));
@@ -1417,6 +1418,7 @@ bool ARMFastISel::SelectBranch(const Ins
// and it left a value for us in a virtual register. Ergo, we test
// the one-bit value left in the virtual register.
unsigned TstOpc = isThumb2 ? ARM::t2TSTri : ARM::TSTri;
+ CmpReg = constrainOperandRegClass(TII.get(TstOpc), CmpReg, 0);
AddOptionalDefs(BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, TII.get(TstOpc))
.addReg(CmpReg).addImm(1));
Modified: llvm/trunk/test/CodeGen/ARM/fast-isel-br-phi.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/fast-isel-br-phi.ll?rev=189274&r1=189273&r2=189274&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/ARM/fast-isel-br-phi.ll (original)
+++ llvm/trunk/test/CodeGen/ARM/fast-isel-br-phi.ll Mon Aug 26 15:22:05 2013
@@ -1,4 +1,4 @@
-; RUN: llc < %s -O0 -fast-isel-abort -relocation-model=dynamic-no-pic -mtriple=thumbv7-apple-ios
+; RUN: llc < %s -O0 -verify-machineinstrs -fast-isel-abort -relocation-model=dynamic-no-pic -mtriple=thumbv7-apple-ios
; This test ensures HandlePHINodesInSuccessorBlocks() is able to promote basic
; non-legal integer types (i.e., i1, i8, i16).
More information about the llvm-commits
mailing list