[llvm-commits] patch: teach dse about intrinsics

Nick Lewycky nicholas at mxc.ca
Sat Oct 17 22:14:46 PDT 2009


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.

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


More information about the llvm-commits mailing list