summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorJonas Paulsson <paulsson@linux.vnet.ibm.com>2019-06-18 12:10:02 +0000
committerJonas Paulsson <paulsson@linux.vnet.ibm.com>2019-06-18 12:10:02 +0000
commit5c64a8c4c6942cd8b36ccd84cc8bb59060892e9a (patch)
tree274835a3d3ae056726cdb99589bfef581c87944a /llvm/lib
parent8d41294c18930edb3f46f1e9d721ce6930bf9b99 (diff)
downloadbcm5719-llvm-5c64a8c4c6942cd8b36ccd84cc8bb59060892e9a.tar.gz
bcm5719-llvm-5c64a8c4c6942cd8b36ccd84cc8bb59060892e9a.zip
[SystemZ] Fix AHIMuxK pseudo expansion.
Do not emit a copy if the source and destination registers are the same. Review: Ulrich Weigand llvm-svn: 363665
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Target/SystemZ/SystemZInstrInfo.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/llvm/lib/Target/SystemZ/SystemZInstrInfo.cpp b/llvm/lib/Target/SystemZ/SystemZInstrInfo.cpp
index 865ce0320e5..adb96fa15cb 100644
--- a/llvm/lib/Target/SystemZ/SystemZInstrInfo.cpp
+++ b/llvm/lib/Target/SystemZ/SystemZInstrInfo.cpp
@@ -168,11 +168,13 @@ void SystemZInstrInfo::expandRIEPseudo(MachineInstr &MI, unsigned LowOpcode,
if (!DestIsHigh && !SrcIsHigh)
MI.setDesc(get(LowOpcodeK));
else {
- emitGRX32Move(*MI.getParent(), MI, MI.getDebugLoc(), DestReg, SrcReg,
- SystemZ::LR, 32, MI.getOperand(1).isKill(),
- MI.getOperand(1).isUndef());
+ if (DestReg != SrcReg) {
+ emitGRX32Move(*MI.getParent(), MI, MI.getDebugLoc(), DestReg, SrcReg,
+ SystemZ::LR, 32, MI.getOperand(1).isKill(),
+ MI.getOperand(1).isUndef());
+ MI.getOperand(1).setReg(DestReg);
+ }
MI.setDesc(get(DestIsHigh ? HighOpcode : LowOpcode));
- MI.getOperand(1).setReg(DestReg);
MI.tieOperands(0, 1);
}
}
OpenPOWER on IntegriCloud