[llvm-commits] patch: teach dse about intrinsics

Nick Lewycky nicholas at mxc.ca
Sat Oct 24 19:42:38 PDT 2009


Chris Lattner wrote:
> 
> On Oct 17, 2009, at 10:14 PM, Nick Lewycky wrote:
> 
>> Nick Lewycky wrote:
>>> This patch creates a utility class like an Operator (GEPOperator and 
>>> friends) which represents instructions that clobber a pointer they're 
>>> given. This groups StoreInst together with certain intrinsics and 
>>> helps DSE handle them as a group.
>>> This also marks our first optimization based on @llvm.lifetime.end.
>>> Please review!
>>
>> Arr... minor bug. This had code:
>>
>>      // Because a memcpy or memmove is also a load, we can't skip it 
>> if we
>>      // didn't remove it.
>>      if (isa<MemTransferInst>(C))
>>        continue;
>>
>> the change to use isa<MemTransferInst>(C) was a late change, after I 
>> had run the nightly. (Previously I had a C->read() method but that's 
>> the same as testing for MemTransferInst.) The correct code negates the 
>> test:
>>
>>      // Because a memcpy or memmove is also a load, we can't skip it 
>> if we
>>      // didn't remove it.
>>      if (!isa<MemTransferInst>(C))
>>        continue;
>>
>> and since I know what you really want is a full patch, the updated 
>> patch is attached.
> 
> Hi Nick,
> 
> This is two changes: 1) to add ClobberingInst, and 2) use it to do new 
> stuff.  Because the two are conflated together into two patches, it 
> makes it harder to review either.
> 
> Because #2 is hidden in noise, I'll address #1 first: why is a new 
> pseudo instruction class like this the right way to go?  Why not add a 
> simple static helper function instead?

Done. The new patch is attached.

Nick
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dse-memintrinsics2.patch
Type: text/x-patch
Size: 11811 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20091024/b820022c/attachment.bin>


More information about the llvm-commits mailing list