[PATCH] bug fix for PR20020: anti-dependency-breaker causes miscompilation

hfinkel at anl.gov hfinkel at anl.gov
Mon Jun 30 15:35:04 PDT 2014


================
Comment at: lib/CodeGen/CriticalAntiDepBreaker.cpp:260
@@ +259,3 @@
+      // FIXME: The tied value should already have been checked in
+      // PrescanInstruction(). Do we need to do this check again?
+
----------------
Sanjay Patel wrote:
> hfinkel at anl.gov wrote:
> > Can you put an assert inside the existing check that the tied registers are in KeepRegs?
> Do you mean:
> if (MI->isRegTiedToUseOperand(i)) {
>  assert(KeepRegs.test(Reg) && "Register is tied but was not added to KeepRegs"));
>  continue;
> }
> 
> But we're checking the KeepRegs value just above this and continuing at that point in the code, so this would only fire if someone inadvertently put code between these two 'if' checks?
No, I mean replacing that with the assert (since PreScan should have caught them all). So instead of:

if (MI->isRegTiedToUseOperand(i)) continue;

We'd have:

assert(!MI->isRegTiedToUseOperand(i) && "Tied operand not in KeepRegs?");

http://reviews.llvm.org/D4351






More information about the llvm-commits mailing list