diff options
author | Puyan Lotfi <puyan@puyan.org> | 2019-11-30 19:00:10 -0500 |
---|---|---|
committer | Puyan Lotfi <puyan@puyan.org> | 2019-12-04 18:36:08 -0500 |
commit | fdc6f4b97b0e7378d6a3bd45458e7bed206d9305 (patch) | |
tree | cbcf802250eba308073d5016bd4169833b69a357 /llvm/lib/CodeGen/MIRNamerPass.cpp | |
parent | e001bf6330bb0e935b17c8a619e71bbded67e2eb (diff) | |
download | bcm5719-llvm-fdc6f4b97b0e7378d6a3bd45458e7bed206d9305.tar.gz bcm5719-llvm-fdc6f4b97b0e7378d6a3bd45458e7bed206d9305.zip |
[llvm] Fixing MIRVRegNamerUtils to properly handle 2+ MachineBasicBlocks.
An interplay of code from D70210, along with code from the
Value-Numbering-esque hash-based namer from D70210, as well as some
crusty code from the original MIR-Canon code lead to multiple causes of
failure when canonicalizing or renaming vregs for MIR with multiple
basic blocks. This patch fixes those issues while deleting some no
longer needed code and adding a nice diamond test case to boot.
Differential Revision: https://reviews.llvm.org/D70478
Diffstat (limited to 'llvm/lib/CodeGen/MIRNamerPass.cpp')
-rw-r--r-- | llvm/lib/CodeGen/MIRNamerPass.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/MIRNamerPass.cpp b/llvm/lib/CodeGen/MIRNamerPass.cpp index 62d0f2e52c7..9f61dd9ef24 100644 --- a/llvm/lib/CodeGen/MIRNamerPass.cpp +++ b/llvm/lib/CodeGen/MIRNamerPass.cpp @@ -57,9 +57,10 @@ public: VRegRenamer Renamer(MF.getRegInfo()); + unsigned BBIndex = 0; ReversePostOrderTraversal<MachineBasicBlock *> RPOT(&*MF.begin()); for (auto &MBB : RPOT) - Changed |= Renamer.renameVRegs(MBB); + Changed |= Renamer.renameVRegs(MBB, BBIndex++); return Changed; } |