[llvm-commits] [llvm] r75955 - /llvm/trunk/lib/CodeGen/LowerSubregs.cpp
Anton Korobeynikov
asl at math.spbu.ru
Thu Jul 16 06:55:26 PDT 2009
Author: asl
Date: Thu Jul 16 08:55:26 2009
New Revision: 75955
URL: http://llvm.org/viewvc/llvm-project?rev=75955&view=rev
Log:
Let RegisterInfo decide whether it can emit cross-class copy or not
Modified:
llvm/trunk/lib/CodeGen/LowerSubregs.cpp
Modified: llvm/trunk/lib/CodeGen/LowerSubregs.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/LowerSubregs.cpp?rev=75955&r1=75954&r2=75955&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/LowerSubregs.cpp (original)
+++ llvm/trunk/lib/CodeGen/LowerSubregs.cpp Thu Jul 16 08:55:26 2009
@@ -132,10 +132,11 @@
}
} else {
// Insert copy
- const TargetRegisterClass *TRC = TRI.getPhysicalRegisterRegClass(DstReg);
- assert(TRC == TRI.getPhysicalRegisterRegClass(SrcReg) &&
- "Extract subreg and Dst must be of same register class");
- TII.copyRegToReg(*MBB, MI, DstReg, SrcReg, TRC, TRC);
+ const TargetRegisterClass *TRCS = TRI.getPhysicalRegisterRegClass(DstReg);
+ const TargetRegisterClass *TRCD = TRI.getPhysicalRegisterRegClass(SrcReg);
+ bool Emitted = TII.copyRegToReg(*MBB, MI, DstReg, SrcReg, TRCD, TRCS);
+ (void)Emitted;
+ assert(Emitted && "Subreg and Dst must be of compatible register class");
// Transfer the kill/dead flags, if needed.
if (MI->getOperand(0).isDead())
TransferDeadFlag(MI, DstReg, TRI);
More information about the llvm-commits
mailing list