PrasoonMishra wrote: @arsenm Yes, as @krzysz00 also pointed out, this misses fat pointer accesses. LowerBufferFatPointers runs very late in the pipeline and after InstCombine. I'll refactor the OOB check for folding into a shared utility and use it from both InstCombine and the fat pointer lowering, so both paths are covered.
For regular load/store, InstCombine doesn't remove OOB in general. OOB is UB there. It folds provably invalid accesses ([null or undef pointers became unreachable)](https://github.com/llvm/llvm-project/blob/main/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp#L1133-L1139) and loads past the end of a [constant global fold to poison.](https://github.com/llvm/llvm-project/blob/main/llvm/lib/Analysis/ConstantFolding.cpp#L852-L856) https://github.com/llvm/llvm-project/pull/227402 _______________________________________________ llvm-branch-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
