[SeparateConstOffsetFromGEP] Allow SeparateConstOffsetFromGEP pass to lower GEPs.

If LowerGEP is enabled, it can lower a GEP with multiple indices into GEPs with a single index
or arithmetic operations. Lowering GEPs can always extract structure indices. Lowering GEPs can
also give use more optimization opportunities. It can benefit passes like CSE, LICM and CGP.

Reviewed in http://reviews.llvm.org/D5864


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222328 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Hao Liu
2014-11-19 06:24:44 +00:00
parent 1d4f28c6bc
commit eb52f383c2
2 changed files with 275 additions and 41 deletions

View File

@@ -395,7 +395,9 @@ FunctionPass *createAddDiscriminatorsPass();
//
// SeparateConstOffsetFromGEP - Split GEPs for better CSE
//
FunctionPass *createSeparateConstOffsetFromGEPPass();
FunctionPass *
createSeparateConstOffsetFromGEPPass(const TargetMachine *TM = nullptr,
bool LowerGEP = false);
//===----------------------------------------------------------------------===//
//