[llvm] f3016c3 - Revert "[NFC][LoopPredication] Add parsed checks logging"
Aleksandr Popov via llvm-commits
llvm-commits at lists.llvm.org
Thu Aug 10 04:29:30 PDT 2023
Author: Aleksandr Popov
Date: 2023-08-10T12:55:55+02:00
New Revision: f3016c380bfcf9ab07c3503e43b8015b3097ef80
URL: https://github.com/llvm/llvm-project/commit/f3016c380bfcf9ab07c3503e43b8015b3097ef80
DIFF: https://github.com/llvm/llvm-project/commit/f3016c380bfcf9ab07c3503e43b8015b3097ef80.diff
LOG: Revert "[NFC][LoopPredication] Add parsed checks logging"
This reverts commit aa603c41caab63e246f4a4258c8b96e6ea06fdc9.
Revert due to LLVM Buildbot failure
Added:
Modified:
llvm/lib/Transforms/Scalar/LoopPredication.cpp
llvm/test/Transforms/LoopPredication/visited.ll
Removed:
################################################################################
diff --git a/llvm/lib/Transforms/Scalar/LoopPredication.cpp b/llvm/lib/Transforms/Scalar/LoopPredication.cpp
index 29d8e37d31955c..79a3da9020e2e2 100644
--- a/llvm/lib/Transforms/Scalar/LoopPredication.cpp
+++ b/llvm/lib/Transforms/Scalar/LoopPredication.cpp
@@ -767,23 +767,14 @@ unsigned LoopPredication::widenChecks(SmallVectorImpl<Value *> &Checks,
return NumWidened;
}
-static SmallVector<Value *> extractChecksFromGuard(Instruction *Guard) {
+bool LoopPredication::widenGuardConditions(IntrinsicInst *Guard,
+ SCEVExpander &Expander) {
LLVM_DEBUG(dbgs() << "Processing guard:\n");
LLVM_DEBUG(Guard->dump());
+ TotalConsidered++;
SmallVector<Value *, 4> Checks;
parseWidenableGuard(Guard, Checks);
- LLVM_DEBUG(dbgs() << "Found checks:\n");
- std::for_each(Checks.begin(), Checks.end(), [](const Value *Check) {
- LLVM_DEBUG(dbgs() << *Check << "\n");
- });
- return Checks;
-}
-
-bool LoopPredication::widenGuardConditions(IntrinsicInst *Guard,
- SCEVExpander &Expander) {
- TotalConsidered++;
- auto Checks = extractChecksFromGuard(Guard);
unsigned NumWidened = widenChecks(Checks, Expander, Guard);
if (NumWidened == 0)
return false;
@@ -808,6 +799,8 @@ bool LoopPredication::widenGuardConditions(IntrinsicInst *Guard,
bool LoopPredication::widenWidenableBranchGuardConditions(
BranchInst *BI, SCEVExpander &Expander) {
assert(isGuardAsWidenableBranch(BI) && "Must be!");
+ LLVM_DEBUG(dbgs() << "Processing guard:\n");
+ LLVM_DEBUG(BI->dump());
Value *Cond, *WC;
BasicBlock *IfTrueBB, *IfFalseBB;
@@ -816,7 +809,8 @@ bool LoopPredication::widenWidenableBranchGuardConditions(
(void)Parsed;
TotalConsidered++;
- auto Checks = extractChecksFromGuard(BI);
+ SmallVector<Value *, 4> Checks;
+ parseWidenableGuard(BI, Checks);
// At the moment, our matching logic for wideable conditions implicitly
// assumes we preserve the form: (br (and Cond, WC())). FIXME
Checks.push_back(WC);
diff --git a/llvm/test/Transforms/LoopPredication/visited.ll b/llvm/test/Transforms/LoopPredication/visited.ll
index efefa0f1156369..cc713313799a7a 100644
--- a/llvm/test/Transforms/LoopPredication/visited.ll
+++ b/llvm/test/Transforms/LoopPredication/visited.ll
@@ -1,15 +1,10 @@
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
-; RUN: opt -S -passes=loop-predication -debug-only=loop-predication < %s 2>&1 | FileCheck %s
-; RUN: opt -S -passes='require<scalar-evolution>,loop-mssa(loop-predication)' -verify-memoryssa -debug-only=loop-predication < %s 2>&1 | FileCheck %s
-; REQUIRES: asserts
+; RUN: opt -S -passes=loop-predication < %s 2>&1 | FileCheck %s
+; RUN: opt -S -passes='require<scalar-evolution>,loop-mssa(loop-predication)' -verify-memoryssa < %s 2>&1 | FileCheck %s
declare void @llvm.experimental.guard(i1, ...)
define i32 @test_visited(ptr %array, i32 %length, i32 %n, i32 %x) {
-; CHECK: Found checks:
-; CHECK-NEXT: %unrelated.cond = icmp eq i32 %x, %i
-; CHECK-NEXT: %within.bounds = icmp ult i32 %i, %length
-;
; CHECK-LABEL: @test_visited(
; CHECK-NEXT: entry:
; CHECK-NEXT: [[TMP5:%.*]] = icmp eq i32 [[N:%.*]], 0
More information about the llvm-commits
mailing list