summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2010-04-29 23:47:46 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2010-04-29 23:47:46 +0000
commit8d4214578d3d68b55337369dd7de7128af6b8c22 (patch)
tree2ab2493b73e9ee46a95e177f1bad16ab667f32f3 /llvm/lib
parentb2403ee27392ec854ee4f88f45d4aaa20deb91f2 (diff)
downloadbcm5719-llvm-8d4214578d3d68b55337369dd7de7128af6b8c22.tar.gz
bcm5719-llvm-8d4214578d3d68b55337369dd7de7128af6b8c22.zip
Reject really weird coalescer case when trying to merge identical subregisters
of different register classes. e.g. %reg1048:3<def> = EXTRACT_SUBREG %RAX<kill>, 3 Where %reg1048 is a GR32 register. This is not impossible to handle, but it is pretty hard and very rare. This should unbreak the dragonegg builder. llvm-svn: 102672
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/CodeGen/SimpleRegisterCoalescing.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/SimpleRegisterCoalescing.cpp b/llvm/lib/CodeGen/SimpleRegisterCoalescing.cpp
index e7c758db092..da96f232b80 100644
--- a/llvm/lib/CodeGen/SimpleRegisterCoalescing.cpp
+++ b/llvm/lib/CodeGen/SimpleRegisterCoalescing.cpp
@@ -1394,6 +1394,13 @@ bool SimpleRegisterCoalescing::JoinCopy(CopyRec &TheCopy, bool &Again) {
return false; // Not coalescable.
}
+ // We cannot handle dual subreg indices and mismatched classes at the same
+ // time.
+ if (SrcSubIdx && DstSubIdx && differingRegisterClasses(SrcReg, DstReg)) {
+ DEBUG(dbgs() << "\tCannot handle subreg indices and mismatched classes.\n");
+ return false;
+ }
+
// Check that a physical source register is compatible with dst regclass
if (SrcIsPhys) {
unsigned SrcSubReg = SrcSubIdx ?
OpenPOWER on IntegriCloud