[llvm-commits] [llvm] r108074 - /llvm/trunk/lib/Target/X86/X86FastISel.cpp
Jakob Stoklund Olesen
stoklund at 2pi.dk
Sat Jul 10 22:17:02 PDT 2010
Author: stoklund
Date: Sun Jul 11 00:17:02 2010
New Revision: 108074
URL: http://llvm.org/viewvc/llvm-project?rev=108074&view=rev
Log:
Use COPY in X86FastISel::X86SelectRet.
Don't try a cross-class copy. That is very unlikely anywy since return value
registers are usually register class friendly. (%EAX, %XMM0, etc).
Modified:
llvm/trunk/lib/Target/X86/X86FastISel.cpp
Modified: llvm/trunk/lib/Target/X86/X86FastISel.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86FastISel.cpp?rev=108074&r1=108073&r2=108074&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86FastISel.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86FastISel.cpp Sun Jul 11 00:17:02 2010
@@ -757,13 +757,11 @@
unsigned SrcReg = Reg + VA.getValNo();
unsigned DstReg = VA.getLocReg();
const TargetRegisterClass* SrcRC = MRI.getRegClass(SrcReg);
- const TargetRegisterClass* DstRC = TRI.getMinimalPhysRegClass(DstReg);
- bool Emitted = TII.copyRegToReg(*FuncInfo.MBB, FuncInfo.InsertPt,
- DstReg, SrcReg, DstRC, SrcRC, DL);
-
- // If the target couldn't make the copy for some reason, bail.
- if (!Emitted)
+ // Avoid a cross-class copy. This is very unlikely.
+ if (!SrcRC->contains(DstReg))
return false;
+ BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, TII.get(TargetOpcode::COPY),
+ DstReg).addReg(SrcReg);
// Mark the register as live out of the function.
MRI.addLiveOut(VA.getLocReg());
More information about the llvm-commits
mailing list