[llvm-commits] [llvm] r126445 - in /llvm/trunk: lib/Transforms/Utils/SimplifyCFG.cpp test/Transforms/SimplifyCFG/select-gep.ll
Dan Gohman
gohman at apple.com
Thu Feb 24 15:37:37 PST 2011
On Feb 24, 2011, at 3:00 PM, 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?
A gep with one non-constant index is a multiply and an add. How
speculative are you feeling? ;-)
Dan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20110224/07416dd4/attachment.html>
More information about the llvm-commits
mailing list