[llvm-commits] [llvm] r167121 - /llvm/trunk/lib/Transforms/Utils/SimplifyCFG.cpp
Hans Wennborg
hans at chromium.org
Wed Oct 31 08:33:05 PDT 2012
Hi Duncan, I've addressed your comments in r167130.
Thanks,
Hans
On Wed, Oct 31, 2012 at 3:22 PM, Duncan Sands <baldrick at free.fr> wrote:
> Hi Hans, thanks for doing this.
>
>> +/// LookupConstant - If V is a Constant, return it. Otherwise, try to
>> look up
>> +/// its constant value in ConstantPool, returning NULL if it's not there.
>
> NULL -> null
>
>
>> + Constant *A = LookupConstant(Select->getCondition(), ConstantPool);
>> + if (!A)
>> + return 0;
>> + if (A->isAllOnesValue())
>> + return LookupConstant(Select->getTrueValue(), ConstantPool);
>> + if (A->isNullValue())
>> + return LookupConstant(Select->getFalseValue(), ConstantPool);
>
>
> Should have
> return 0;
> at this point in case the condition wasn't a constant integer.
More information about the llvm-commits
mailing list