[llvm-commits] [llvm] r126445 - in /llvm/trunk: lib/Transforms/Utils/SimplifyCFG.cpp test/Transforms/SimplifyCFG/select-gep.ll
Benjamin Kramer
benny.kra at googlemail.com
Thu Feb 24 15:31:01 PST 2011
On 25.02.2011, at 00:00, Frits van Bommel wrote:
> 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?
Yup, added in r126452.
More information about the llvm-commits
mailing list