[Statepoint] Turn assert into check in foldPatchpoint.
authorDenis Antrushin <dantrushin@gmail.com>
Thu, 27 Aug 2020 14:20:25 +0000 (21:20 +0700)
committerDenis Antrushin <dantrushin@gmail.com>
Fri, 28 Aug 2020 13:00:23 +0000 (20:00 +0700)
Original D81646 had check for tied regs in foldPatchpoint().
Due to unfortunate miscommunication with review comments and
adressing some comments post commit, it turned into assertion.

We had an offline talk and agreed that with current implementation
this path is possible, so I'm changing it back to check.

Note that this is workaround until ussues described in PR46917 are
resolved.

llvm/lib/CodeGen/TargetInstrInfo.cpp

index c71bf7c..fe9feb5 100644 (file)
@@ -499,14 +499,14 @@ static MachineInstr *foldPatchpoint(MachineFunction &MF, MachineInstr &MI,
   // Return false if any operands requested for folding are not foldable (not
   // part of the stackmap's live values).
   for (unsigned Op : Ops) {
-    // Caller is expected to avoid passing in tied operands
-    assert(!MI.getOperand(Op).isTied());
     if (Op < NumDefs) {
       assert(DefToFoldIdx == MI.getNumOperands() && "Folding multiple defs");
       DefToFoldIdx = Op;
     } else if (Op < StartIdx) {
       return nullptr;
     }
+    if (MI.getOperand(Op).isTied())
+      return nullptr;
   }
 
   MachineInstr *NewMI =