[llvm-commits] [llvm] r42908 - in /llvm/trunk: include/llvm/CodeGen/ lib/CodeGen/ lib/Target/ARM/ lib/Target/Alpha/ lib/Target/IA64/ lib/Target/Mips/ lib/Target/PowerPC/ lib/Target/Sparc/ lib/Target/X86/ test/CodeGen/X86/
Evan Cheng
evan.cheng at apple.com
Sat Oct 13 22:51:19 PDT 2007
FYI. It's related to .set expression on x86-64.
Defined as
.set L0_set_302__yyparse,LBB302__yyparse-LJTI0__yyparse
used as
.long L0__set_302__yyparse
Evan
On Oct 13, 2007, at 10:48 PM, Evan Cheng wrote:
> Hi Dan,
>
> I have to back out this patch for now. It's causing a lot of
> x86-64 / Darwin (also possibly ARM / Darwin) compilation errors.
> Please investigate. Thanks!
>
> Evan
>
> On Oct 12, 2007, at 7:53 AM, Dan Gohman wrote:
>
>> Author: djg
>> Date: Fri Oct 12 09:53:36 2007
>> New Revision: 42908
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=42908&view=rev
>> Log:
>> Change the names used for internal labels to use the current
>> function symbol name instead of a codegen-assigned function
>> number.
>>
>> Thanks Evan! :-)
>>
>> Modified:
>> llvm/trunk/include/llvm/CodeGen/AsmPrinter.h
>> llvm/trunk/lib/CodeGen/AsmPrinter.cpp
>> llvm/trunk/lib/Target/ARM/ARMAsmPrinter.cpp
>> llvm/trunk/lib/Target/Alpha/AlphaAsmPrinter.cpp
>> llvm/trunk/lib/Target/IA64/IA64AsmPrinter.cpp
>> llvm/trunk/lib/Target/Mips/MipsAsmPrinter.cpp
>> llvm/trunk/lib/Target/PowerPC/PPCAsmPrinter.cpp
>> llvm/trunk/lib/Target/Sparc/SparcAsmPrinter.cpp
>> llvm/trunk/lib/Target/X86/X86ATTAsmPrinter.cpp
>> llvm/trunk/lib/Target/X86/X86IntelAsmPrinter.cpp
>> llvm/trunk/test/CodeGen/X86/2006-10-19-
>> SwitchUnnecessaryBranching.ll
>> llvm/trunk/test/CodeGen/X86/2007-01-08-InstrSched.ll
>> llvm/trunk/test/CodeGen/X86/fp_constant_op.llx
>>
>> Modified: llvm/trunk/include/llvm/CodeGen/AsmPrinter.h
>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/
>> CodeGen/AsmPrinter.h?rev=42908&r1=42907&r2=42908&view=diff
>>
>> =====================================================================
>> =
>> ========
>> --- llvm/trunk/include/llvm/CodeGen/AsmPrinter.h (original)
>> +++ llvm/trunk/include/llvm/CodeGen/AsmPrinter.h Fri Oct 12
>> 09:53:36 2007
>> @@ -36,13 +36,6 @@
>> class AsmPrinter : public MachineFunctionPass {
>> static char ID;
>>
>> - /// FunctionNumber - This provides a unique ID for each
>> function emitted in
>> - /// this translation unit. It is autoincremented by
>> SetupMachineFunction,
>> - /// and can be accessed with getFunctionNumber() and
>> - /// IncrementFunctionNumber().
>> - ///
>> - unsigned FunctionNumber;
>> -
>> protected:
>> // Necessary for external weak linkage support
>> std::set<const GlobalValue*> ExtWeakSymbols;
>> @@ -160,15 +153,6 @@
>> /// is being processed from runOnMachineFunction.
>> void SetupMachineFunction(MachineFunction &MF);
>>
>> - /// getFunctionNumber - Return a unique ID for the current
>> function.
>> - ///
>> - unsigned getFunctionNumber() const { return FunctionNumber; }
>> -
>> - /// IncrementFunctionNumber - Increase Function Number.
>> AsmPrinters should
>> - /// not normally call this, as the counter is automatically
>> bumped by
>> - /// SetupMachineFunction.
>> - void IncrementFunctionNumber() { FunctionNumber++; }
>> -
>> /// EmitConstantPool - Print to the current output stream
>> assembly
>> /// representations of the constants in the constant pool MCP.
>> This is
>> /// used to print out constants which have been "spilled to
>> memory" by
>>
>> Modified: llvm/trunk/lib/CodeGen/AsmPrinter.cpp
>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/
>> AsmPrinter.cpp?rev=42908&r1=42907&r2=42908&view=diff
>>
>> =====================================================================
>> =
>> ========
>> --- llvm/trunk/lib/CodeGen/AsmPrinter.cpp (original)
>> +++ llvm/trunk/lib/CodeGen/AsmPrinter.cpp Fri Oct 12 09:53:36 2007
>> @@ -35,7 +35,7 @@
>> char AsmPrinter::ID = 0;
>> AsmPrinter::AsmPrinter(std::ostream &o, TargetMachine &tm,
>> const TargetAsmInfo *T)
>> - : MachineFunctionPass((intptr_t)&ID), FunctionNumber(0), O(o), TM
>> (tm), TAI(T)
>> + : MachineFunctionPass((intptr_t)&ID), O(o), TM(tm), TAI(T)
>> {}
>>
>> std::string AsmPrinter::getSectionForFunction(const Function &F)
>> const {
>> @@ -169,7 +169,6 @@
>> void AsmPrinter::SetupMachineFunction(MachineFunction &MF) {
>> // What's my mangled name?
>> CurrentFnName = Mang->getValueName(MF.getFunction());
>> - IncrementFunctionNumber();
>> }
>>
>> /// EmitConstantPool - Print to the current output stream assembly
>> @@ -219,8 +218,9 @@
>> SwitchToDataSection(Section);
>> EmitAlignment(Alignment);
>> for (unsigned i = 0, e = CP.size(); i != e; ++i) {
>> - O << TAI->getPrivateGlobalPrefix() << "CPI" <<
>> getFunctionNumber() << '_'
>> - << CP[i].second << ":\t\t\t\t\t" << TAI->getCommentString()
>> << " ";
>> + O << TAI->getPrivateGlobalPrefix() << "CPI" << CP[i].second
>> + << '_' << CurrentFnName
>> + << ":\t\t\t\t\t" << TAI->getCommentString() << ' ';
>> WriteTypeSymbolic(O, CP[i].first.getType(), 0) << '\n';
>> if (CP[i].first.isMachineConstantPoolEntry())
>> EmitMachineConstantPoolValue(CP[i].first.Val.MachineCPVal);
>> @@ -293,10 +293,10 @@
>> // the assembler and linker the extents of the jump table
>> object. The
>> // second label is actually referenced by the code.
>> if (const char *JTLabelPrefix = TAI-
>>> getJumpTableSpecialLabelPrefix())
>> - O << JTLabelPrefix << "JTI" << getFunctionNumber() << '_' <<
>> i << ":\n";
>> + O << JTLabelPrefix << "JTI" << i << '_' << CurrentFnName <<
>> ":\n";
>>
>> - O << TAI->getPrivateGlobalPrefix() << "JTI" <<
>> getFunctionNumber()
>> - << '_' << i << ":\n";
>> + O << TAI->getPrivateGlobalPrefix() << "JTI" << i
>> + << '_' << CurrentFnName << ":\n";
>>
>> for (unsigned ii = 0, ee = JTBBs.size(); ii != ee; ++ii) {
>> O << JTEntryDirective << ' ';
>> @@ -306,15 +306,15 @@
>> // If we're emitting non-PIC code, then emit the entries as
>> direct
>> // references to the target basic blocks.
>> if (!EmittedSets.empty()) {
>> - O << TAI->getPrivateGlobalPrefix() << getFunctionNumber()
>> - << '_' << i << "_set_" << JTBBs[ii]->getNumber();
>> + O << TAI->getPrivateGlobalPrefix() << i
>> + << '_' << "_set_" << JTBBs[ii]->getNumber() << '_' <<
>> CurrentFnName;
>> } else if (IsPic) {
>> printBasicBlockLabel(JTBBs[ii], false, false);
>> // If the arch uses custom Jump Table directives, don't
>> calc relative to
>> // JT
>> if (!HadJTEntryDirective)
>> O << '-' << TAI->getPrivateGlobalPrefix() << "JTI"
>> - << getFunctionNumber() << '_' << i;
>> + << i << '_' << CurrentFnName;
>> } else {
>> printBasicBlockLabel(JTBBs[ii], false, false);
>> }
>> @@ -1242,8 +1242,8 @@
>> void AsmPrinter::printBasicBlockLabel(const MachineBasicBlock *MBB,
>> bool printColon,
>> bool printComment) const {
>> - O << TAI->getPrivateGlobalPrefix() << "BB" << getFunctionNumber
>> () << "_"
>> - << MBB->getNumber();
>> + O << TAI->getPrivateGlobalPrefix() << "BB" << MBB->getNumber()
>> << '_'
>> + << CurrentFnName;
>> if (printColon)
>> O << ':';
>> if (printComment && MBB->getBasicBlock())
>> @@ -1259,10 +1259,10 @@
>> return;
>>
>> O << TAI->getSetDirective() << ' ' << TAI-
>> >getPrivateGlobalPrefix()
>> - << getFunctionNumber() << '_' << uid << "_set_" << MBB-
>>> getNumber() << ',';
>> + << uid << "_set_" << MBB->getNumber() << '_' << CurrentFnName
>> << ',';
>> printBasicBlockLabel(MBB, false, false);
>> - O << '-' << TAI->getPrivateGlobalPrefix() << "JTI" <<
>> getFunctionNumber()
>> - << '_' << uid << '\n';
>> + O << '-' << TAI->getPrivateGlobalPrefix() << "JTI" << uid
>> + << '_' << CurrentFnName << '\n';
>> }
>>
>> void AsmPrinter::printSetLabel(unsigned uid, unsigned uid2,
>> @@ -1271,11 +1271,11 @@
>> return;
>>
>> O << TAI->getSetDirective() << ' ' << TAI-
>> >getPrivateGlobalPrefix()
>> - << getFunctionNumber() << '_' << uid << '_' << uid2
>> - << "_set_" << MBB->getNumber() << ',';
>> + << uid << '_' << uid2
>> + << "_set_" << MBB->getNumber() << '_' << CurrentFnName << ',';
>> printBasicBlockLabel(MBB, false, false);
>> - O << '-' << TAI->getPrivateGlobalPrefix() << "JTI" <<
>> getFunctionNumber()
>> - << '_' << uid << '_' << uid2 << '\n';
>> + O << '-' << TAI->getPrivateGlobalPrefix() << "JTI" << uid
>> + << '_' << uid2 << '_' << CurrentFnName << '\n';
>> }
>>
>> /// printDataDirective - This method prints the asm directive for
>> the
>>
>> Modified: llvm/trunk/lib/Target/ARM/ARMAsmPrinter.cpp
>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/
>> ARMAsmPrinter.cpp?rev=42908&r1=42907&r2=42908&view=diff
>>
>> =====================================================================
>> =
>> ========
>> --- llvm/trunk/lib/Target/ARM/ARMAsmPrinter.cpp (original)
>> +++ llvm/trunk/lib/Target/ARM/ARMAsmPrinter.cpp Fri Oct 12 09:53:36
>> 2007
>> @@ -319,12 +319,12 @@
>> break;
>> }
>> case MachineOperand::MO_ConstantPoolIndex:
>> - O << TAI->getPrivateGlobalPrefix() << "CPI" <<
>> getFunctionNumber()
>> - << '_' << MO.getConstantPoolIndex();
>> + O << TAI->getPrivateGlobalPrefix() << "CPI" <<
>> MO.getConstantPoolIndex()
>> + << '_' << CurrentFnName;
>> break;
>> case MachineOperand::MO_JumpTableIndex:
>> - O << TAI->getPrivateGlobalPrefix() << "JTI" <<
>> getFunctionNumber()
>> - << '_' << MO.getJumpTableIndex();
>> + O << TAI->getPrivateGlobalPrefix() << "JTI" <<
>> MO.getJumpTableIndex()
>> + << '_' << CurrentFnName;
>> break;
>> default:
>> O << "<unknown operand type>"; abort (); break;
>> @@ -652,8 +652,8 @@
>> // data itself.
>> if (!strcmp(Modifier, "label")) {
>> unsigned ID = MI->getOperand(OpNo).getImm();
>> - O << TAI->getPrivateGlobalPrefix() << "CPI" <<
>> getFunctionNumber()
>> - << '_' << ID << ":\n";
>> + O << TAI->getPrivateGlobalPrefix() << "CPI" << ID
>> + << '_' << CurrentFnName << ":\n";
>> } else {
>> assert(!strcmp(Modifier, "cpentry") && "Unknown modifier for
>> CPE");
>> unsigned CPI = MI->getOperand(OpNo).getConstantPoolIndex();
>> @@ -677,8 +677,8 @@
>> const MachineOperand &MO1 = MI->getOperand(OpNo);
>> const MachineOperand &MO2 = MI->getOperand(OpNo+1); // Unique Id
>> unsigned JTI = MO1.getJumpTableIndex();
>> - O << TAI->getPrivateGlobalPrefix() << "JTI" << getFunctionNumber()
>> - << '_' << JTI << '_' << MO2.getImmedValue() << ":\n";
>> + O << TAI->getPrivateGlobalPrefix() << "JTI" << JTI
>> + << '_' << MO2.getImmedValue() << '_' << CurrentFnName << ":\n";
>>
>> const char *JTEntryDirective = TAI->getJumpTableDirective();
>> if (!JTEntryDirective)
>> @@ -697,15 +697,16 @@
>>
>> O << JTEntryDirective << ' ';
>> if (UseSet)
>> - O << TAI->getPrivateGlobalPrefix() << getFunctionNumber()
>> - << '_' << JTI << '_' << MO2.getImmedValue()
>> - << "_set_" << MBB->getNumber();
>> + O << TAI->getPrivateGlobalPrefix() << JTI
>> + << '_' << MO2.getImmedValue()
>> + << "_set_" << MBB->getNumber()
>> + << CurrentFnName;
>> else if (TM.getRelocationModel() == Reloc::PIC_) {
>> printBasicBlockLabel(MBB, false, false);
>> // If the arch uses custom Jump Table directives, don't calc
>> relative to JT
>> if (!TAI->getJumpTableDirective())
>> O << '-' << TAI->getPrivateGlobalPrefix() << "JTI"
>> - << getFunctionNumber() << '_' << JTI << '_' <<
>> MO2.getImmedValue();
>> + << JTI << '_' << MO2.getImmedValue() << '_' <<
>> CurrentFnName;
>> } else
>> printBasicBlockLabel(MBB, false, false);
>> if (i != e-1)
>>
>> Modified: llvm/trunk/lib/Target/Alpha/AlphaAsmPrinter.cpp
>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/
>> Alpha/AlphaAsmPrinter.cpp?rev=42908&r1=42907&r2=42908&view=diff
>>
>> =====================================================================
>> =
>> ========
>> --- llvm/trunk/lib/Target/Alpha/AlphaAsmPrinter.cpp (original)
>> +++ llvm/trunk/lib/Target/Alpha/AlphaAsmPrinter.cpp Fri Oct 12
>> 09:53:36 2007
>> @@ -104,8 +104,8 @@
>> return;
>>
>> case MachineOperand::MO_ConstantPoolIndex:
>> - O << TAI->getPrivateGlobalPrefix() << "CPI" <<
>> getFunctionNumber() << "_"
>> - << MO.getConstantPoolIndex();
>> + O << TAI->getPrivateGlobalPrefix() << "CPI" <<
>> MO.getConstantPoolIndex()
>> + << '_' << CurrentFnName;
>> return;
>>
>> case MachineOperand::MO_ExternalSymbol:
>> @@ -121,8 +121,8 @@
>> }
>>
>> case MachineOperand::MO_JumpTableIndex:
>> - O << TAI->getPrivateGlobalPrefix() << "JTI" <<
>> getFunctionNumber()
>> - << '_' << MO.getJumpTableIndex();
>> + O << TAI->getPrivateGlobalPrefix() << "JTI" <<
>> MO.getJumpTableIndex()
>> + << '_' << CurrentFnName;
>> return;
>>
>> default:
>>
>> Modified: llvm/trunk/lib/Target/IA64/IA64AsmPrinter.cpp
>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/IA64/
>> IA64AsmPrinter.cpp?rev=42908&r1=42907&r2=42908&view=diff
>>
>> =====================================================================
>> =
>> ========
>> --- llvm/trunk/lib/Target/IA64/IA64AsmPrinter.cpp (original)
>> +++ llvm/trunk/lib/Target/IA64/IA64AsmPrinter.cpp Fri Oct 12
>> 09:53:36 2007
>> @@ -179,8 +179,8 @@
>> return;
>> case MachineOperand::MO_ConstantPoolIndex: {
>> O << "@gprel(" << TAI->getPrivateGlobalPrefix()
>> - << "CPI" << getFunctionNumber() << "_"
>> - << MO.getConstantPoolIndex() << ")";
>> + << "CPI" << MO.getConstantPoolIndex() << '_'
>> + << CurrentFnName << ")";
>> return;
>> }
>>
>>
>> Modified: llvm/trunk/lib/Target/Mips/MipsAsmPrinter.cpp
>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/
>> MipsAsmPrinter.cpp?rev=42908&r1=42907&r2=42908&view=diff
>>
>> =====================================================================
>> =
>> ========
>> --- llvm/trunk/lib/Target/Mips/MipsAsmPrinter.cpp (original)
>> +++ llvm/trunk/lib/Target/Mips/MipsAsmPrinter.cpp Fri Oct 12
>> 09:53:36 2007
>> @@ -363,7 +363,7 @@
>>
>> case MachineOperand::MO_ConstantPoolIndex:
>> O << TAI->getPrivateGlobalPrefix() << "CPI"
>> - << getFunctionNumber() << "_" << MO.getConstantPoolIndex();
>> + << MO.getConstantPoolIndex() << '_' << CurrentFnName;
>> break;
>>
>> default:
>>
>> Modified: llvm/trunk/lib/Target/PowerPC/PPCAsmPrinter.cpp
>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/
>> PowerPC/PPCAsmPrinter.cpp?rev=42908&r1=42907&r2=42908&view=diff
>>
>> =====================================================================
>> =
>> ========
>> --- llvm/trunk/lib/Target/PowerPC/PPCAsmPrinter.cpp (original)
>> +++ llvm/trunk/lib/Target/PowerPC/PPCAsmPrinter.cpp Fri Oct 12
>> 09:53:36 2007
>> @@ -164,7 +164,7 @@
>> O << "lo16(";
>> printOp(MI->getOperand(OpNo));
>> if (TM.getRelocationModel() == Reloc::PIC_)
>> - O << "-\"L" << getFunctionNumber() << "$pb\")";
>> + O << "-\"L" "pb$" << CurrentFnName << "\")";
>> else
>> O << ')';
>> }
>> @@ -208,8 +208,8 @@
>> O << (int)MI->getOperand(OpNo).getImmedValue()*4;
>> }
>> void printPICLabel(const MachineInstr *MI, unsigned OpNo) {
>> - O << "\"L" << getFunctionNumber() << "$pb\"\n";
>> - O << "\"L" << getFunctionNumber() << "$pb\":";
>> + O << "\"L" "pb$" << CurrentFnName << "\"\n";
>> + O << "\"L" "pb$" << CurrentFnName << "\":";
>> }
>> void printSymbolHi(const MachineInstr *MI, unsigned OpNo) {
>> if (MI->getOperand(OpNo).isImmediate()) {
>> @@ -218,7 +218,7 @@
>> if (Subtarget.isDarwin()) O << "ha16(";
>> printOp(MI->getOperand(OpNo));
>> if (TM.getRelocationModel() == Reloc::PIC_)
>> - O << "-\"L" << getFunctionNumber() << "$pb\"";
>> + O << "-\"L" "pb$" << CurrentFnName << "\"";
>> if (Subtarget.isDarwin())
>> O << ')';
>> else
>> @@ -232,7 +232,7 @@
>> if (Subtarget.isDarwin()) O << "lo16(";
>> printOp(MI->getOperand(OpNo));
>> if (TM.getRelocationModel() == Reloc::PIC_)
>> - O << "-\"L" << getFunctionNumber() << "$pb\"";
>> + O << "-\"L" "pb$" << CurrentFnName << "\"";
>> if (Subtarget.isDarwin())
>> O << ')';
>> else
>> @@ -362,13 +362,13 @@
>> printBasicBlockLabel(MO.getMachineBasicBlock());
>> return;
>> case MachineOperand::MO_JumpTableIndex:
>> - O << TAI->getPrivateGlobalPrefix() << "JTI" <<
>> getFunctionNumber()
>> - << '_' << MO.getJumpTableIndex();
>> + O << TAI->getPrivateGlobalPrefix() << "JTI" <<
>> MO.getJumpTableIndex()
>> + << '_' << CurrentFnName;
>> // FIXME: PIC relocation model
>> return;
>> case MachineOperand::MO_ConstantPoolIndex:
>> - O << TAI->getPrivateGlobalPrefix() << "CPI" <<
>> getFunctionNumber()
>> - << '_' << MO.getConstantPoolIndex();
>> + O << TAI->getPrivateGlobalPrefix() << "CPI" <<
>> MO.getConstantPoolIndex()
>> + << '_' << CurrentFnName;
>> return;
>> case MachineOperand::MO_ExternalSymbol:
>> // Computing the address of an external symbol, not calling it.
>>
>> Modified: llvm/trunk/lib/Target/Sparc/SparcAsmPrinter.cpp
>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/
>> Sparc/SparcAsmPrinter.cpp?rev=42908&r1=42907&r2=42908&view=diff
>>
>> =====================================================================
>> =
>> ========
>> --- llvm/trunk/lib/Target/Sparc/SparcAsmPrinter.cpp (original)
>> +++ llvm/trunk/lib/Target/Sparc/SparcAsmPrinter.cpp Fri Oct 12
>> 09:53:36 2007
>> @@ -164,8 +164,8 @@
>> O << MO.getSymbolName();
>> break;
>> case MachineOperand::MO_ConstantPoolIndex:
>> - O << TAI->getPrivateGlobalPrefix() << "CPI" <<
>> getFunctionNumber() << "_"
>> - << MO.getConstantPoolIndex();
>> + O << TAI->getPrivateGlobalPrefix() << "CPI" <<
>> MO.getConstantPoolIndex()
>> + << '_' << CurrentFnName;
>> break;
>> default:
>> O << "<unknown operand type>"; abort (); break;
>>
>> Modified: llvm/trunk/lib/Target/X86/X86ATTAsmPrinter.cpp
>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/
>> X86ATTAsmPrinter.cpp?rev=42908&r1=42907&r2=42908&view=diff
>>
>> =====================================================================
>> =
>> ========
>> --- llvm/trunk/lib/Target/X86/X86ATTAsmPrinter.cpp (original)
>> +++ llvm/trunk/lib/Target/X86/X86ATTAsmPrinter.cpp Fri Oct 12
>> 09:53:36 2007
>> @@ -31,14 +31,14 @@
>>
>> STATISTIC(EmittedInsts, "Number of machine instrs printed");
>>
>> -static std::string computePICLabel(unsigned FnNum,
>> +static std::string computePICLabel(const std::string &FnName,
>> const TargetAsmInfo *TAI,
>> const X86Subtarget* Subtarget) {
>> std::string label;
>> if (Subtarget->isTargetDarwin())
>> - label = "\"L" + utostr_32(FnNum) + "$pb\"";
>> + label = "\"L" "pb$" + FnName + "\"";
>> else if (Subtarget->isTargetELF())
>> - label = ".Lllvm$" + utostr_32(FnNum) + "$piclabel";
>> + label = ".Lllvm$piclabel$" + FnName;
>> else
>> assert(0 && "Don't know how to print PIC label!\n");
>>
>> @@ -236,13 +236,13 @@
>> case MachineOperand::MO_JumpTableIndex: {
>> bool isMemOp = Modifier && !strcmp(Modifier, "mem");
>> if (!isMemOp) O << '$';
>> - O << TAI->getPrivateGlobalPrefix() << "JTI" <<
>> getFunctionNumber() << "_"
>> - << MO.getJumpTableIndex();
>> + O << TAI->getPrivateGlobalPrefix() << "JTI" <<
>> MO.getJumpTableIndex()
>> + << '_' << CurrentFnName;
>>
>> if (TM.getRelocationModel() == Reloc::PIC_) {
>> if (Subtarget->isPICStyleStub())
>> - O << "-\"" << TAI->getPrivateGlobalPrefix() <<
>> getFunctionNumber()
>> - << "$pb\"";
>> + O << "-\"" << TAI->getPrivateGlobalPrefix() << "pb$" <<
>> CurrentFnName
>> + << "\"";
>> else if (Subtarget->isPICStyleGOT())
>> O << "@GOTOFF";
>> }
>> @@ -254,13 +254,13 @@
>> case MachineOperand::MO_ConstantPoolIndex: {
>> bool isMemOp = Modifier && !strcmp(Modifier, "mem");
>> if (!isMemOp) O << '$';
>> - O << TAI->getPrivateGlobalPrefix() << "CPI" <<
>> getFunctionNumber() << "_"
>> - << MO.getConstantPoolIndex();
>> + O << TAI->getPrivateGlobalPrefix() << "CPI" <<
>> MO.getConstantPoolIndex()
>> + << '_' << CurrentFnName;
>>
>> if (TM.getRelocationModel() == Reloc::PIC_) {
>> if (Subtarget->isPICStyleStub())
>> - O << "-\"" << TAI->getPrivateGlobalPrefix() <<
>> getFunctionNumber()
>> - << "$pb\"";
>> + O << "-\"" << TAI->getPrivateGlobalPrefix() << "pb$" <<
>> CurrentFnName
>> + << "\"";
>> else if (Subtarget->isPICStyleGOT())
>> O << "@GOTOFF";
>> }
>> @@ -317,8 +317,8 @@
>> }
>>
>> if (!isCallOp && TM.getRelocationModel() == Reloc::PIC_)
>> - O << "-\"" << TAI->getPrivateGlobalPrefix() <<
>> getFunctionNumber()
>> - << "$pb\"";
>> + O << "-\"" << TAI->getPrivateGlobalPrefix() << "pb$" <<
>> CurrentFnName
>> + << "\"";
>> } else {
>> if (GV->hasDLLImportLinkage()) {
>> O << "__imp_";
>> @@ -418,7 +418,7 @@
>> // popl %some_register
>> // addl $_GLOBAL_ADDRESS_TABLE_ + [.-piclabel], %
>> some_register
>> O << " + [.-"
>> - << computePICLabel(getFunctionNumber(), TAI, Subtarget)
>> << "]";
>> + << computePICLabel(CurrentFnName, TAI, Subtarget) << "]";
>>
>> if (isCallOp)
>> O << "@PLT";
>> @@ -498,7 +498,7 @@
>> }
>>
>> void X86ATTAsmPrinter::printPICLabel(const MachineInstr *MI,
>> unsigned Op) {
>> - std::string label = computePICLabel(getFunctionNumber(), TAI,
>> Subtarget);
>> + std::string label = computePICLabel(CurrentFnName, TAI,
>> Subtarget);
>> O << label << "\n" << label << ":";
>> }
>>
>>
>> Modified: llvm/trunk/lib/Target/X86/X86IntelAsmPrinter.cpp
>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/
>> X86IntelAsmPrinter.cpp?rev=42908&r1=42907&r2=42908&view=diff
>>
>> =====================================================================
>> =
>> ========
>> --- llvm/trunk/lib/Target/X86/X86IntelAsmPrinter.cpp (original)
>> +++ llvm/trunk/lib/Target/X86/X86IntelAsmPrinter.cpp Fri Oct 12
>> 09:53:36 2007
>> @@ -140,15 +140,15 @@
>> case MachineOperand::MO_JumpTableIndex: {
>> bool isMemOp = Modifier && !strcmp(Modifier, "mem");
>> if (!isMemOp) O << "OFFSET ";
>> - O << TAI->getPrivateGlobalPrefix() << "JTI" <<
>> getFunctionNumber()
>> - << "_" << MO.getJumpTableIndex();
>> + O << TAI->getPrivateGlobalPrefix() << "JTI" <<
>> MO.getJumpTableIndex()
>> + << '_' << CurrentFnName;
>> return;
>> }
>> case MachineOperand::MO_ConstantPoolIndex: {
>> bool isMemOp = Modifier && !strcmp(Modifier, "mem");
>> if (!isMemOp) O << "OFFSET ";
>> O << "[" << TAI->getPrivateGlobalPrefix() << "CPI"
>> - << getFunctionNumber() << "_" << MO.getConstantPoolIndex();
>> + << MO.getConstantPoolIndex() << '_' << CurrentFnName;
>> int Offset = MO.getOffset();
>> if (Offset > 0)
>> O << " + " << Offset;
>> @@ -236,8 +236,8 @@
>> }
>>
>> void X86IntelAsmPrinter::printPICLabel(const MachineInstr *MI,
>> unsigned Op) {
>> - O << "\"L" << getFunctionNumber() << "$pb\"\n";
>> - O << "\"L" << getFunctionNumber() << "$pb\":";
>> + O << "\"L" "pb$" << CurrentFnName << "\"\n";
>> + O << "\"L" "pb$" << CurrentFnName << "\":";
>> }
>>
>> bool X86IntelAsmPrinter::printAsmMRegister(const MachineOperand &MO,
>>
>> Modified: llvm/trunk/test/CodeGen/X86/2006-10-19-
>> SwitchUnnecessaryBranching.ll
>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/
>> X86/2006-10-19-SwitchUnnecessaryBranching.ll?
>> rev=42908&r1=42907&r2=42908&view=diff
>>
>> =====================================================================
>> =
>> ========
>> --- llvm/trunk/test/CodeGen/X86/2006-10-19-
>> SwitchUnnecessaryBranching.ll (original)
>> +++ llvm/trunk/test/CodeGen/X86/2006-10-19-
>> SwitchUnnecessaryBranching.ll Fri Oct 12 09:53:36 2007
>> @@ -1,5 +1,5 @@
>> ; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 | %prcontext
>> je 1 | \
>> -; RUN: grep BB1_1:
>> +; RUN: grep BB1_main:
>>
>> %str = internal constant [14 x sbyte] c"Hello world!\0A\00" ; <
>> [14 x sbyte]*> [#uses=1]
>> %str = internal constant [13 x sbyte] c"Blah world!\0A\00" ; <[13
>> x sbyte]*> [#uses=1]
>>
>> Modified: llvm/trunk/test/CodeGen/X86/2007-01-08-InstrSched.ll
>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/
>> X86/2007-01-08-InstrSched.ll?rev=42908&r1=42907&r2=42908&view=diff
>>
>> =====================================================================
>> =
>> ========
>> --- llvm/trunk/test/CodeGen/X86/2007-01-08-InstrSched.ll (original)
>> +++ llvm/trunk/test/CodeGen/X86/2007-01-08-InstrSched.ll Fri Oct 12
>> 09:53:36 2007
>> @@ -1,6 +1,6 @@
>> ; PR1075
>> ; RUN: llvm-as < %s | llc -mtriple=x86_64-apple-darwin | \
>> -; RUN: %prcontext {mulss LCPI1_3} 1 | grep mulss | count 1
>> +; RUN: %prcontext {mulss LCPI3__foo} 1 | grep mulss | count 1
>>
>> define float @foo(float %x) {
>> %tmp1 = mul float %x, 3.000000e+00
>>
>> Modified: llvm/trunk/test/CodeGen/X86/fp_constant_op.llx
>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/
>> X86/fp_constant_op.llx?rev=42908&r1=42907&r2=42908&view=diff
>>
>> =====================================================================
>> =
>> ========
>> --- llvm/trunk/test/CodeGen/X86/fp_constant_op.llx (original)
>> +++ llvm/trunk/test/CodeGen/X86/fp_constant_op.llx Fri Oct 12
>> 09:53:36 2007
>> @@ -3,32 +3,32 @@
>>
>> ; Test that the load of the constant is folded into the operation.
>>
>> -double %test_add(double %P) {
>> +double %foo_add(double %P) {
>> %tmp.1 = add double %P, 0x405EC00000000000
>> ret double %tmp.1
>> }
>>
>> -double %test_mul(double %P) {
>> +double %foo_mul(double %P) {
>> %tmp.1 = mul double %P, 0x405EC00000000000
>> ret double %tmp.1
>> }
>>
>> -double %test_sub(double %P) {
>> +double %foo_sub(double %P) {
>> %tmp.1 = sub double %P, 0x405EC00000000000
>> ret double %tmp.1
>> }
>>
>> -double %test_subr(double %P) {
>> +double %foo_subr(double %P) {
>> %tmp.1 = sub double 0x405EC00000000000, %P
>> ret double %tmp.1
>> }
>>
>> -double %test_div(double %P) {
>> +double %foo_div(double %P) {
>> %tmp.1 = div double %P, 0x405EC00000000000
>> ret double %tmp.1
>> }
>>
>> -double %test_divr(double %P) {
>> +double %foo_divr(double %P) {
>> %tmp.1 = div double 0x405EC00000000000, %P
>> ret double %tmp.1
>> }
>>
>>
>> _______________________________________________
>> llvm-commits mailing list
>> llvm-commits at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
> _______________________________________________
> 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