[PATCH] D120371: [instcombine] Generalize one-compare rule from foldAllocaCmp for noalias calls

Philip Reames via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 22 17:44:09 PST 2022


reames added inline comments.


================
Comment at: llvm/test/Transforms/InstCombine/compare-unescaped.ll:302
 
-; FIXME: This appears correct, but the current implementation relies
-; on visiting both cmps in the same pass.  We may have an simplification order
-; under which one is missed, and that would be a bug.
 define void @neg_consistent_fold4() {
 ; CHECK-LABEL: @neg_consistent_fold4(
----------------
To help others avoid the same confusion I had: This case isn't being caught by foldAllocCmp.  We have another transform in visitAllocSite which is doing escape analysis and removing the allocation in one go - and thus doing consistent folding.

I should probably add a non-capturing use to this test.  


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

https://reviews.llvm.org/D120371



More information about the llvm-commits mailing list