[llvm-commits] [PATCH] PR14646 Spilled XMM is assumed wrongly to be aligned

Manman Ren mren at apple.com
Fri Dec 21 12:11:24 PST 2012


Can you add the testing case to this patch?
Also please check whether the "realign-stack" option is on.
+      if ((Align > TM.getFrameLowering()->getStackAlignment()) &&
+          !TM.getRegisterInfo()->canRealignStack(MF))
+        return NULL;
+      MF.getFrameInfo()-> ensureMaxAlignment(Align);
+

There is a section right before:
     unsigned MinAlign = (I->second.second & TB_ALIGN_MASK) >> TB_ALIGN_SHIFT;
     if (Align < MinAlign)
       return NULL;
which should return NULL if Align is smaller than 16 for XORPSrr (16 is specified in the table).
It seems that the argument "Align" should be the actual alignment of the memory op and if it does not satisfy the requirement for folding,
we will return NULL.

So the root cause seems to be we should call ensureMaxAlignment while creating the frame object, not during folding.

Thanks for working on this,
Manman

On Dec 21, 2012, at 11:29 AM, "Schoedel, Kevin P" <kevin.p.schoedel at intel.com> wrote:

> Reload and use were being fused without specifying or verifying
> the stack alignment that would be required.
> 
> -- 
> Kevin Schoedel, Software Developer, Intel of Canada
> <kevin.p.schoedel at intel.com>      +1 (519) 772-2580
> 
> 
> <0001-PR14646-Spilled-XMM-is-assumed-wrongly-to-be-aligned.patch>_______________________________________________
> 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