OSDN Git Service

[InlineCost] GetElementPtr with constant operands
authorKirill Naumov <knaumov@azul.com>
Tue, 2 Jun 2020 19:22:41 +0000 (19:22 +0000)
committerKirill Naumov <knaumov@azul.com>
Thu, 25 Jun 2020 18:09:51 +0000 (18:09 +0000)
commitd48c7859fbb911045b34ecd7f816186b9357d894
tree6a4e03f91c2ed4e8f9b033d6b599467e0fdd0aef
parentdbf7603be63957232814bb780de842a1ba84a363
[InlineCost] GetElementPtr with constant operands

If the GEP instruction contanins only constants as its arguments,
then it should be recognized as a constant. For now, there was
also added a flag to turn off this simplification if it causes
any regressions ("disable-gep-const-evaluation") which is off
by default. Once I gather needed data of the effectiveness of
this simplification, the flag will be deleted.

Reviewers: apilipenko, davidxl, mtrofin

Reviewed By: mtrofin

Differential Revision: https://reviews.llvm.org/D81026
llvm/lib/Analysis/InlineCost.cpp
llvm/test/Transforms/Inline/gep_from_constant.ll [new file with mode: 0644]