diff options
author | Chris Lattner <sabre@nondot.org> | 2003-05-07 19:21:28 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2003-05-07 19:21:28 +0000 |
commit | c248903b2a11aadd7098b604024456b0f77f51b0 (patch) | |
tree | f080ad0bbb6e9debf8f6d9ea04a233914d3660c6 /lib/Target/X86 | |
parent | dff780f0466d824e775dd748d9880f0389be7260 (diff) | |
download | external_llvm-c248903b2a11aadd7098b604024456b0f77f51b0.zip external_llvm-c248903b2a11aadd7098b604024456b0f77f51b0.tar.gz external_llvm-c248903b2a11aadd7098b604024456b0f77f51b0.tar.bz2 |
IMPLICIT_DEF was not the beautiful elegant solution I thought it was going
to be. In fact, it made stuff worse. :(
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6013 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/X86')
-rw-r--r-- | lib/Target/X86/InstSelectSimple.cpp | 9 | ||||
-rw-r--r-- | lib/Target/X86/MachineCodeEmitter.cpp | 2 | ||||
-rw-r--r-- | lib/Target/X86/X86CodeEmitter.cpp | 2 | ||||
-rw-r--r-- | lib/Target/X86/X86ISelSimple.cpp | 9 | ||||
-rw-r--r-- | lib/Target/X86/X86InstrInfo.def | 6 |
5 files changed, 8 insertions, 20 deletions
diff --git a/lib/Target/X86/InstSelectSimple.cpp b/lib/Target/X86/InstSelectSimple.cpp index 3a12d5e..0df00e2 100644 --- a/lib/Target/X86/InstSelectSimple.cpp +++ b/lib/Target/X86/InstSelectSimple.cpp @@ -79,9 +79,6 @@ namespace { BB = &F->front(); - // Declare that the stack pointer is live on entrance to the function - BuildMI(BB, X86::IMPLICIT_DEF, 0, X86::ESP); - // Copy incoming arguments off of the stack... LoadArgumentsToVirtualRegs(Fn); @@ -677,18 +674,18 @@ void ISel::visitReturnInst(ReturnInst &I) { case cInt: promote32(X86::EAX, ValueRecord(RetReg, RetVal->getType())); // Declare that EAX is live on exit - BuildMI(BB, X86::IMPLICIT_USE, 1).addReg(X86::EAX); + BuildMI(BB, X86::IMPLICIT_USE, 2).addReg(X86::EAX).addReg(X86::ESP); break; case cFP: // Floats & Doubles: Return in ST(0) BuildMI(BB, X86::FpSETRESULT, 1).addReg(RetReg); // Declare that top-of-stack is live on exit - BuildMI(BB, X86::IMPLICIT_USE, 1).addReg(X86::ST0); + BuildMI(BB, X86::IMPLICIT_USE, 2).addReg(X86::ST0).addReg(X86::ESP); break; case cLong: BuildMI(BB, X86::MOVrr32, 1, X86::EAX).addReg(RetReg); BuildMI(BB, X86::MOVrr32, 1, X86::EDX).addReg(RetReg+1); // Declare that EAX & EDX are live on exit - BuildMI(BB, X86::IMPLICIT_USE, 2).addReg(X86::EAX).addReg(X86::EDX); + BuildMI(BB, X86::IMPLICIT_USE, 3).addReg(X86::EAX).addReg(X86::EDX).addReg(X86::ESP); break; default: visitInstruction(I); diff --git a/lib/Target/X86/MachineCodeEmitter.cpp b/lib/Target/X86/MachineCodeEmitter.cpp index 308ad40..a88a3c9 100644 --- a/lib/Target/X86/MachineCodeEmitter.cpp +++ b/lib/Target/X86/MachineCodeEmitter.cpp @@ -259,7 +259,7 @@ void Emitter::emitInstruction(MachineInstr &MI) { switch (Desc.TSFlags & X86II::FormMask) { default: assert(0 && "Unknown FormMask value in X86 MachineCodeEmitter!"); case X86II::Pseudo: - if (Opcode != X86::IMPLICIT_DEF && Opcode != X86::IMPLICIT_USE) + if (Opcode != X86::IMPLICIT_USE) std::cerr << "X86 Machine Code Emitter: No 'form', not emitting: " << MI; break; diff --git a/lib/Target/X86/X86CodeEmitter.cpp b/lib/Target/X86/X86CodeEmitter.cpp index 308ad40..a88a3c9 100644 --- a/lib/Target/X86/X86CodeEmitter.cpp +++ b/lib/Target/X86/X86CodeEmitter.cpp @@ -259,7 +259,7 @@ void Emitter::emitInstruction(MachineInstr &MI) { switch (Desc.TSFlags & X86II::FormMask) { default: assert(0 && "Unknown FormMask value in X86 MachineCodeEmitter!"); case X86II::Pseudo: - if (Opcode != X86::IMPLICIT_DEF && Opcode != X86::IMPLICIT_USE) + if (Opcode != X86::IMPLICIT_USE) std::cerr << "X86 Machine Code Emitter: No 'form', not emitting: " << MI; break; diff --git a/lib/Target/X86/X86ISelSimple.cpp b/lib/Target/X86/X86ISelSimple.cpp index 3a12d5e..0df00e2 100644 --- a/lib/Target/X86/X86ISelSimple.cpp +++ b/lib/Target/X86/X86ISelSimple.cpp @@ -79,9 +79,6 @@ namespace { BB = &F->front(); - // Declare that the stack pointer is live on entrance to the function - BuildMI(BB, X86::IMPLICIT_DEF, 0, X86::ESP); - // Copy incoming arguments off of the stack... LoadArgumentsToVirtualRegs(Fn); @@ -677,18 +674,18 @@ void ISel::visitReturnInst(ReturnInst &I) { case cInt: promote32(X86::EAX, ValueRecord(RetReg, RetVal->getType())); // Declare that EAX is live on exit - BuildMI(BB, X86::IMPLICIT_USE, 1).addReg(X86::EAX); + BuildMI(BB, X86::IMPLICIT_USE, 2).addReg(X86::EAX).addReg(X86::ESP); break; case cFP: // Floats & Doubles: Return in ST(0) BuildMI(BB, X86::FpSETRESULT, 1).addReg(RetReg); // Declare that top-of-stack is live on exit - BuildMI(BB, X86::IMPLICIT_USE, 1).addReg(X86::ST0); + BuildMI(BB, X86::IMPLICIT_USE, 2).addReg(X86::ST0).addReg(X86::ESP); break; case cLong: BuildMI(BB, X86::MOVrr32, 1, X86::EAX).addReg(RetReg); BuildMI(BB, X86::MOVrr32, 1, X86::EDX).addReg(RetReg+1); // Declare that EAX & EDX are live on exit - BuildMI(BB, X86::IMPLICIT_USE, 2).addReg(X86::EAX).addReg(X86::EDX); + BuildMI(BB, X86::IMPLICIT_USE, 3).addReg(X86::EAX).addReg(X86::EDX).addReg(X86::ESP); break; default: visitInstruction(I); diff --git a/lib/Target/X86/X86InstrInfo.def b/lib/Target/X86/X86InstrInfo.def index 5121f5d..950ea53 100644 --- a/lib/Target/X86/X86InstrInfo.def +++ b/lib/Target/X86/X86InstrInfo.def @@ -79,12 +79,6 @@ I(ADJCALLSTACKDOWN, "adjcallstackdown", 0, 0, X86II::Pseudo, NoIR, // instruction after the call. I(ADJCALLSTACKUP , "adjcallstackup" , 0, 0, X86II::Pseudo, NoIR, NoIR) -// This pseudo-instruction is used to record implicit definitions of physical -// registers: registers that are live on input to the function (currently just -// the stack pointer, eventually could include arguments passed in registers). -// -I(IMPLICIT_DEF, "implicit_def", 0, 0, X86II::Pseudo, NoIR, NoIR) - // This pseudo-instruction is used to record implicit uses of physical registers // at the end of the function. This ensures that bad things aren't done to // registes that are live on exit from the function (for example, EAX). |