[llvm-commits] [PATCH] align constant pool loads using preferred alignment

Paul Redmond paul at rapidmind.com
Tue Sep 16 11:07:09 PDT 2008


Hi,

As suggested by Dan Gohman:

This patch changes SelectionDAG::getConstantPool to always set the 
alignment of the ConstantPoolSDNode using the target's preferred 
alignment for the constant type.

In LegalizeDAG, when performing loads from the constant pool, the 
ConstantPoolSDNode's alignment is used in the calls to getLoad and 
getExtLoad.

This change prevents SelectionDAG::getLoad/getExtLoad from incorrectly 
choosing the ABI alignment for constant pool loads when Alignment == 0. 
The incorrect alignment is only a performance issue when ABI alignment 
does not equal preferred alignment (i.e., on x86 it was generating 
MOVUPS instead of MOVAPS for v4f32 constant loads when the default ABI 
alignment for 128bit vectors is forced to 1 byte.)

thanks,
Paul
-------------- next part --------------
A non-text attachment was scrubbed...
Name: const_pref_align.diff
Type: text/x-diff
Size: 4732 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20080916/353e641b/attachment.diff>


More information about the llvm-commits mailing list