[llvm] 8bf9e31 - [SystemZ] Bugfix in tieOpsIfNeeded()

Jonas Paulsson via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 26 04:26:25 PDT 2020


Author: Jonas Paulsson
Date: 2020-03-26T12:22:14+01:00
New Revision: 8bf9e317e4c5c31a170c52d0624386081fa0614f

URL: https://github.com/llvm/llvm-project/commit/8bf9e317e4c5c31a170c52d0624386081fa0614f
DIFF: https://github.com/llvm/llvm-project/commit/8bf9e317e4c5c31a170c52d0624386081fa0614f.diff

LOG: [SystemZ]  Bugfix in tieOpsIfNeeded()

This function did a check which was broken to see if an opcode requires op0
and op1 to be tied. By chance this is NFC.

Review: Ulrich Weigand

Added: 
    

Modified: 
    llvm/lib/Target/SystemZ/SystemZShortenInst.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/SystemZ/SystemZShortenInst.cpp b/llvm/lib/Target/SystemZ/SystemZShortenInst.cpp
index 092d3a2bcc30..3d27b70d6ef9 100644
--- a/llvm/lib/Target/SystemZ/SystemZShortenInst.cpp
+++ b/llvm/lib/Target/SystemZ/SystemZShortenInst.cpp
@@ -65,7 +65,7 @@ SystemZShortenInst::SystemZShortenInst(const SystemZTargetMachine &tm)
 
 // Tie operands if MI has become a two-address instruction.
 static void tieOpsIfNeeded(MachineInstr &MI) {
-  if (MI.getDesc().getOperandConstraint(0, MCOI::TIED_TO) &&
+  if (MI.getDesc().getOperandConstraint(1, MCOI::TIED_TO) == 0 &&
       !MI.getOperand(0).isTied())
     MI.tieOperands(0, 1);
 }


        


More information about the llvm-commits mailing list