[llvm-branch-commits] [llvm-branch] r107940 - in /llvm/branches/Apple/Morbo: lib/CodeGen/AsmPrinter/AsmPrinter.cpp lib/CodeGen/MachineInstr.cpp lib/CodeGen/PrologEpilogInserter.cpp lib/CodeGen/SelectionDAG/InstrEmitter.cpp lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp test/CodeGen/Thumb/push.ll test/CodeGen/X86/2009-04-20-LinearScanOpt.ll test/CodeGen/X86/inline-asm-tied.ll test/CodeGen/X86/iv-users-in-other-loops.ll test/FrontendC/2010-06-17-asmcrash.c
Dale Johannesen
dalej at apple.com
Thu Jul 8 17:19:05 PDT 2010
Author: johannes
Date: Thu Jul 8 19:19:05 2010
New Revision: 107940
URL: http://llvm.org/viewvc/llvm-project?rev=107940&view=rev
Log:
Merge 107506 and 107924, after adjusting for FOUR
mainline patches that aren't here. This is getting
ridiculous.
Modified:
llvm/branches/Apple/Morbo/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
llvm/branches/Apple/Morbo/lib/CodeGen/MachineInstr.cpp
llvm/branches/Apple/Morbo/lib/CodeGen/PrologEpilogInserter.cpp
llvm/branches/Apple/Morbo/lib/CodeGen/SelectionDAG/InstrEmitter.cpp
llvm/branches/Apple/Morbo/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
llvm/branches/Apple/Morbo/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
llvm/branches/Apple/Morbo/test/CodeGen/Thumb/push.ll
llvm/branches/Apple/Morbo/test/CodeGen/X86/2009-04-20-LinearScanOpt.ll
llvm/branches/Apple/Morbo/test/CodeGen/X86/inline-asm-tied.ll
llvm/branches/Apple/Morbo/test/CodeGen/X86/iv-users-in-other-loops.ll
llvm/branches/Apple/Morbo/test/FrontendC/2010-06-17-asmcrash.c
Modified: llvm/branches/Apple/Morbo/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Morbo/lib/CodeGen/AsmPrinter/AsmPrinter.cpp?rev=107940&r1=107939&r2=107940&view=diff
==============================================================================
--- llvm/branches/Apple/Morbo/lib/CodeGen/AsmPrinter/AsmPrinter.cpp (original)
+++ llvm/branches/Apple/Morbo/lib/CodeGen/AsmPrinter/AsmPrinter.cpp Thu Jul 8 19:19:05 2010
@@ -1575,7 +1575,7 @@
// Okay, we finally have a value number. Ask the target to print this
// operand!
if (CurVariant == -1 || CurVariant == AsmPrinterVariant) {
- unsigned OpNo = 1;
+ unsigned OpNo = 2;
bool Error = false;
Modified: llvm/branches/Apple/Morbo/lib/CodeGen/MachineInstr.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Morbo/lib/CodeGen/MachineInstr.cpp?rev=107940&r1=107939&r2=107940&view=diff
==============================================================================
--- llvm/branches/Apple/Morbo/lib/CodeGen/MachineInstr.cpp (original)
+++ llvm/branches/Apple/Morbo/lib/CodeGen/MachineInstr.cpp Thu Jul 8 19:19:05 2010
@@ -845,14 +845,14 @@
bool MachineInstr::
isRegTiedToUseOperand(unsigned DefOpIdx, unsigned *UseOpIdx) const {
if (isInlineAsm()) {
- assert(DefOpIdx >= 2);
+ assert(DefOpIdx >= 3);
const MachineOperand &MO = getOperand(DefOpIdx);
if (!MO.isReg() || !MO.isDef() || MO.getReg() == 0)
return false;
// Determine the actual operand index that corresponds to this index.
unsigned DefNo = 0;
unsigned DefPart = 0;
- for (unsigned i = 1, e = getNumOperands(); i < e; ) {
+ for (unsigned i = 2, e = getNumOperands(); i < e; ) {
const MachineOperand &FMO = getOperand(i);
// After the normal asm operands there may be additional imp-def regs.
if (!FMO.isImm())
@@ -867,7 +867,7 @@
}
++DefNo;
}
- for (unsigned i = 1, e = getNumOperands(); i != e; ++i) {
+ for (unsigned i = 2, e = getNumOperands(); i != e; ++i) {
const MachineOperand &FMO = getOperand(i);
if (!FMO.isImm())
continue;
@@ -910,7 +910,7 @@
// Find the flag operand corresponding to UseOpIdx
unsigned FlagIdx, NumOps=0;
- for (FlagIdx = 1; FlagIdx < UseOpIdx; FlagIdx += NumOps+1) {
+ for (FlagIdx = 2; FlagIdx < UseOpIdx; FlagIdx += NumOps+1) {
const MachineOperand &UFMO = getOperand(FlagIdx);
// After the normal asm operands there may be additional imp-def regs.
if (!UFMO.isImm())
@@ -928,9 +928,9 @@
if (!DefOpIdx)
return true;
- unsigned DefIdx = 1;
- // Remember to adjust the index. First operand is asm string, then there
- // is a flag for each.
+ unsigned DefIdx = 2;
+ // Remember to adjust the index. First operand is asm string, second is
+ // the AlignStack bit, then there is a flag for each.
while (DefNo) {
const MachineOperand &FMO = getOperand(DefIdx);
assert(FMO.isImm());
Modified: llvm/branches/Apple/Morbo/lib/CodeGen/PrologEpilogInserter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Morbo/lib/CodeGen/PrologEpilogInserter.cpp?rev=107940&r1=107939&r2=107940&view=diff
==============================================================================
--- llvm/branches/Apple/Morbo/lib/CodeGen/PrologEpilogInserter.cpp (original)
+++ llvm/branches/Apple/Morbo/lib/CodeGen/PrologEpilogInserter.cpp Thu Jul 8 19:19:05 2010
@@ -163,9 +163,9 @@
AdjustsStack = true;
FrameSDOps.push_back(I);
} else if (I->isInlineAsm()) {
- // An InlineAsm might be a call; assume it is to get the stack frame
- // aligned correctly for calls.
- AdjustsStack = true;
+ // Some inline asm's need a stack frame, as indicated by operand 1.
+ if (I->getOperand(1).getImm())
+ AdjustsStack = true;
}
FFI->setAdjustsStack(AdjustsStack);
Modified: llvm/branches/Apple/Morbo/lib/CodeGen/SelectionDAG/InstrEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Morbo/lib/CodeGen/SelectionDAG/InstrEmitter.cpp?rev=107940&r1=107939&r2=107940&view=diff
==============================================================================
--- llvm/branches/Apple/Morbo/lib/CodeGen/SelectionDAG/InstrEmitter.cpp (original)
+++ llvm/branches/Apple/Morbo/lib/CodeGen/SelectionDAG/InstrEmitter.cpp Thu Jul 8 19:19:05 2010
@@ -719,8 +719,13 @@
cast<ExternalSymbolSDNode>(Node->getOperand(1))->getSymbol();
MI->addOperand(MachineOperand::CreateES(AsmStr));
+ // Add the isAlignStack bit.
+ int64_t isAlignStack =
+ cast<ConstantSDNode>(Node->getOperand(2))->getZExtValue();
+ MI->addOperand(MachineOperand::CreateImm(isAlignStack));
+
// Add all of the operand registers to the instruction.
- for (unsigned i = 2; i != NumOps;) {
+ for (unsigned i = 3; i != NumOps;) {
unsigned Flags =
cast<ConstantSDNode>(Node->getOperand(i))->getZExtValue();
unsigned NumVals = InlineAsm::getNumOperandRegisters(Flags);
Modified: llvm/branches/Apple/Morbo/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Morbo/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp?rev=107940&r1=107939&r2=107940&view=diff
==============================================================================
--- llvm/branches/Apple/Morbo/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp (original)
+++ llvm/branches/Apple/Morbo/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp Thu Jul 8 19:19:05 2010
@@ -5533,6 +5533,10 @@
TLI.getPointerTy()));
+ // Remember the AlignStack bit as operand 3.
+ AsmNodeOperands.push_back(DAG.getTargetConstant(IA->isAlignStack() ? 1 : 0,
+ MVT::i1));
+
// Loop over all of the inputs, copying the operand values into the
// appropriate registers and processing the output regs.
RegsForValue RetValRegs;
@@ -5600,7 +5604,7 @@
// Scan until we find the definition we already emitted of this operand.
// When we find it, create a RegsForValue operand.
- unsigned CurOp = 2; // The first operand.
+ unsigned CurOp = 3; // The first operand.
for (; OperandNo; --OperandNo) {
// Advance to the next operand.
unsigned OpFlag =
Modified: llvm/branches/Apple/Morbo/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Morbo/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp?rev=107940&r1=107939&r2=107940&view=diff
==============================================================================
--- llvm/branches/Apple/Morbo/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp (original)
+++ llvm/branches/Apple/Morbo/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Thu Jul 8 19:19:05 2010
@@ -1438,8 +1438,9 @@
Ops.push_back(InOps[0]); // input chain.
Ops.push_back(InOps[1]); // input asm string.
+ Ops.push_back(InOps[2]); // isAlignStack bit
- unsigned i = 2, e = InOps.size();
+ unsigned i = 3, e = InOps.size();
if (InOps[e-1].getValueType() == MVT::Flag)
--e; // Don't process a flag operand if it is here.
Modified: llvm/branches/Apple/Morbo/test/CodeGen/Thumb/push.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Morbo/test/CodeGen/Thumb/push.ll?rev=107940&r1=107939&r2=107940&view=diff
==============================================================================
--- llvm/branches/Apple/Morbo/test/CodeGen/Thumb/push.ll (original)
+++ llvm/branches/Apple/Morbo/test/CodeGen/Thumb/push.ll Thu Jul 8 19:19:05 2010
@@ -5,6 +5,6 @@
; CHECK: t:
; CHECK-NEXT : push {r7}
entry:
- call void asm sideeffect ".long 0xe7ffdefe", ""() nounwind
+ call void asm sideeffect alignstack ".long 0xe7ffdefe", ""() nounwind
ret void
}
Modified: llvm/branches/Apple/Morbo/test/CodeGen/X86/2009-04-20-LinearScanOpt.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Morbo/test/CodeGen/X86/2009-04-20-LinearScanOpt.ll?rev=107940&r1=107939&r2=107940&view=diff
==============================================================================
--- llvm/branches/Apple/Morbo/test/CodeGen/X86/2009-04-20-LinearScanOpt.ll (original)
+++ llvm/branches/Apple/Morbo/test/CodeGen/X86/2009-04-20-LinearScanOpt.ll Thu Jul 8 19:19:05 2010
@@ -1,4 +1,4 @@
-; RUN: llc < %s -mtriple=x86_64-apple-darwin10.0 -relocation-model=pic -disable-fp-elim -stats |& grep asm-printer | grep 83
+; RUN: llc < %s -mtriple=x86_64-apple-darwin10.0 -relocation-model=pic -disable-fp-elim -stats |& grep asm-printer | grep 82
; rdar://6802189
; Test if linearscan is unfavoring registers for allocation to allow more reuse
Modified: llvm/branches/Apple/Morbo/test/CodeGen/X86/inline-asm-tied.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Morbo/test/CodeGen/X86/inline-asm-tied.ll?rev=107940&r1=107939&r2=107940&view=diff
==============================================================================
--- llvm/branches/Apple/Morbo/test/CodeGen/X86/inline-asm-tied.ll (original)
+++ llvm/branches/Apple/Morbo/test/CodeGen/X86/inline-asm-tied.ll Thu Jul 8 19:19:05 2010
@@ -1,4 +1,4 @@
-; RUN: llc < %s -mtriple=i386-apple-darwin9 -O0 | grep {movl %edx, 12(%esp)} | count 2
+; RUN: llc < %s -mtriple=i386-apple-darwin9 -O0 -regalloc=linearscan | grep {movl %edx, 4(%esp)} | count 2
; rdar://6992609
target triple = "i386-apple-darwin9.0"
Modified: llvm/branches/Apple/Morbo/test/CodeGen/X86/iv-users-in-other-loops.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Morbo/test/CodeGen/X86/iv-users-in-other-loops.ll?rev=107940&r1=107939&r2=107940&view=diff
==============================================================================
--- llvm/branches/Apple/Morbo/test/CodeGen/X86/iv-users-in-other-loops.ll (original)
+++ llvm/branches/Apple/Morbo/test/CodeGen/X86/iv-users-in-other-loops.ll Thu Jul 8 19:19:05 2010
@@ -1,7 +1,7 @@
; RUN: llc < %s -march=x86-64 -o %t
; RUN: not grep inc %t
; RUN: grep dec %t | count 2
-; RUN: grep addq %t | count 13
+; RUN: grep addq %t | count 12
; RUN: not grep addb %t
; RUN: not grep leaq %t
; RUN: not grep leal %t
Modified: llvm/branches/Apple/Morbo/test/FrontendC/2010-06-17-asmcrash.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Morbo/test/FrontendC/2010-06-17-asmcrash.c?rev=107940&r1=107939&r2=107940&view=diff
==============================================================================
--- llvm/branches/Apple/Morbo/test/FrontendC/2010-06-17-asmcrash.c (original)
+++ llvm/branches/Apple/Morbo/test/FrontendC/2010-06-17-asmcrash.c Thu Jul 8 19:19:05 2010
@@ -12,5 +12,5 @@
:"+g"(h), "+S"(pixels), "+D"(block)
:"r" ((x86_reg)line_size)
:"%""rax", "memory");
-// CHECK: # (%rsp) %rsi %rdi %rcx
+// CHECK: # -24(%rsp) %rsi %rdi %rcx
}
More information about the llvm-branch-commits
mailing list