[llvm-branch-commits] [llvm-branch] r76141 - in /llvm/branches/Apple/Bender-SWB: lib/CodeGen/PrologEpilogInserter.cpp lib/CodeGen/SelectionDAG/TargetLowering.cpp lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp lib/Target/X86/X86ISelLowering.cpp test/CodeGen/X86/inline-asm-tied.ll
Bill Wendling
isanbard at gmail.com
Thu Jul 16 19:16:35 PDT 2009
Author: void
Date: Thu Jul 16 21:16:20 2009
New Revision: 76141
URL: http://llvm.org/viewvc/llvm-project?rev=76141&view=rev
Log:
--- Merging r74886 into '.':
U lib/Target/X86/X86ISelLowering.cpp
--- Merging r74967 into '.':
U lib/CodeGen/SelectionDAG/TargetLowering.cpp
--- Merging r74968 into '.':
U lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp
--- Merging r75169 into '.':
G lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp
--- Merging r76120 into '.':
U test/CodeGen/X86/inline-asm-tied.ll
U lib/CodeGen/PrologEpilogInserter.cpp
Modified:
llvm/branches/Apple/Bender-SWB/lib/CodeGen/PrologEpilogInserter.cpp
llvm/branches/Apple/Bender-SWB/lib/CodeGen/SelectionDAG/TargetLowering.cpp
llvm/branches/Apple/Bender-SWB/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp
llvm/branches/Apple/Bender-SWB/lib/Target/X86/X86ISelLowering.cpp
llvm/branches/Apple/Bender-SWB/test/CodeGen/X86/inline-asm-tied.ll
Modified: llvm/branches/Apple/Bender-SWB/lib/CodeGen/PrologEpilogInserter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Bender-SWB/lib/CodeGen/PrologEpilogInserter.cpp?rev=76141&r1=76140&r2=76141&view=diff
==============================================================================
--- llvm/branches/Apple/Bender-SWB/lib/CodeGen/PrologEpilogInserter.cpp (original)
+++ llvm/branches/Apple/Bender-SWB/lib/CodeGen/PrologEpilogInserter.cpp Thu Jul 16 21:16:20 2009
@@ -889,6 +889,10 @@
if (Size > MaxCallFrameSize) MaxCallFrameSize = Size;
HasCalls = true;
FrameSDOps.push_back(I);
+ } else if (I->getOpcode() == TargetInstrInfo::INLINEASM) {
+ // An InlineAsm might be a call; assume it is to get the stack frame
+ // aligned correctly for calls.
+ HasCalls = true;
}
MachineFrameInfo *FFI = Fn.getFrameInfo();
Modified: llvm/branches/Apple/Bender-SWB/lib/CodeGen/SelectionDAG/TargetLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Bender-SWB/lib/CodeGen/SelectionDAG/TargetLowering.cpp?rev=76141&r1=76140&r2=76141&view=diff
==============================================================================
--- llvm/branches/Apple/Bender-SWB/lib/CodeGen/SelectionDAG/TargetLowering.cpp (original)
+++ llvm/branches/Apple/Bender-SWB/lib/CodeGen/SelectionDAG/TargetLowering.cpp Thu Jul 16 21:16:20 2009
@@ -2387,11 +2387,24 @@
// 'X' matches anything.
if (OpInfo.ConstraintCode == "X" && OpInfo.CallOperandVal) {
+ // Look through bitcasts over functions. In the context of an asm
+ // argument we don't care about bitcasting function types; the parameters
+ // to the function, if any, will have been handled elsewhere.
+ Value *v = OpInfo.CallOperandVal;
+ ConstantExpr *CE = NULL;
+ while ((CE = dyn_cast<ConstantExpr>(v)) &&
+ CE->getOpcode()==Instruction::BitCast)
+ v = CE->getOperand(0);
+ if (!isa<Function>(v))
+ v = OpInfo.CallOperandVal;
// Labels and constants are handled elsewhere ('X' is the only thing
- // that matches labels).
- if (isa<BasicBlock>(OpInfo.CallOperandVal) ||
- isa<ConstantInt>(OpInfo.CallOperandVal))
+ // that matches labels). For Functions, the type here is the type of
+ // the result, which is not what we want to look at; leave them alone
+ // (minus any bitcasts).
+ if (isa<BasicBlock>(v) || isa<ConstantInt>(v) || isa<Function>(v)) {
+ OpInfo.CallOperandVal = v;
return;
+ }
// Otherwise, try to resolve it to something we know about by looking at
// the actual operand type.
Modified: llvm/branches/Apple/Bender-SWB/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Bender-SWB/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp?rev=76141&r1=76140&r2=76141&view=diff
==============================================================================
--- llvm/branches/Apple/Bender-SWB/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp (original)
+++ llvm/branches/Apple/Bender-SWB/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp Thu Jul 16 21:16:20 2009
@@ -760,7 +760,7 @@
// These only apply to registers, ignore on mem.
break;
case 'P': // Don't print @PLT, but do print as memory.
- printOperand(MI, OpNo, "mem");
+ printOperand(MI, OpNo, "call");
return false;
}
}
Modified: llvm/branches/Apple/Bender-SWB/lib/Target/X86/X86ISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Bender-SWB/lib/Target/X86/X86ISelLowering.cpp?rev=76141&r1=76140&r2=76141&view=diff
==============================================================================
--- llvm/branches/Apple/Bender-SWB/lib/Target/X86/X86ISelLowering.cpp (original)
+++ llvm/branches/Apple/Bender-SWB/lib/Target/X86/X86ISelLowering.cpp Thu Jul 16 21:16:20 2009
@@ -8579,10 +8579,15 @@
continue;
}
}
-
+
// Otherwise, this isn't something we can handle, reject it.
return;
}
+ // If we require an extra load to get this address, as in PIC mode, we
+ // can't accept it.
+ if (Subtarget->GVRequiresExtraLoad(GA->getGlobal(),
+ getTargetMachine(), false))
+ return;
if (hasMemory)
Op = LowerGlobalAddress(GA->getGlobal(), Op.getDebugLoc(), Offset, DAG);
Modified: llvm/branches/Apple/Bender-SWB/test/CodeGen/X86/inline-asm-tied.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Bender-SWB/test/CodeGen/X86/inline-asm-tied.ll?rev=76141&r1=76140&r2=76141&view=diff
==============================================================================
--- llvm/branches/Apple/Bender-SWB/test/CodeGen/X86/inline-asm-tied.ll (original)
+++ llvm/branches/Apple/Bender-SWB/test/CodeGen/X86/inline-asm-tied.ll Thu Jul 16 21:16:20 2009
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s | llc -mtriple=i386-apple-darwin9 -O0 | grep {movl %edx, 4(%esp)} | count 2
+; RUN: llvm-as < %s | llc -mtriple=i386-apple-darwin9 -O0 | grep {movl %edx, 12(%esp)} | count 2
; rdar://6992609
target triple = "i386-apple-darwin9.0"
More information about the llvm-branch-commits
mailing list