[llvm-commits] [patch] Fix va_arg for double and some cleanups

Bob Wilson bob.wilson at apple.com
Mon Jul 12 10:26:26 PDT 2010


On Jul 9, 2010, at 3:25 PM, Rafael Espindola wrote:

>> But it's not the stack pointer itself that you care about here, it's the
>> alignment of whatever the prior argument was. So you really want to know
>> "What's the least alignment of any argument?" That's why I thought
>> getCallFrameTypeAlignment would work. If it's not returning the right
>> value, that may be a bug.
> 
> On IRC we agreed that we need yet another alignment type :-(
> 
> The attached patch adds MinStackArgumentAlignment to
> TargetLoweringInfo and uses that. I also extended the test a bit to
> check that only the necessary alignment is added.

Two minor comments:

> @@ -1515,6 +1527,11 @@ private:
>    /// buffers
>    unsigned JumpBufAlignment;
>  
> +  /// MinStackArgumentAlignment - The minimum alginment that any argument

typo: "alginment"

> +  /// on the stack needs to have.
> +  ///
> +  unsigned MinStackArgumentAlignment;
> +
>    /// PrefLoopAlignment - The perferred loop alignment.
>    ///
>    unsigned PrefLoopAlignment;


> @@ -5736,7 +5736,8 @@ void SelectionDAGBuilder::visitVAStart(const CallInst &I) {
>  void SelectionDAGBuilder::visitVAArg(const VAArgInst &I) {
>    SDValue V = DAG.getVAArg(TLI.getValueType(I.getType()), getCurDebugLoc(),
>                             getRoot(), getValue(I.getOperand(0)),
> -                           DAG.getSrcValue(I.getOperand(0)));
> +                           DAG.getSrcValue(I.getOperand(0)),
> +                           TLI.getTargetData()->getABITypeAlignment(I.getType()));

width exceeds 80 columns

>    setValue(&I, V);
>    DAG.setRoot(V.getValue(1));
>  }

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20100712/05ff0761/attachment.html>


More information about the llvm-commits mailing list