diff options
author | Nikita Popov <npopov@redhat.com> | 2022-05-02 17:52:02 +0200 |
---|---|---|
committer | Nikita Popov <npopov@redhat.com> | 2022-05-02 17:56:01 +0200 |
commit | 95fedfab6cfb82a2fe1010d266b1269425f5eb46 (patch) | |
tree | d729ed84f4197ba444e93023a36643e84c816455 /clang/lib/Frontend/CompilerInvocation.cpp | |
parent | aa69cb76958c7cab9f079e3fd0d87515821b2309 (diff) | |
download | llvm-95fedfab6cfb82a2fe1010d266b1269425f5eb46.zip llvm-95fedfab6cfb82a2fe1010d266b1269425f5eb46.tar.gz llvm-95fedfab6cfb82a2fe1010d266b1269425f5eb46.tar.bz2 |
[InstCombine] Handle non-canonical GEP index in indexed compare fold (PR55228)
Normally the index type will already be canonicalized here, but
this is not guaranteed depending on visitation order. The code
was already accounting for a potentially needed sext, but a trunc
may also be needed.
Add a ConstantExpr::getSExtOrTrunc() helper method to make this
simpler. This matches the corresponding IRBuilder method in behavior.
Fixes https://github.com/llvm/llvm-project/issues/55228.
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
0 files changed, 0 insertions, 0 deletions