aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorOwen Anderson <resistor@mac.com>2010-09-16 20:51:41 +0000
committerOwen Anderson <resistor@mac.com>2010-09-16 20:51:41 +0000
commit4e282decf3960bfa6b1fe3fd77bb51ff96121515 (patch)
treebdffe2a3ec4edaf9b9a90bf77c142d645c66e1b4 /include
parent35aa94b229d516b9eb775ad4e13a8e2d03221cf9 (diff)
downloadexternal_llvm-4e282decf3960bfa6b1fe3fd77bb51ff96121515.zip
external_llvm-4e282decf3960bfa6b1fe3fd77bb51ff96121515.tar.gz
external_llvm-4e282decf3960bfa6b1fe3fd77bb51ff96121515.tar.bz2
Revert r114097, adding back in the assertion against replacing an Instruction by itself. Now that CorrelatedValuePropagation is
more careful not to call SimplifyInstructionsInBlock() on an unreachable block, the issue has been fixed at a higher level. Add a big warning to SimplifyInstructionsInBlock() to hopefully prevent this in the future. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114117 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/Analysis/InstructionSimplify.h2
-rw-r--r--include/llvm/Transforms/Utils/Local.h4
2 files changed, 6 insertions, 0 deletions
diff --git a/include/llvm/Analysis/InstructionSimplify.h b/include/llvm/Analysis/InstructionSimplify.h
index f47e740..913fd77 100644
--- a/include/llvm/Analysis/InstructionSimplify.h
+++ b/include/llvm/Analysis/InstructionSimplify.h
@@ -71,6 +71,8 @@ namespace llvm {
/// SimplifyInstruction - See if we can compute a simplified version of this
/// instruction. If not, this returns null.
+ /// WARNING: If called on unreachable code, an instruction may be reported
+ /// to simplify to itself.
Value *SimplifyInstruction(Instruction *I, const TargetData *TD = 0);
diff --git a/include/llvm/Transforms/Utils/Local.h b/include/llvm/Transforms/Utils/Local.h
index caae27f..dc18f3c 100644
--- a/include/llvm/Transforms/Utils/Local.h
+++ b/include/llvm/Transforms/Utils/Local.h
@@ -69,6 +69,10 @@ bool RecursivelyDeleteDeadPHINode(PHINode *PN);
///
/// This returns true if it changed the code, note that it can delete
/// instructions in other blocks as well in this block.
+///
+/// WARNING: Do not use this function on unreachable blocks, as recursive
+/// simplification is not able to handle corner-case scenarios that can
+/// arise in them.
bool SimplifyInstructionsInBlock(BasicBlock *BB, const TargetData *TD = 0);
//===----------------------------------------------------------------------===//