[llvm-commits] [llvm] r126445 - in /llvm/trunk: lib/Transforms/Utils/SimplifyCFG.cpp test/Transforms/SimplifyCFG/select-gep.ll

Frits van Bommel fvbommel at gmail.com
Thu Feb 24 15:00:58 PST 2011


On Thu, Feb 24, 2011 at 11:46 PM, Benjamin Kramer
<benny.kra at googlemail.com> wrote:
> SimplifyCFG: GEPs with constant indices are cheap enough to be executed unconditionally.
>
> +  case Instruction::GetElementPtr:
> +    // GEPs are cheap if all indices are constant.
> +    if (!cast<GetElementPtrInst>(I)->hasAllConstantIndices())
> +      return false;
> +    break;
>   case Instruction::Add:
>   case Instruction::Sub:
>   case Instruction::And:

Since it also allows add/sub/etc., it should maybe also allow GEPs
with one non-constant index?




More information about the llvm-commits mailing list