diff options
author | Aditya Nandakumar <aditya_nandakumar@apple.com> | 2018-10-19 20:11:52 +0000 |
---|---|---|
committer | Aditya Nandakumar <aditya_nandakumar@apple.com> | 2018-10-19 20:11:52 +0000 |
commit | cd04e366d76c2ea0e30b71c08f4f1a374328e10a (patch) | |
tree | d845095bb04900f5356ba538f43fdafc7041d1bc /llvm/lib/CodeGen | |
parent | 80ed0fd6e0560b69c7996328cd786de9cfbfbf6e (diff) | |
download | bcm5719-llvm-cd04e366d76c2ea0e30b71c08f4f1a374328e10a.tar.gz bcm5719-llvm-cd04e366d76c2ea0e30b71c08f4f1a374328e10a.zip |
[GISel]: Allow PHIs to be DCEd
https://reviews.llvm.org/D53304
Currently dead phis are not cleaned up during DCE. This patch allows
dead PHI and G_PHI insts to be deleted.
Reviewed by: dsanders
llvm-svn: 344811
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r-- | llvm/lib/CodeGen/GlobalISel/Utils.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/GlobalISel/Utils.cpp b/llvm/lib/CodeGen/GlobalISel/Utils.cpp index 1a5f88743d5..4d3a3753559 100644 --- a/llvm/lib/CodeGen/GlobalISel/Utils.cpp +++ b/llvm/lib/CodeGen/GlobalISel/Utils.cpp @@ -137,7 +137,7 @@ bool llvm::isTriviallyDead(const MachineInstr &MI, // If we can move an instruction, we can remove it. Otherwise, it has // a side-effect of some sort. bool SawStore = false; - if (!MI.isSafeToMove(/*AA=*/nullptr, SawStore)) + if (!MI.isSafeToMove(/*AA=*/nullptr, SawStore) && !MI.isPHI()) return false; // Instructions without side-effects are dead iff they only define dead vregs. |