[PATCH] D100663: [LV] Add undef incoming value to loop-exit phis for the middle-block.

Philip Reames via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 16 10:51:24 PDT 2021


reames added a comment.

This is incorrect and will result in subtle miscompiles.

Why?  Because SCEV is queried over the IR before point of undef insertion and replacement.  SCEV will - correctly - assume that it can substitute any valid concrete value for the undef.  However, the actual value later inserted is more constrained than undef.  As such, the intermediate SCEV results - both as used immediately and as cached - will be incorrect for the final IR.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D100663



More information about the llvm-commits mailing list