[llvm-commits] CVS: llvm/lib/Target/X86/X86AsmPrinter.cpp X86TargetAsmInfo.cpp

Chris Lattner clattner at apple.com
Wed Mar 7 21:15:58 PST 2007


> +          // Read-only data.
> +          bool isIntFPLiteral = Type->isInteger()  || Type- 
> >isFloatingPoint();
> +          if (C->ContainsRelocations() && Subtarget->isTargetDarwin 
> () &&
> +              TM.getRelocationModel() != Reloc::Static)

Please rearrange this to:
if (isdarwin && not static && containsrelocations)

putting the expensive check last.

> +            SwitchToDataSection("\t.const_data\n");
> +          else if (isIntFPLiteral && Size == 4 &&
> +                   TAI->getFourByteConstantSection())
> +            SwitchToDataSection(TAI->getFourByteConstantSection(),  
> I);
> +          else if (isIntFPLiteral && Size == 8 &&
> +                   TAI->getEightByteConstantSection())
> +            SwitchToDataSection(TAI->getEightByteConstantSection 
> (), I);
> +          else if (isIntFPLiteral && Size == 16 &&
> +                   TAI->getSixteenByteConstantSection())
> +            SwitchToDataSection(TAI->getSixteenByteConstantSection 
> (), I);

Do we really need to check isIntFPLiteral here?  Why can't something  
like {short,short} go in literal4 ?

-Chris



More information about the llvm-commits mailing list