summaryrefslogtreecommitdiffstats
path: root/llvm/include
diff options
context:
space:
mode:
authorDaniel Berlin <dberlin@dberlin.org>2017-03-10 00:32:33 +0000
committerDaniel Berlin <dberlin@dberlin.org>2017-03-10 00:32:33 +0000
commite3e69e16805402796b8fec913ba90d4d054aeac0 (patch)
tree026f257cbc6b3e13d7813cfc6729d989ddf28160 /llvm/include
parentc0e008d807f1caa8e00d1da3192a31262137f53b (diff)
downloadbcm5719-llvm-e3e69e16805402796b8fec913ba90d4d054aeac0.tar.gz
bcm5719-llvm-e3e69e16805402796b8fec913ba90d4d054aeac0.zip
NewGVN: Rewrite DCE during elimination so we do it as well as old GVN did.
llvm-svn: 297428
Diffstat (limited to 'llvm/include')
-rw-r--r--llvm/include/llvm/Transforms/Utils/Local.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/include/llvm/Transforms/Utils/Local.h b/llvm/include/llvm/Transforms/Utils/Local.h
index 490a765c3fa..a747d2e8121 100644
--- a/llvm/include/llvm/Transforms/Utils/Local.h
+++ b/llvm/include/llvm/Transforms/Utils/Local.h
@@ -74,6 +74,12 @@ bool ConstantFoldTerminator(BasicBlock *BB, bool DeleteDeadConditions = false,
bool isInstructionTriviallyDead(Instruction *I,
const TargetLibraryInfo *TLI = nullptr);
+/// Return true if the result produced by the instruction would have no side
+/// effects if it was not used. This is equivalent to checking whether
+/// isInstructionTriviallyDead would be true if the use count was 0.
+bool wouldInstructionBeTriviallyDead(Instruction *I,
+ const TargetLibraryInfo *TLI = nullptr);
+
/// If the specified value is a trivially dead instruction, delete it.
/// If that makes any of its operands trivially dead, delete them too,
/// recursively. Return true if any instructions were deleted.
OpenPOWER on IntegriCloud