diff options
author | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2010-07-11 05:17:02 +0000 |
---|---|---|
committer | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2010-07-11 05:17:02 +0000 |
commit | 1ba318982e4dcca66b6cf7ce624af2ba8a55d9d8 (patch) | |
tree | 74859afe3802cc0258f511262e10942969671b45 /lib/Target/X86/X86FastISel.cpp | |
parent | e7917bb207d5178dfb26066f839e4c295fd3a1eb (diff) | |
download | external_llvm-1ba318982e4dcca66b6cf7ce624af2ba8a55d9d8.zip external_llvm-1ba318982e4dcca66b6cf7ce624af2ba8a55d9d8.tar.gz external_llvm-1ba318982e4dcca66b6cf7ce624af2ba8a55d9d8.tar.bz2 |
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).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108074 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/X86/X86FastISel.cpp')
-rw-r--r-- | lib/Target/X86/X86FastISel.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/lib/Target/X86/X86FastISel.cpp b/lib/Target/X86/X86FastISel.cpp index 9ff87a8..ce2517a 100644 --- a/lib/Target/X86/X86FastISel.cpp +++ b/lib/Target/X86/X86FastISel.cpp @@ -757,13 +757,11 @@ bool X86FastISel::X86SelectRet(const Instruction *I) { 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()); |