[llvm-commits] [llvm] r65367 - in /llvm/trunk: include/llvm/CodeGen/DwarfWriter.h include/llvm/CodeGen/SelectionDAG.h lib/CodeGen/SelectionDAG/FastISel.cpp lib/CodeGen/SelectionDAG/LegalizeDAG.cpp lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp test/DebugInfo/2009-01-30-Method.ll test/DebugInfo/deaddebuglabel.ll test/DebugInfo/forwardDecl.ll test/FrontendC++/2006-11-06-StackTrace.cpp test/FrontendC++/2006-11-30-Pubnames.cpp utils/TableGen/AsmWriterEmitter.cpp

Bill Wendling isanbard at gmail.com
Mon Feb 23 23:11:51 PST 2009


On Feb 23, 2009, at 10:20 PM, Evan Cheng wrote:

> On Feb 23, 2009, at 6:35 PM, Bill Wendling wrote:
>
>> -
>> +
>> +  /// FastCodeGen - True if generating code via the "fast" isel.
>> +  ///
>> +  bool FastCodeGen;
>> public:
>>  static char ID; // Pass identification, replacement for typeid
>>
>> @@ -104,6 +107,9 @@
>>  /// ShouldEmitDwarfDebug - Returns true if Dwarf debugging
>> declarations should
>>  /// be emitted.
>>  bool ShouldEmitDwarfDebug() const;
>> +
>> +  bool getFastCodeGen() const { return FastCodeGen; }
>> +  void setFastCodeGen(bool Fast) { FastCodeGen = Fast; }
>> };
>
> Bill, is this necessary? See LLVMTargetMachine.cpp:
>
>   case TargetMachine::AssemblyFile:
>     if (addAssemblyEmitter(PM, Fast, Out))
>       return FileModel::Error;
>
> It's passing in "Fast".
>
Possibly? Though the code is weird. Here's the X86 version:

bool X86TargetMachine::addAssemblyEmitter(PassManagerBase &PM, bool  
Fast,
                                           raw_ostream &Out) {
   assert(AsmPrinterCtor && "AsmPrinter was not linked in");
   if (AsmPrinterCtor)
     PM.add(AsmPrinterCtor(Out, *this));
   return false;
}

Note that the "if" conditional is redundant because of the assert.  
Also, it doesn't use the "Fast" boolean. But I'll look into it.

>> @@ -1289,9 +1292,8 @@
>>
>>        unsigned Line = DSP->getLine();
>>        unsigned Col = DSP->getColumn();
>> -        const Function *F = DAG.getMachineFunction().getFunction();
>>
>> -        if (!F->hasFnAttr(Attribute::OptimizeForSize)) {
>> +        if (Fast) {
>>          // A bit self-referential to have DebugLoc on Debug_Loc
>> nodes, but it
>>          // won't hurt anything.
>>          if (useDEBUG_LOC) {
>
> Ewww. Legalizer shouldn't have to do this.

Yeah. The whole debugging thing is gross and does things it shouldn't.

> Is this code even
> exercised? I don't see ISD::DBG_STOPPOINT ever being generated. If
> not, we should just make the default expansion to its chain.
>
I'm pretty sure I had to do something like this. It's easy to check, I  
suppose.

-bw




More information about the llvm-commits mailing list