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

Hal Finkel hfinkel at anl.gov
Mon Oct 17 11:41:11 PDT 2011


On Mon, 2011-10-17 at 10:12 -0700, Jakob Stoklund Olesen wrote:
> 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?

Done.

 -Hal

> 
> Thanks,
> /jakob
> 

-- 
Hal Finkel
Postdoctoral Appointee
Leadership Computing Facility
Argonne National Laboratory




More information about the llvm-commits mailing list