[llvm-commits] [llvm] r52377 - in /llvm/trunk/lib/Target/X86: X86ISelDAGToDAG.cpp X86ISelLowering.cpp

Evan Cheng evan.cheng at apple.com
Tue Jun 17 19:48:38 PDT 2008


Oops. This is fixed.

Evan

On Jun 17, 2008, at 3:38 PM, Julien Lerouge wrote:

> Hello Evan,
>
> This patch seems to break llvm-gcc. Using the build_gcc script (builds
> the "Apple way"), I get a native i686 compiler that seems to have
> problem with -g option:
>
> t.c:
> int main ()
> {
>  int i = 0;
>  return i;
> }
>
> $ ./gcc -g -o t t.c
> Cannot yet select llvm.dbg.declare: 0x41b0bee0: ch = declare  
> 0x41b0baf0, 0x41b0be10, 0x41b0c440t.c:5: internal compiler error:  
> Abort trap
> Please submit a full bug report,
> with preprocessed source if appropriate.
> See <URL:http://developer.apple.com/bugreporter> for instructions.
>
> I guess it has to do with the change in X86ISelLowering.cpp below ?
>
> Thanks,
> Julien
>
> On Tue, Jun 17, 2008 at 02:01:23AM +0000, Evan Cheng wrote:
>> Author: evancheng
>> Date: Mon Jun 16 21:01:22 2008
>> New Revision: 52377
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=52377&view=rev
>> Log:
>> Rather than avoiding to wrap ISD::DECLARE GV operand in  
>> X86ISD::Wrapper, simply handle it at dagisel time with x86 specific  
>> isel code.
>>
>> Modified:
>>    llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp
>>    llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
>>
>> Modified: llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp
>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp?rev=52377&r1=52376&r2=52377&view=diff
>>
>> = 
>> = 
>> = 
>> = 
>> = 
>> = 
>> = 
>> = 
>> = 
>> =====================================================================
>> --- llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp (original)
>> +++ llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp Mon Jun 16  
>> 21:01:22 2008
>> @@ -1578,6 +1578,28 @@
>>       return ResNode;
>>       break;
>>     }
>> +
>> +    case ISD::DECLARE: {
>> +      // Handle DECLARE nodes here because the second operand may  
>> have been
>> +      // wrapped in X86ISD::Wrapper.
>> +      SDOperand Chain = Node->getOperand(0);
>> +      SDOperand N1 = Node->getOperand(1);
>> +      SDOperand N2 = Node->getOperand(2);
>> +      if (isa<FrameIndexSDNode>(N1) &&
>> +          N2.getOpcode() == X86ISD::Wrapper &&
>> +          isa<GlobalAddressSDNode>(N2.getOperand(0))) {
>> +        int FI = cast<FrameIndexSDNode>(N1)->getIndex();
>> +        GlobalValue *GV =
>> +          cast<GlobalAddressSDNode>(N2.getOperand(0))->getGlobal();
>> +        SDOperand Tmp1 = CurDAG->getTargetFrameIndex(FI,  
>> TLI.getPointerTy());
>> +        SDOperand Tmp2 = CurDAG->getTargetGlobalAddress(GV,  
>> TLI.getPointerTy());
>> +        AddToISelQueue(Chain);
>> +        SDOperand Ops[] = { Tmp1, Tmp2, Chain };
>> +        return CurDAG->getTargetNode(TargetInstrInfo::DECLARE,
>> +                                     MVT::Other, Ops, 3);
>> +      }
>> +      break;
>> +    }
>>   }
>>
>>   SDNode *ResNode = SelectCode(N);
>>
>> Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=52377&r1=52376&r2=52377&view=diff
>>
>> = 
>> = 
>> = 
>> = 
>> = 
>> = 
>> = 
>> = 
>> = 
>> =====================================================================
>> --- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original)
>> +++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Mon Jun 16  
>> 21:01:22 2008
>> @@ -4173,9 +4173,6 @@
>> X86TargetLowering::LowerGlobalAddress(SDOperand Op, SelectionDAG  
>> &DAG) {
>>   GlobalValue *GV = cast<GlobalAddressSDNode>(Op)->getGlobal();
>>   SDOperand Result = DAG.getTargetGlobalAddress(GV, getPointerTy());
>> -  // If it's a debug information descriptor, don't mess with it.
>> -  if (DAG.isVerifiedDebugInfoDesc(Op))
>> -    return Result;
>>   Result = DAG.getNode(X86ISD::Wrapper, getPointerTy(), Result);
>>   // With PIC, the address is actually $g + Offset.
>>   if (getTargetMachine().getRelocationModel() == Reloc::PIC_ &&
>>
>>
>> _______________________________________________
>> llvm-commits mailing list
>> llvm-commits at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
> -- 
> Julien Lerouge
> PGP Key Id: 0xB1964A62
> PGP Fingerprint: 392D 4BAD DB8B CE7F 4E5F FA3C 62DB 4AA7 B196 4A62
> PGP Public Key from: keyserver.pgp.com




More information about the llvm-commits mailing list