[all-commits] [llvm/llvm-project] 5f01a6: [ConstantFold] Fix inbounds inference on mismatchi...
Nikita Popov via All-commits
all-commits at lists.llvm.org
Tue Jan 31 02:33:54 PST 2023
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 5f01a626dd0615df49773d419c75aeb33666ee83
https://github.com/llvm/llvm-project/commit/5f01a626dd0615df49773d419c75aeb33666ee83
Author: Nikita Popov <npopov at redhat.com>
Date: 2023-01-31 (Tue, 31 Jan 2023)
Changed paths:
M clang/test/CodeGenCXX/no-unique-address.cpp
M llvm/lib/IR/ConstantFold.cpp
M llvm/test/Assembler/opaque-ptr.ll
M llvm/test/Transforms/InferAddressSpaces/AMDGPU/infer-getelementptr.ll
M llvm/test/Transforms/InstCombine/getelementptr.ll
M llvm/test/Transforms/InstCombine/memchr-9.ll
M llvm/test/Transforms/InstCombine/wcslen-1.ll
M llvm/test/Transforms/InstSimplify/compare.ll
Log Message:
-----------
[ConstantFold] Fix inbounds inference on mismatching source element type
When inferring that a GEP of a global variable is inbounds because
there is no notional overindexing, we need to check that the
global value type and the GEP source element type match.
This was not necessary with typed pointers (because we would have
a bitcast in between), but is necessary with opaque pointers.
We should be able to recover some of the safe cases by performing
an offset based inbounds inference in DL-aware ConstantFolding.
More information about the All-commits
mailing list