summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Collingbourne <peter@pcc.me.uk>2014-12-19 20:50:07 +0000
committerPeter Collingbourne <peter@pcc.me.uk>2014-12-19 20:50:07 +0000
commit0e5c068592aa6eabeb22362738ea8e7788e1e31b (patch)
treef9eedd1277c2f8633bd12c39d1578ac7d7ac1c7e
parent04eeec32e6d39d7c102d31a5e196ff9907d3cc60 (diff)
downloadbcm5719-llvm-0e5c068592aa6eabeb22362738ea8e7788e1e31b.tar.gz
bcm5719-llvm-0e5c068592aa6eabeb22362738ea8e7788e1e31b.zip
CodeGen: do not attempt to invalidate virtual registers for zero-sized phis.
llvm-svn: 224615
-rw-r--r--llvm/include/llvm/CodeGen/FunctionLoweringInfo.h3
-rw-r--r--llvm/test/CodeGen/Generic/empty-phi.ll19
2 files changed, 22 insertions, 0 deletions
diff --git a/llvm/include/llvm/CodeGen/FunctionLoweringInfo.h b/llvm/include/llvm/CodeGen/FunctionLoweringInfo.h
index 1ce099eef99..06cd12f4912 100644
--- a/llvm/include/llvm/CodeGen/FunctionLoweringInfo.h
+++ b/llvm/include/llvm/CodeGen/FunctionLoweringInfo.h
@@ -206,6 +206,9 @@ public:
return;
unsigned Reg = It->second;
+ if (Reg == 0)
+ return;
+
LiveOutRegInfo.grow(Reg);
LiveOutRegInfo[Reg].IsValid = false;
}
diff --git a/llvm/test/CodeGen/Generic/empty-phi.ll b/llvm/test/CodeGen/Generic/empty-phi.ll
new file mode 100644
index 00000000000..8d5f3b96941
--- /dev/null
+++ b/llvm/test/CodeGen/Generic/empty-phi.ll
@@ -0,0 +1,19 @@
+; RUN: llc < %s
+
+define void @f() {
+entry:
+ br label %bb1
+
+bb1:
+ %0 = phi [0 x { i8*, i64, i64 }] [ %load, %bb2 ], [ undef, %entry ]
+ store [0 x { i8*, i64, i64 }] %0, [0 x { i8*, i64, i64 }]* undef, align 8
+ %1 = icmp eq i64 undef, 0
+ br i1 %1, label %bb2, label %bb3
+
+bb2:
+ %load = load [0 x { i8*, i64, i64 }]* undef, align 8
+ br label %bb1
+
+bb3:
+ ret void
+}
OpenPOWER on IntegriCloud