[llvm] r274656 - Work around PR28400 a bit harder.
Sean Silva via llvm-commits
llvm-commits at lists.llvm.org
Wed Jul 6 12:05:42 PDT 2016
Author: silvas
Date: Wed Jul 6 14:05:41 2016
New Revision: 274656
URL: http://llvm.org/viewvc/llvm-project?rev=274656&view=rev
Log:
Work around PR28400 a bit harder.
We were still crashing in the "no change" case because LVI was not
getting invalidated.
See the thread "Should analyses be able to hold AssertingVH to IR?
(related to PR28400)" for more discussion.
Added:
llvm/trunk/test/Transforms/JumpThreading/crash-assertingvh.ll
Modified:
llvm/trunk/lib/Transforms/Scalar/JumpThreading.cpp
Modified: llvm/trunk/lib/Transforms/Scalar/JumpThreading.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/JumpThreading.cpp?rev=274656&r1=274655&r2=274656&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/JumpThreading.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/JumpThreading.cpp Wed Jul 6 14:05:41 2016
@@ -148,11 +148,14 @@ PreservedAnalyses JumpThreadingPass::run
}
bool Changed =
runImpl(F, &TLI, &LVI, HasProfileData, std::move(BFI), std::move(BPI));
+
+ // FIXME: We need to invalidate LVI to avoid PR28400. Is there a better
+ // solution?
+ AM.invalidate<LazyValueAnalysis>(F);
+
if (!Changed)
return PreservedAnalyses::all();
PreservedAnalyses PA;
- // FIXME: Not preserving LVI! We need it to be invalidated so that we
- // don't run into issues like PR28400. Is there a better solution?
PA.preserve<GlobalsAA>();
return PA;
}
Added: llvm/trunk/test/Transforms/JumpThreading/crash-assertingvh.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/JumpThreading/crash-assertingvh.ll?rev=274656&view=auto
==============================================================================
--- llvm/trunk/test/Transforms/JumpThreading/crash-assertingvh.ll (added)
+++ llvm/trunk/test/Transforms/JumpThreading/crash-assertingvh.ll Wed Jul 6 14:05:41 2016
@@ -0,0 +1,19 @@
+; RUN: opt -disable-output < %s -passes='module(function(jump-threading),globaldce)'
+
+target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+target triple = "x86_64-unknown-linux-gnu"
+
+declare i32 @bar()
+
+define internal i32 @foo() {
+entry:
+ %call4 = call i32 @bar()
+ %cmp5 = icmp eq i32 %call4, 0
+ br i1 %cmp5, label %if.then6, label %if.end8
+
+if.then6:
+ ret i32 0
+
+if.end8:
+ ret i32 1
+}
More information about the llvm-commits
mailing list