[llvm-commits] [llvm] r140966 - in /llvm/trunk/lib/Transforms: InstCombine/InstCombineSelect.cpp Utils/CloneFunction.cpp

Nick Lewycky nicholas at mxc.ca
Sun Oct 2 03:41:01 PDT 2011


Duncan Sands wrote:
> Hi Nick,
>
>> --- llvm/trunk/lib/Transforms/InstCombine/InstCombineSelect.cpp (original)
>> +++ llvm/trunk/lib/Transforms/InstCombine/InstCombineSelect.cpp Sun Oct  2 04:12:55 2011
>> @@ -324,9 +324,14 @@
>>        }
>>
>>        // All operands were constants, fold it.
>> -    if (ConstOps.size() == I->getNumOperands())
>> +    if (ConstOps.size() == I->getNumOperands()) {
>> +      if (LoadInst *LI = dyn_cast<LoadInst>(I))
>> +        if (!LI->isVolatile())
>> +          return ConstantFoldLoadFromConstPtr(ConstOps[0], TD);
>
> shouldn't ConstantFoldLoadFromConstPtr refuse to fold volatile loads?

It never gets to see the actual LoadInst.

Nick



More information about the llvm-commits mailing list