[PATCH] D23271: Move AArch64BranchRelaxation to generic code

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Sun Oct 2 22:55:00 PDT 2016


arsenm added inline comments.


> hfinkel wrote in BranchRelaxation.cpp:171
> I'm not sure this is correct, the PowerPC branch relaxation pass has this:
> 
>   unsigned Align = MBB.getAlignment();
>   if (!Align)
>     return 0;
>   
>   unsigned AlignAmt = 1 << Align;
>   unsigned ParentAlign = MBB.getParent()->getAlignment();
>   
>   if (Align <= ParentAlign)
>     return OffsetToAlignment(Offset, AlignAmt);
>   
>   // The alignment of this MBB is larger than the function's alignment, so we
>   // can't tell whether or not it will insert nops. Assume that it will.
>   return AlignAmt + OffsetToAlignment(Offset, AlignAmt);
> 
> It is this last part of the check, where if the alignment is greater than the parent-function's alignment, we conservatively assume we get the full adjustment, that I don't see reflected here.

I fixed this in https://reviews.llvm.org/D25174

https://reviews.llvm.org/D23271





More information about the llvm-commits mailing list