[PATCH] D91153: [IndVarSimplify] Fix Modified status when handling dead PHI nodes

David Stenberg via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 18 00:49:35 PST 2020


dstenb added inline comments.


================
Comment at: llvm/lib/Transforms/Scalar/IndVarSimplify.cpp:2869
           RecursivelyDeleteTriviallyDeadInstructions(Inst, TLI, MSSAU.get());
+  }
 
----------------
mkazantsev wrote:
> Do I understand correctly that if `RecursivelyDeleteTriviallyDeadInstructions` is given a Phi as argument, it doesn't work with it correctly? Maybe we should do this inside of this function? Its name suggests that it should handle any instructions.
The `RecursivelyDeleteTriviallyDeadInstructions` instruction is able to delete PHI nodes that are trivially dead. It does not handle the PHI node pairs of the following form that this patch deals with:

```
%dec.lcssa7.i = phi i64 [ undef, %entry ], [ %0, %for.inc10.i ]
%0 = add i64 %dec.lcssa7.i, -6
```

since the PHI node has an use (the incoming value).


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D91153



More information about the llvm-commits mailing list