[PATCH] D57567: [SCEV] Do not bother creating separate SCEVUnknown for unreachable nodes
Max Kazantsev via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sun Feb 3 20:59:18 PST 2019
mkazantsev updated this revision to Diff 184989.
mkazantsev edited the summary of this revision.
mkazantsev added a comment.
Remade to undef.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D57567/new/
https://reviews.llvm.org/D57567
Files:
lib/Analysis/ScalarEvolution.cpp
test/Analysis/ScalarEvolution/unreachable-code.ll
Index: test/Analysis/ScalarEvolution/unreachable-code.ll
===================================================================
--- test/Analysis/ScalarEvolution/unreachable-code.ll
+++ test/Analysis/ScalarEvolution/unreachable-code.ll
@@ -1,7 +1,7 @@
; RUN: opt < %s -analyze -scalar-evolution | FileCheck %s
; CHECK: %t = add i64 %t, 1
-; CHECK: --> %t
+; CHECK: --> undef
define void @foo() {
entry:
Index: lib/Analysis/ScalarEvolution.cpp
===================================================================
--- lib/Analysis/ScalarEvolution.cpp
+++ lib/Analysis/ScalarEvolution.cpp
@@ -6144,7 +6144,7 @@
// to obey basic rules for definitions dominating uses which this
// analysis depends on.
if (!DT.isReachableFromEntry(I->getParent()))
- return getUnknown(V);
+ return getUnknown(UndefValue::get(V->getType()));
} else if (ConstantInt *CI = dyn_cast<ConstantInt>(V))
return getConstant(CI);
else if (isa<ConstantPointerNull>(V))
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D57567.184989.patch
Type: text/x-patch
Size: 979 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190204/b356cf9d/attachment.bin>
More information about the llvm-commits
mailing list