summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorPuyan Lotfi <puyan@puyan.org>2019-05-30 21:37:25 +0000
committerPuyan Lotfi <puyan@puyan.org>2019-05-30 21:37:25 +0000
commitdaaecf98c9ac41d2ad1da5bbf53303c2167501b5 (patch)
tree45261feb11cb150e54ab7c851d898cb0f5e670ac /llvm/lib
parentfc3dfd3e35a637cdbef1bc21c56a31c28e4a5b4c (diff)
downloadbcm5719-llvm-daaecf98c9ac41d2ad1da5bbf53303c2167501b5.tar.gz
bcm5719-llvm-daaecf98c9ac41d2ad1da5bbf53303c2167501b5.zip
[MIR-Canon] Fixing case where MachineFunction is empty.
In cases where the machine function is empty: bail on the RPO traversal. Differential Revision: https://reviews.llvm.org/D62617 llvm-svn: 362158
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/CodeGen/MIRCanonicalizerPass.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/MIRCanonicalizerPass.cpp b/llvm/lib/CodeGen/MIRCanonicalizerPass.cpp
index e8a6e409fb5..650240e60fe 100644
--- a/llvm/lib/CodeGen/MIRCanonicalizerPass.cpp
+++ b/llvm/lib/CodeGen/MIRCanonicalizerPass.cpp
@@ -104,6 +104,8 @@ INITIALIZE_PASS_END(MIRCanonicalizer, "mir-canonicalizer",
"Rename Register Operands Canonically", false, false)
static std::vector<MachineBasicBlock *> GetRPOList(MachineFunction &MF) {
+ if (MF.empty())
+ return {};
ReversePostOrderTraversal<MachineBasicBlock *> RPOT(&*MF.begin());
std::vector<MachineBasicBlock *> RPOList;
for (auto MBB : RPOT) {
OpenPOWER on IntegriCloud