[PATCH] D61089: [Reassociation] Place moved instructions after landing pads

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 30 13:07:42 PDT 2019


efriedma added inline comments.


================
Comment at: llvm/lib/Transforms/Scalar/Reassociate.cpp:874
+      // the landingpad.
+      while (isa<PHINode>(InsertPt) || isa<LandingPadInst>(InsertPt))
+        ++InsertPt;
----------------
greened wrote:
> efriedma wrote:
> > Explicitly checking for LandingPad isn't sufficient on Windows.  There are two issues: one, you need to use isEHPad() to check for all the relevant exception-handling instructions, and two, you can't insert a negate into a block with a catchswitch.
> This code moves the negate around within the local block, so presumably the negate is already in the block and therefore there should be no `catchswitch`, right?
> 
> I will update this to use `isEHPad`.  Thanks!
> This code moves the negate around within the local block

No?  It moves the negate into the same block as the definition of "V", which as far as I can tell is not the same block where the "sub" instruction was originally located.  (There's a dominance relationship, but that isn't really helpful here.)

In particular, the case I'm worried about is where "V" is a phi in the same basic block as a catchswitch.


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D61089/new/

https://reviews.llvm.org/D61089





More information about the llvm-commits mailing list