[PATCH] D104618: [LoopDeletion] Exploit undef Phi inputs when symbolically executing 1st iteration

Max Kazantsev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 22 01:48:30 PDT 2021


mkazantsev added a comment.

As yesterday, wings-down to give some time to underlying patch to fail. :)



================
Comment at: llvm/lib/Transforms/Scalar/LoopDeletion.cpp:263
         Value *Incoming = PN.getIncomingValueForBlock(Pred);
+        // Skip undefs. If they are present, we can assume they equal to the
+        // non-undef input.
----------------
nikic wrote:
> nit: they are equal
Will fix


================
Comment at: llvm/test/Transforms/LoopDeletion/eval_first_iteration.ll:744
 ; CHECK:       if.true:
 ; CHECK-NEXT:    br i1 undef, label [[IF_TRUE_1:%.*]], label [[IF_TRUE_2:%.*]]
 ; CHECK:       if.true.1:
----------------
nikic wrote:
> It would be good to replace these `br i1 undef` by `br i1 %c1` where `%c1` is an arg, to avoid making the code UB.
Good point!


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

https://reviews.llvm.org/D104618



More information about the llvm-commits mailing list