diff options
| author | Nate Begeman <natebegeman@mac.com> | 2010-07-22 00:09:39 +0000 |
|---|---|---|
| committer | Nate Begeman <natebegeman@mac.com> | 2010-07-22 00:09:39 +0000 |
| commit | 68a069a1886bdecfe8bf146da2bad7a43372cb81 (patch) | |
| tree | 702c24b3328e907160270f491e20451cf0bb5a26 | |
| parent | 285903853f00c2ed65c6e313ee02a0cd2d3c7bd5 (diff) | |
| download | bcm5719-llvm-68a069a1886bdecfe8bf146da2bad7a43372cb81.tar.gz bcm5719-llvm-68a069a1886bdecfe8bf146da2bad7a43372cb81.zip | |
Make fast isel win64-aware w.r.t. call-clobbered regs
llvm-svn: 109069
| -rw-r--r-- | llvm/lib/Target/X86/X86FastISel.cpp | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/llvm/lib/Target/X86/X86FastISel.cpp b/llvm/lib/Target/X86/X86FastISel.cpp index 89f72151bce..b7341f93eed 100644 --- a/llvm/lib/Target/X86/X86FastISel.cpp +++ b/llvm/lib/Target/X86/X86FastISel.cpp @@ -1646,15 +1646,26 @@ bool X86FastISel::X86SelectCall(const Instruction *I) { MachineInstrBuilder MIB; if (CalleeOp) { // Register-indirect call. - unsigned CallOpc = Subtarget->is64Bit() ? X86::CALL64r : X86::CALL32r; + unsigned CallOpc; + if (Subtarget->isTargetWin64()) + CallOpc = X86::WINCALL64r; + else if (Subtarget->is64Bit()) + CallOpc = X86::CALL64r; + else + CallOpc = X86::CALL32r; MIB = BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, TII.get(CallOpc)) .addReg(CalleeOp); } else { // Direct call. assert(GV && "Not a direct call"); - unsigned CallOpc = - Subtarget->is64Bit() ? X86::CALL64pcrel32 : X86::CALLpcrel32; + unsigned CallOpc; + if (Subtarget->isTargetWin64()) + CallOpc = X86::WINCALL64pcrel32; + else if (Subtarget->is64Bit()) + CallOpc = X86::CALL64pcrel32; + else + CallOpc = X86::CALLpcrel32; // See if we need any target-specific flags on the GV operand. unsigned char OpFlags = 0; |

