[llvm-commits] Setting alignment when creating temporary patch

Evan Cheng evan.cheng at apple.com
Mon Jul 14 11:24:08 PDT 2008


Looks good. Thanks!

Evan
On Jul 12, 2008, at 6:41 PM, Mon P Wang wrote:

> Hi,
>
> I looked at uses of CreateStackTemporary to see if there were any
> other possible issues with alignment like in EmitStackConvert.  The
> only case that I saw was the case of a BIT_CONVERT when the convert
> from a scalar or a vector to a vector.
>
>   -- Mon Ping
>
>
> --- lib/CodeGen/SelectionDAG/LegalizeDAG.cpp    (revision 53520)
> +++ lib/CodeGen/SelectionDAG/LegalizeDAG.cpp    (working copy)
> @@ -5464,7 +5464,6 @@
>                                                       MVT DestVT) {
>    if (Op0.getValueType() == MVT::i32) {
>      // simple 32-bit [signed|unsigned] integer to float/double
> expansion
> -
>      // Get the stack frame index of a 8 byte buffer.
>      SDOperand StackSlot = DAG.CreateStackTemporary(MVT::f64);
>
> @@ -7015,7 +7014,9 @@
>        // The input is a scalar or single-element vector.
>        // Lower to a store/load so that it can be split.
>        // FIXME: this could be improved probably.
> -      SDOperand Ptr = DAG.CreateStackTemporary(InOp.getValueType());
> +      unsigned LdAlign = TLI.getTargetData()->getPrefTypeAlignment(
> +
> Op.getValueType().getTypeForMVT());
> +      SDOperand Ptr = DAG.CreateStackTemporary(InOp.getValueType(),
> LdAlign);
>        int FI = cast<FrameIndexSDNode>(Ptr.Val)->getIndex();
>
>        SDOperand St = DAG.getStore(DAG.getEntryNode(),
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits




More information about the llvm-commits mailing list