summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonas Paulsson <jonas.paulsson@ericsson.com>2015-10-10 07:14:24 +0000
committerJonas Paulsson <jonas.paulsson@ericsson.com>2015-10-10 07:14:24 +0000
commit63a2b6862e617988c552d7f517661fee8a5c6eef (patch)
tree115c89d7dd2c2e34f24b426cd9cd384ad8016aaf
parentcc16ccc1ab879dc7d2c8c68d0bd4f0698ea24d66 (diff)
downloadbcm5719-llvm-63a2b6862e617988c552d7f517661fee8a5c6eef.tar.gz
bcm5719-llvm-63a2b6862e617988c552d7f517661fee8a5c6eef.zip
[SystemZ] Fixes in the backend I/R.
expandPostRAPseudo(): STX -> 2 * STD: The first STD should not have the kill flag set for the address. SystemZElimCompare: BRC -> BRCT conversion: Don't forget to remove the CC<use,kill> operand. Needed to make SystemZ/asm-17.ll pass with -verify-machineinstrs, which now runs with this flag. Reviewed by Ulrich Weigand. llvm-svn: 249945
-rw-r--r--llvm/lib/Target/SystemZ/SystemZElimCompare.cpp5
-rw-r--r--llvm/lib/Target/SystemZ/SystemZInstrInfo.cpp3
-rw-r--r--llvm/test/CodeGen/SystemZ/asm-17.ll3
3 files changed, 7 insertions, 4 deletions
diff --git a/llvm/lib/Target/SystemZ/SystemZElimCompare.cpp b/llvm/lib/Target/SystemZ/SystemZElimCompare.cpp
index 5daa4d77671..adddeef0090 100644
--- a/llvm/lib/Target/SystemZ/SystemZElimCompare.cpp
+++ b/llvm/lib/Target/SystemZ/SystemZElimCompare.cpp
@@ -206,9 +206,8 @@ SystemZElimCompare::convertToBRCT(MachineInstr *MI, MachineInstr *Compare,
// The transformation is OK. Rebuild Branch as a BRCT(G).
MachineOperand Target(Branch->getOperand(2));
- Branch->RemoveOperand(2);
- Branch->RemoveOperand(1);
- Branch->RemoveOperand(0);
+ while (Branch->getNumOperands())
+ Branch->RemoveOperand(0);
Branch->setDesc(TII->get(BRCT));
MachineInstrBuilder(*Branch->getParent()->getParent(), Branch)
.addOperand(MI->getOperand(0))
diff --git a/llvm/lib/Target/SystemZ/SystemZInstrInfo.cpp b/llvm/lib/Target/SystemZ/SystemZInstrInfo.cpp
index a319e1c6aa8..5d7accc6c0e 100644
--- a/llvm/lib/Target/SystemZ/SystemZInstrInfo.cpp
+++ b/llvm/lib/Target/SystemZ/SystemZInstrInfo.cpp
@@ -69,6 +69,9 @@ void SystemZInstrInfo::splitMove(MachineBasicBlock::iterator MI,
MachineOperand &LowOffsetOp = MI->getOperand(2);
LowOffsetOp.setImm(LowOffsetOp.getImm() + 8);
+ // Clear the kill flag for the address reg in the first instruction.
+ EarlierMI->getOperand(1).setIsKill(false);
+
// Set the opcodes.
unsigned HighOpcode = getOpcodeForOffset(NewOpcode, HighOffsetOp.getImm());
unsigned LowOpcode = getOpcodeForOffset(NewOpcode, LowOffsetOp.getImm());
diff --git a/llvm/test/CodeGen/SystemZ/asm-17.ll b/llvm/test/CodeGen/SystemZ/asm-17.ll
index 533b5e90d62..acf2aff4542 100644
--- a/llvm/test/CodeGen/SystemZ/asm-17.ll
+++ b/llvm/test/CodeGen/SystemZ/asm-17.ll
@@ -1,6 +1,7 @@
; Test explicit register names.
;
-; RUN: llc < %s -mtriple=s390x-linux-gnu -no-integrated-as | FileCheck %s
+; RUN: llc < %s -verify-machineinstrs -mtriple=s390x-linux-gnu -no-integrated-as \
+; RUN: | FileCheck %s
; Test i32 GPRs.
define i32 @f1() {
OpenPOWER on IntegriCloud