Modify the -join-globalcopies option (off by default).
authorAndrew Trick <atrick@apple.com>
Fri, 21 Jun 2013 18:33:09 +0000 (18:33 +0000)
committerAndrew Trick <atrick@apple.com>
Fri, 21 Jun 2013 18:33:09 +0000 (18:33 +0000)
Always coalesce in forward order to propagate rematerialization.
I'm fixing this option so I can enable it by default soon.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184568 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/RegisterCoalescer.cpp

index 3cede9f4907758e7b8e54a354d41bd9295fae5e4..6e7d90dd65c0aca5ae1533c65dc49fcc76ea1ecb 100644 (file)
@@ -2117,8 +2117,8 @@ RegisterCoalescer::copyCoalesceInMBB(MachineBasicBlock *MBB) {
     // are not inherently easier to resolve, but slightly preferable until we
     // have local live range splitting. In particular this is required by
     // cmp+jmp macro fusion.
-    for (MachineBasicBlock::reverse_iterator
-           MII = MBB->rbegin(), E = MBB->rend(); MII != E; ++MII) {
+    for (MachineBasicBlock::iterator MII = MBB->begin(), E = MBB->end();
+         MII != E; ++MII) {
       if (!MII->isCopyLike())
         continue;
       if (isLocalCopy(&(*MII), LIS))