Reland [InstCombine] Infer inbounds for more GEPs of dereferenceable pointers
authorArthur Eubanks <aeubanks@google.com>
Mon, 26 Jun 2023 20:52:18 +0000 (13:52 -0700)
committerArthur Eubanks <aeubanks@google.com>
Tue, 27 Jun 2023 16:31:20 +0000 (09:31 -0700)
commit457dc72fdd2eefe364548e721619cc1951854372
tree2d1e8866c167180f31f709c44a54848db2fd07d4
parent6c25c58a4d7caa0337d36bb8c41546f2002130d1
Reland [InstCombine] Infer inbounds for more GEPs of dereferenceable pointers

Use Value::getPointerDereferenceableBytes() instead of hardcoding dereferenceable only for allocas. Allows us to infer inbounds GEPs for other Values like CallInsts and Arguments.

Fixed clang test broken in initial land.

Reviewed By: nikic

Differential Revision: https://reviews.llvm.org/D153815
clang/test/CodeGenOpenCL/builtins-amdgcn.cl
llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
llvm/test/Transforms/InstCombine/compare-unescaped.ll
llvm/test/Transforms/InstCombine/inbounds-gep.ll
llvm/test/Transforms/PhaseOrdering/X86/vec-load-combine.ll
llvm/test/Transforms/PhaseOrdering/bitcast-store-branch.ll
llvm/test/Transforms/PhaseOrdering/dce-after-argument-promotion-loads.ll