[PATCH] D97665: [InstSimplify] Don't fold comparisons of non-inbounds GEPs
LemonBoy via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon May 10 14:37:54 PDT 2021
LemonBoy added inline comments.
================
Comment at: llvm/test/Transforms/InstSimplify/ConstProp/icmp-null.ll:203
; CHECK-LABEL: @global_gep_ugt_global_neg_offset(
-; CHECK-NEXT: ret i1 true
+; CHECK-NEXT: ret i1 icmp ugt ([2 x i32]* getelementptr ([2 x i32], [2 x i32]* @g, i64 -1), [2 x i32]* @g)
;
----------------
nikic wrote:
> For the tests that changed, could you please add a copy that has the `inbounds` keyword, so that the folding case is still covered?
There's something weird going on, `SimplifyGEPInst` in `InstructionSimplify.cpp` is silently dropping the `inbounds` flag thus preventing the fold from happening.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D97665/new/
https://reviews.llvm.org/D97665
More information about the llvm-commits
mailing list