[PATCH] D156657: [InstCombine] Fold icmp(constants[x]) when the range of x is given

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 7 02:49:29 PDT 2023


nikic added a comment.

> Besides, there exists miscompilation, I found just now. Current state-machine doesn't emit the CmpInst/Poison to guarrantee the index/offset is always not negative. Lack of such range-check would lead to something triggering UB not to doing so. I need to check it later.

It's okay for transforms to remove UB (this is called "refinement" and done by many transforms). You just can't introduce new UB / poison that did not exist before.


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

https://reviews.llvm.org/D156657



More information about the llvm-commits mailing list