[llvm-commits] [llvm] r40502 - /llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp

Evan Cheng evan.cheng at apple.com
Wed Jul 25 23:30:16 PDT 2007


I do want to support static codegen for JIT. If non-JIT mode silently  
change it to dynamic-no-pic, then we can't emulate with llc.

An alternative is to define a code model that is somewhere between  
small and medium. It's only used by Mac OS / static though. Not sure  
if that's cleaner?

Evan

Sent from my iPhone

On Jul 25, 2007, at 10:47 PM, Chris Lattner <clattner at apple.com> wrote:

>
> On Jul 25, 2007, at 4:41 PM, Evan Cheng wrote:
>
>> Author: evancheng
>> Date: Wed Jul 25 18:41:36 2007
>> New Revision: 40502
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=40502&view=rev
>> Log:
>> Mac OS X x86-64 lower 4G address is not available.
>
> Hi Evan,
>
> Would it be better to have the X86 backend change the relo module to
> mdynamic-no-pic on darwin?  It seems strange to test the os in a low-
> level place like this.
>
> -Chirs
>
>> Modified:
>>    llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp
>>
>> Modified: llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp
>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/
>> X86ISelDAGToDAG.cpp?rev=40502&r1=40501&r2=40502&view=diff
>>
>> === 
>> ===================================================================
>> ========
>> --- llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp (original)
>> +++ llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp Wed Jul 25
>> 18:41:36 2007
>> @@ -615,7 +615,8 @@
>>       SDOperand N0 = N.getOperand(0);
>>       if (GlobalAddressSDNode *G = dyn_cast<GlobalAddressSDNode>
>> (N0)) {
>>         GlobalValue *GV = G->getGlobal();
>> -        bool isAbs32 = !is64Bit || isStatic;
>> +        // Mac OS X X86-64 lower 4G address is not available.
>> +        bool isAbs32 = !is64Bit || (isStatic && !Subtarget-
>>> isTargetDarwin());
>>         if (isAbs32 || isRoot) {
>>           AM.GV = GV;
>>           AM.Disp += G->getOffset();
>>
>>
>> _______________________________________________
>> 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