aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/CodeGen.cpp
diff options
context:
space:
mode:
authorNikita Popov <npopov@redhat.com>2022-04-04 12:59:17 +0200
committerNikita Popov <npopov@redhat.com>2022-04-04 13:04:27 +0200
commit3c9f3f76f105196cd354a34f597b1ce88bee9b5d (patch)
tree94437ad5b5821083a91e8534a6c204ccfa16bbec /llvm/lib/CodeGen/CodeGen.cpp
parentd092df42f342be733678a7798454557f92fe27f1 (diff)
downloadllvm-3c9f3f76f105196cd354a34f597b1ce88bee9b5d.zip
llvm-3c9f3f76f105196cd354a34f597b1ce88bee9b5d.tar.gz
llvm-3c9f3f76f105196cd354a34f597b1ce88bee9b5d.tar.bz2
[ConstantFold] Fold zero-index GEPs with opaque pointers
With opaque pointers, we can eliminate zero-index GEPs even if they have multiple indices, as this no longer impacts the result type of the GEP. This optimization is already done for instructions in InstSimplify, but we were missing the corresponding constant expression handling. The constexpr transform is a bit more powerful, because it can produce a vector splat constant and also handles undef values -- it is an extension of an existing single-index transform.
Diffstat (limited to 'llvm/lib/CodeGen/CodeGen.cpp')
0 files changed, 0 insertions, 0 deletions