[llvm-commits] [PATCH] TargetLowering::isLoadWidthReducible()

Ken Dyck kd at kendyck.com
Tue Mar 15 10:47:26 PDT 2011


The DSP that my back end targets has multiple address spaces. From
most of the address spaces, it is possible to load a 'small' integer
with a single instruction. But one address space can only load a
'large' integer in a single instruction. For that last address space,
I would like to custom lower 'small' loads to 'large' ones, then
truncate the result. But when I do, DAGCombiner detects the truncate
of a load, which it assumes can be reduced to a 'small' load,
effectively undoing the lowering operation.

The attached patch adds a hook to TargetLowering,
isLoadWidthReducible(), that allows back ends to stop the DAG combiner
before it reduces the size of a load in ReduceLoadWidth(). Would there
be any interest in applying it?

-Ken
-------------- next part --------------
A non-text attachment was scrubbed...
Name: isLoadWidthReducible.patch
Type: text/x-patch
Size: 1357 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20110315/f713ff10/attachment.bin>


More information about the llvm-commits mailing list