[llvm-commits] [llvm] r61009 - /llvm/trunk/lib/Transforms/Scalar/GVN.cpp

Owen Anderson resistor at mac.com
Sun Dec 14 13:12:58 PST 2008


On Dec 14, 2008, at 12:21 PM, Chris Lattner wrote:
> What if the scalar value being analyzed is a load?
>
> -Chris
>>
>>  Value* v = CollapsePhi(PN);
>>  if (!v) {
>>    // Cache our phi construction results
>> -    phiMap[orig->getPointerOperand()].insert(PN);
>> +    if (LoadInst* L = dyn_cast<LoadInst>(orig))
>> +      phiMap[L->getPointerOperand()].insert(PN);
>> +    else
>> +      phiMap[orig].insert(PN);
>> +
>>    return PN;

You'll notice that there's a special case for loads in the one place  
that it matters.

--Owen
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2624 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20081214/68a3cda7/attachment.bin>


More information about the llvm-commits mailing list