[llvm-commits] [llvm] r142194 - /llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp

Jakob Stoklund Olesen stoklund at 2pi.dk
Mon Oct 17 10:12:05 PDT 2011


On Oct 17, 2011, at 10:01 AM, Hal Finkel wrote:

> Author: hfinkel
> Date: Mon Oct 17 12:01:41 2011
> New Revision: 142194
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=142194&view=rev
> Log:
> Instructions for Book E PPC should be word aligned, set function alignment to reflect this
> 
> Modified:
>    llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp
> 
> Modified: llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp?rev=142194&r1=142193&r2=142194&view=diff
> ==============================================================================
> --- llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp (original)
> +++ llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp Mon Oct 17 12:01:41 2011
> @@ -402,9 +402,16 @@
>     setLibcallName(RTLIB::EXP2_PPCF128, "exp2l$LDBL128");
>   }
> 
> -  setMinFunctionAlignment(2);
> -  if (PPCSubTarget.isDarwin())
> -    setPrefFunctionAlignment(4);
> +  if (PPCSubTarget.isBookE()) {
> +    // Book E: Instructions are always four bytes long and word-aligned.
> +    setMinFunctionAlignment(4);
> +    setPrefFunctionAlignment(8);
> +  }
> +  else {
> +    setMinFunctionAlignment(2);
> +    if (PPCSubTarget.isDarwin())
> +      setPrefFunctionAlignment(4);
> +  }

Alignments are log2(bytes), not bytes.

This fact is hidden very well in the headers. Mind adding some comments to the set*Alignment functions?

Thanks,
/jakob




More information about the llvm-commits mailing list