summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2008-12-18 22:11:34 +0000
committerDan Gohman <gohman@apple.com>2008-12-18 22:11:34 +0000
commitc4ce336205573913ea85c7578ea05e63151579ed (patch)
tree6b1d7845377f33552c311227fafdec0c715c3eea /llvm/lib
parentd38c00c85bcc8e6e946d68ba820bad1692954a32 (diff)
downloadbcm5719-llvm-c4ce336205573913ea85c7578ea05e63151579ed.tar.gz
bcm5719-llvm-c4ce336205573913ea85c7578ea05e63151579ed.zip
Make LowerSubregs' debug output for EXTRACT_SUBREG consistent with
that of INSERT_SUBREG and SUBREG_TO_REG. llvm-svn: 61218
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/CodeGen/LowerSubregs.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/LowerSubregs.cpp b/llvm/lib/CodeGen/LowerSubregs.cpp
index 0cb6aab6db5..77e8d65f590 100644
--- a/llvm/lib/CodeGen/LowerSubregs.cpp
+++ b/llvm/lib/CodeGen/LowerSubregs.cpp
@@ -80,7 +80,11 @@ bool LowerSubregsInstructionPass::LowerExtract(MachineInstr *MI) {
DOUT << "subreg: CONVERTING: " << *MI;
- if (SrcReg != DstReg) {
+ if (SrcReg == DstReg) {
+ // No need to insert an identify copy instruction.
+ DOUT << "subreg: eliminated!";
+ } else {
+ // Insert copy
const TargetRegisterClass *TRC = TRI.getPhysicalRegisterRegClass(DstReg);
assert(TRC == TRI.getPhysicalRegisterRegClass(SrcReg) &&
"Extract subreg and Dst must be of same register class");
@@ -177,6 +181,7 @@ bool LowerSubregsInstructionPass::LowerInsert(MachineInstr *MI) {
const TargetRegisterClass *TRC0= TRI.getPhysicalRegisterRegClass(DstSubReg);
const TargetRegisterClass *TRC1= TRI.getPhysicalRegisterRegClass(InsReg);
TII.copyRegToReg(*MBB, MI, DstSubReg, InsReg, TRC0, TRC1);
+
#ifndef NDEBUG
MachineBasicBlock::iterator dMI = MI;
DOUT << "subreg: " << *(--dMI);
OpenPOWER on IntegriCloud