Skip to content

Commit 69b8cf4

Browse files
authored
[SandboxVec][BottomUpVec] Add cost estimation and tr-accept-or-revert pass (#126325)
The TransactionAcceptOrRevert pass is the final pass in the Sandbox Vectorizer's default pass pipeline. It's job is to check the cost before/after vectorization and accept or revert the IR to its original state. Since we are now starting the transaction in BottomUpVec, tests that run a custom pipeline need to accept the transaction. This is done with the help of the TransactionAlwaysAccept pass (tr-accept).
1 parent 2feced1 commit 69b8cf4

File tree

22 files changed

+249
-18
lines changed

22 files changed

+249
-18
lines changed

llvm/include/llvm/SandboxIR/Tracker.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -440,8 +440,9 @@ class ShuffleVectorSetMask final : public IRChangeBase {
440440
class Tracker {
441441
public:
442442
enum class TrackerState {
443-
Disabled, ///> Tracking is disabled
444-
Record, ///> Tracking changes
443+
Disabled, ///> Tracking is disabled
444+
Record, ///> Tracking changes
445+
Reverting, ///> Reverting changes
445446
};
446447

447448
private:
@@ -473,6 +474,8 @@ class Tracker {
473474

474475
~Tracker();
475476
Context &getContext() const { return Ctx; }
477+
/// \Returns true if there are no changes tracked.
478+
bool empty() const { return Changes.empty(); }
476479
/// Record \p Change and take ownership. This is the main function used to
477480
/// track Sandbox IR changes.
478481
void track(std::unique_ptr<IRChangeBase> &&Change) {
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
//===- TransactionAcceptOrRevert.h ------------------------------*- C++ -*-===//
2+
//
3+
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4+
// See https://llvm.org/LICENSE.txt for license information.
5+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6+
//
7+
//===----------------------------------------------------------------------===//
8+
//
9+
// This is a region pass that checks the region cost before/after vectorization
10+
// and accepts the state of Sandbox IR if the cost is better, or otherwise
11+
// reverts it.
12+
//
13+
14+
#ifndef LLVM_TRANSFORMS_VECTORIZE_SANDBOXVECTORIZER_PASSES_TRANSACTIONACCEPTORREVERT_H
15+
#define LLVM_TRANSFORMS_VECTORIZE_SANDBOXVECTORIZER_PASSES_TRANSACTIONACCEPTORREVERT_H
16+
17+
#include "llvm/SandboxIR/Pass.h"
18+
#include "llvm/SandboxIR/Region.h"
19+
20+
namespace llvm::sandboxir {
21+
22+
class TransactionAcceptOrRevert : public RegionPass {
23+
public:
24+
TransactionAcceptOrRevert() : RegionPass("tr-accept-or-revert") {}
25+
bool runOnRegion(Region &Rgn, const Analyses &A) final;
26+
};
27+
28+
} // namespace llvm::sandboxir
29+
30+
#endif // LLVM_TRANSFORMS_VECTORIZE_SANDBOXVECTORIZER_PASSES_TRANSACTIONACCEPTORREVERT_H
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
//===- TransactionAlwaysAccept.h --------------------------------*- C++ -*-===//
2+
//
3+
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4+
// See https://llvm.org/LICENSE.txt for license information.
5+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6+
//
7+
//===----------------------------------------------------------------------===//
8+
//
9+
// This is a region pass that always accepts the transaction without checking
10+
// its cost. This is mainly used as a final pass in lit tests.
11+
//
12+
13+
#ifndef LLVM_TRANSFORMS_VECTORIZE_SANDBOXVECTORIZER_PASSES_TRANSACTIONALWAYSACCEPT_H
14+
#define LLVM_TRANSFORMS_VECTORIZE_SANDBOXVECTORIZER_PASSES_TRANSACTIONALWAYSACCEPT_H
15+
16+
#include "llvm/SandboxIR/Pass.h"
17+
#include "llvm/SandboxIR/Region.h"
18+
19+
namespace llvm::sandboxir {
20+
21+
class TransactionAlwaysAccept : public RegionPass {
22+
public:
23+
TransactionAlwaysAccept() : RegionPass("tr-accept") {}
24+
bool runOnRegion(Region &Rgn, const Analyses &A) final {
25+
auto &Tracker = Rgn.getContext().getTracker();
26+
bool HasChanges = !Tracker.empty();
27+
Tracker.accept();
28+
return HasChanges;
29+
}
30+
};
31+
32+
} // namespace llvm::sandboxir
33+
34+
#endif // LLVM_TRANSFORMS_VECTORIZE_SANDBOXVECTORIZER_PASSES_TRANSACTIONALWAYSACCEPT_H

llvm/lib/SandboxIR/Tracker.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,13 +347,14 @@ void Tracker::save() {
347347

348348
void Tracker::revert() {
349349
assert(State == TrackerState::Record && "Forgot to save()!");
350-
State = TrackerState::Disabled;
350+
State = TrackerState::Reverting;
351351
for (auto &Change : reverse(Changes))
352352
Change->revert(*this);
353353
Changes.clear();
354354
#if !defined(NDEBUG) && defined(EXPENSIVE_CHECKS)
355355
SnapshotChecker.expectNoDiff();
356356
#endif
357+
State = TrackerState::Disabled;
357358
}
358359

359360
void Tracker::accept() {

llvm/lib/Transforms/Vectorize/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ add_llvm_component_library(LLVMVectorize
99
SandboxVectorizer/Legality.cpp
1010
SandboxVectorizer/Passes/BottomUpVec.cpp
1111
SandboxVectorizer/Passes/RegionsFromMetadata.cpp
12+
SandboxVectorizer/Passes/TransactionAcceptOrRevert.cpp
1213
SandboxVectorizer/SandboxVectorizer.cpp
1314
SandboxVectorizer/SandboxVectorizerPassBuilder.cpp
1415
SandboxVectorizer/Scheduler.cpp

llvm/lib/Transforms/Vectorize/SandboxVectorizer/DependencyGraph.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -368,6 +368,9 @@ MemDGNode *DependencyGraph::getMemDGNodeAfter(DGNode *N, bool IncludingN,
368368
}
369369

370370
void DependencyGraph::notifyCreateInstr(Instruction *I) {
371+
if (Ctx->getTracker().getState() == Tracker::TrackerState::Reverting)
372+
// We don't maintain the DAG while reverting.
373+
return;
371374
// Nothing to do if the node is not in the focus range of the DAG.
372375
if (!(DAGInterval.contains(I) || DAGInterval.touches(I)))
373376
return;
@@ -405,6 +408,9 @@ void DependencyGraph::notifyCreateInstr(Instruction *I) {
405408
}
406409

407410
void DependencyGraph::notifyMoveInstr(Instruction *I, const BBIterator &To) {
411+
if (Ctx->getTracker().getState() == Tracker::TrackerState::Reverting)
412+
// We don't maintain the DAG while reverting.
413+
return;
408414
// NOTE: This function runs before `I` moves to its new destination.
409415
BasicBlock *BB = To.getNodeParent();
410416
assert(!(To != BB->end() && &*To == I->getNextNode()) &&
@@ -472,6 +478,9 @@ void DependencyGraph::notifyMoveInstr(Instruction *I, const BBIterator &To) {
472478
}
473479

474480
void DependencyGraph::notifyEraseInstr(Instruction *I) {
481+
if (Ctx->getTracker().getState() == Tracker::TrackerState::Reverting)
482+
// We don't maintain the DAG while reverting.
483+
return;
475484
// Update the MemDGNode chain if this is a memory node.
476485
if (auto *MemN = dyn_cast_or_null<MemDGNode>(getNodeOrNull(I))) {
477486
auto *PrevMemN = getMemDGNodeBefore(MemN, /*IncludingN=*/false);

llvm/lib/Transforms/Vectorize/SandboxVectorizer/Passes/BottomUpVec.cpp

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#include "llvm/SandboxIR/Function.h"
1313
#include "llvm/SandboxIR/Instruction.h"
1414
#include "llvm/SandboxIR/Module.h"
15+
#include "llvm/SandboxIR/Region.h"
1516
#include "llvm/SandboxIR/Utils.h"
1617
#include "llvm/Transforms/Vectorize/SandboxVectorizer/SandboxVectorizerPassBuilder.h"
1718
#include "llvm/Transforms/Vectorize/SandboxVectorizer/SeedCollector.h"
@@ -448,13 +449,24 @@ bool BottomUpVec::runOnFunction(Function &F, const Analyses &A) {
448449

449450
assert(SeedSlice.size() >= 2 && "Should have been rejected!");
450451

451-
// TODO: If vectorization succeeds, run the RegionPassManager on the
452-
// resulting region.
453-
454452
// TODO: Refactor to remove the unnecessary copy to SeedSliceVals.
455453
SmallVector<Value *> SeedSliceVals(SeedSlice.begin(),
456454
SeedSlice.end());
457-
Change |= tryVectorize(SeedSliceVals);
455+
// Create an empty region. Instructions get added to the region
456+
// automatically by the callbacks.
457+
auto &Ctx = F.getContext();
458+
Region Rgn(Ctx, A.getTTI());
459+
// Save the state of the IR before we make any changes. The
460+
// transaction gets accepted/reverted by the tr-accept-or-revert pass.
461+
Ctx.save();
462+
// Try to vectorize starting from the seed slice. The returned value
463+
// is true if we found vectorizable code and generated some vector
464+
// code for it. It does not mean that the code is profitable.
465+
bool VecSuccess = tryVectorize(SeedSliceVals);
466+
if (VecSuccess)
467+
// WARNING: All passes should return false, except those that
468+
// accept/revert the state.
469+
Change |= RPM.runOnRegion(Rgn, A);
458470
}
459471
}
460472
}

llvm/lib/Transforms/Vectorize/SandboxVectorizer/Passes/PassRegistry.def

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919

2020
REGION_PASS("null", ::llvm::sandboxir::NullPass)
2121
REGION_PASS("print-instruction-count", ::llvm::sandboxir::PrintInstructionCount)
22+
REGION_PASS("tr-accept", ::llvm::sandboxir::TransactionAlwaysAccept)
23+
REGION_PASS("tr-accept-or-revert", ::llvm::sandboxir::TransactionAcceptOrRevert)
2224

2325
#undef REGION_PASS
2426

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
//===- TransactionAcceptOrRevert.cpp - Check cost and accept/revert region ===//
2+
//
3+
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4+
// See https://llvm.org/LICENSE.txt for license information.
5+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6+
//
7+
//===----------------------------------------------------------------------===//
8+
9+
#include "llvm/Transforms/Vectorize/SandboxVectorizer/Passes/TransactionAcceptOrRevert.h"
10+
#include "llvm/Support/CommandLine.h"
11+
#include "llvm/Support/InstructionCost.h"
12+
13+
namespace llvm {
14+
15+
static cl::opt<int> CostThreshold("sbvec-cost-threshold", cl::init(0),
16+
cl::Hidden,
17+
cl::desc("Vectorization cost threshold."));
18+
19+
namespace sandboxir {
20+
21+
bool TransactionAcceptOrRevert::runOnRegion(Region &Rgn, const Analyses &A) {
22+
const auto &SB = Rgn.getScoreboard();
23+
InstructionCost CostAfterMinusBefore = SB.getAfterCost() - SB.getBeforeCost();
24+
// TODO: Print costs / write to remarks.
25+
auto &Tracker = Rgn.getContext().getTracker();
26+
if (CostAfterMinusBefore < -CostThreshold) {
27+
bool HasChanges = !Tracker.empty();
28+
Tracker.accept();
29+
return HasChanges;
30+
}
31+
// Revert the IR.
32+
Rgn.getContext().getTracker().revert();
33+
return false;
34+
}
35+
36+
} // namespace sandboxir
37+
} // namespace llvm

llvm/lib/Transforms/Vectorize/SandboxVectorizer/SandboxVectorizer.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,10 @@ static cl::opt<std::string> UserDefinedPassPipeline(
3131

3232
SandboxVectorizerPass::SandboxVectorizerPass() : FPM("fpm") {
3333
if (UserDefinedPassPipeline == DefaultPipelineMagicStr) {
34-
// TODO: Add region passes to the default pipeline.
34+
// TODO: Add passes to the default pipeline. It currently contains:
35+
// - the bottom-up-vectorizer pass
3536
FPM.setPassPipeline(
36-
"bottom-up-vec<>",
37+
"bottom-up-vec<tr-accept-or-revert>",
3738
sandboxir::SandboxVectorizerPassBuilder::createFunctionPass);
3839
} else {
3940
// Create the user-defined pipeline.

llvm/lib/Transforms/Vectorize/SandboxVectorizer/SandboxVectorizerPassBuilder.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
#include "llvm/Transforms/Vectorize/SandboxVectorizer/Passes/NullPass.h"
55
#include "llvm/Transforms/Vectorize/SandboxVectorizer/Passes/PrintInstructionCount.h"
66
#include "llvm/Transforms/Vectorize/SandboxVectorizer/Passes/RegionsFromMetadata.h"
7+
#include "llvm/Transforms/Vectorize/SandboxVectorizer/Passes/TransactionAcceptOrRevert.h"
8+
#include "llvm/Transforms/Vectorize/SandboxVectorizer/Passes/TransactionAlwaysAccept.h"
79

810
namespace llvm::sandboxir {
911

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
2+
; RUN: opt -passes=sandbox-vectorizer -mtriple=x86_64-- -mattr=+sse4.1 %s -S -sbvec-cost-threshold=0 | FileCheck %s --check-prefix=THRESHOLD_0
3+
; RUN: opt -passes=sandbox-vectorizer -mtriple=x86_64-- -mattr=+sse4.1 %s -S -sbvec-cost-threshold=99 | FileCheck %s --check-prefix=THRESHOLD_99
4+
5+
define void @simple_cost_test(ptr %ptr) {
6+
; THRESHOLD_0-LABEL: define void @simple_cost_test(
7+
; THRESHOLD_0-SAME: ptr [[PTR:%.*]]) #[[ATTR0:[0-9]+]] {
8+
; THRESHOLD_0-NEXT: [[PTR0:%.*]] = getelementptr double, ptr [[PTR]], i32 0
9+
; THRESHOLD_0-NEXT: [[VECL:%.*]] = load <2 x double>, ptr [[PTR0]], align 8, !sandboxvec [[META0:![0-9]+]]
10+
; THRESHOLD_0-NEXT: store <2 x double> [[VECL]], ptr [[PTR0]], align 8, !sandboxvec [[META0]]
11+
; THRESHOLD_0-NEXT: ret void
12+
;
13+
; THRESHOLD_99-LABEL: define void @simple_cost_test(
14+
; THRESHOLD_99-SAME: ptr [[PTR:%.*]]) #[[ATTR0:[0-9]+]] {
15+
; THRESHOLD_99-NEXT: [[PTR0:%.*]] = getelementptr double, ptr [[PTR]], i32 0
16+
; THRESHOLD_99-NEXT: [[PTR1:%.*]] = getelementptr double, ptr [[PTR]], i32 1, !sandboxvec [[META0:![0-9]+]]
17+
; THRESHOLD_99-NEXT: [[LD0:%.*]] = load double, ptr [[PTR0]], align 8, !sandboxvec [[META0]]
18+
; THRESHOLD_99-NEXT: [[LD1:%.*]] = load double, ptr [[PTR1]], align 8, !sandboxvec [[META0]]
19+
; THRESHOLD_99-NEXT: store double [[LD0]], ptr [[PTR0]], align 8, !sandboxvec [[META0]]
20+
; THRESHOLD_99-NEXT: store double [[LD1]], ptr [[PTR1]], align 8, !sandboxvec [[META0]]
21+
; THRESHOLD_99-NEXT: ret void
22+
;
23+
%ptr0 = getelementptr double, ptr %ptr, i32 0
24+
%ptr1 = getelementptr double, ptr %ptr, i32 1
25+
%ld0 = load double, ptr %ptr0
26+
%ld1 = load double, ptr %ptr1
27+
store double %ld0, ptr %ptr0
28+
store double %ld1, ptr %ptr1
29+
ret void
30+
}
31+
32+
define void @pack_cost_test_(ptr %ptr) {
33+
; THRESHOLD_0-LABEL: define void @pack_cost_test_(
34+
; THRESHOLD_0-SAME: ptr [[PTR:%.*]]) #[[ATTR0]] {
35+
; THRESHOLD_0-NEXT: [[PTR0:%.*]] = getelementptr float, ptr [[PTR]], i32 0
36+
; THRESHOLD_0-NEXT: [[PTR1:%.*]] = getelementptr float, ptr [[PTR]], i32 1
37+
; THRESHOLD_0-NEXT: [[LD0:%.*]] = load float, ptr [[PTR0]], align 4
38+
; THRESHOLD_0-NEXT: [[LD1:%.*]] = load float, ptr [[PTR1]], align 4
39+
; THRESHOLD_0-NEXT: [[PACK4:%.*]] = insertelement <4 x float> poison, float [[LD0]], i32 0, !sandboxvec [[META1:![0-9]+]]
40+
; THRESHOLD_0-NEXT: [[PACK5:%.*]] = insertelement <4 x float> [[PACK4]], float [[LD1]], i32 1, !sandboxvec [[META1]]
41+
; THRESHOLD_0-NEXT: [[PACK6:%.*]] = insertelement <4 x float> [[PACK5]], float [[LD0]], i32 2, !sandboxvec [[META1]]
42+
; THRESHOLD_0-NEXT: [[PACK7:%.*]] = insertelement <4 x float> [[PACK6]], float [[LD1]], i32 3, !sandboxvec [[META1]]
43+
; THRESHOLD_0-NEXT: [[PACK:%.*]] = insertelement <4 x float> poison, float [[LD0]], i32 0, !sandboxvec [[META1]]
44+
; THRESHOLD_0-NEXT: [[PACK1:%.*]] = insertelement <4 x float> [[PACK]], float [[LD1]], i32 1, !sandboxvec [[META1]]
45+
; THRESHOLD_0-NEXT: [[PACK2:%.*]] = insertelement <4 x float> [[PACK1]], float [[LD0]], i32 2, !sandboxvec [[META1]]
46+
; THRESHOLD_0-NEXT: [[PACK3:%.*]] = insertelement <4 x float> [[PACK2]], float [[LD1]], i32 3, !sandboxvec [[META1]]
47+
; THRESHOLD_0-NEXT: [[VEC:%.*]] = fmul <4 x float> [[PACK3]], [[PACK7]], !sandboxvec [[META1]]
48+
; THRESHOLD_0-NEXT: store <4 x float> [[VEC]], ptr [[PTR0]], align 4, !sandboxvec [[META1]]
49+
; THRESHOLD_0-NEXT: ret void
50+
;
51+
; THRESHOLD_99-LABEL: define void @pack_cost_test_(
52+
; THRESHOLD_99-SAME: ptr [[PTR:%.*]]) #[[ATTR0]] {
53+
; THRESHOLD_99-NEXT: [[PTR0:%.*]] = getelementptr float, ptr [[PTR]], i32 0
54+
; THRESHOLD_99-NEXT: [[PTR1:%.*]] = getelementptr float, ptr [[PTR]], i32 1
55+
; THRESHOLD_99-NEXT: [[PTR2:%.*]] = getelementptr float, ptr [[PTR]], i32 2, !sandboxvec [[META1:![0-9]+]]
56+
; THRESHOLD_99-NEXT: [[PTR3:%.*]] = getelementptr float, ptr [[PTR]], i32 3, !sandboxvec [[META1]]
57+
; THRESHOLD_99-NEXT: [[LD0:%.*]] = load float, ptr [[PTR0]], align 4
58+
; THRESHOLD_99-NEXT: [[LD1:%.*]] = load float, ptr [[PTR1]], align 4
59+
; THRESHOLD_99-NEXT: [[MUL0:%.*]] = fmul float [[LD0]], [[LD0]], !sandboxvec [[META1]]
60+
; THRESHOLD_99-NEXT: [[MUL1:%.*]] = fmul float [[LD1]], [[LD1]], !sandboxvec [[META1]]
61+
; THRESHOLD_99-NEXT: [[MUL2:%.*]] = fmul float [[LD0]], [[LD0]], !sandboxvec [[META1]]
62+
; THRESHOLD_99-NEXT: [[MUL3:%.*]] = fmul float [[LD1]], [[LD1]], !sandboxvec [[META1]]
63+
; THRESHOLD_99-NEXT: store float [[MUL0]], ptr [[PTR0]], align 4, !sandboxvec [[META1]]
64+
; THRESHOLD_99-NEXT: store float [[MUL1]], ptr [[PTR1]], align 4, !sandboxvec [[META1]]
65+
; THRESHOLD_99-NEXT: store float [[MUL2]], ptr [[PTR2]], align 4, !sandboxvec [[META1]]
66+
; THRESHOLD_99-NEXT: store float [[MUL3]], ptr [[PTR3]], align 4, !sandboxvec [[META1]]
67+
; THRESHOLD_99-NEXT: ret void
68+
;
69+
%ptr0 = getelementptr float, ptr %ptr, i32 0
70+
%ptr1 = getelementptr float, ptr %ptr, i32 1
71+
%ptr2 = getelementptr float, ptr %ptr, i32 2
72+
%ptr3 = getelementptr float, ptr %ptr, i32 3
73+
%ld0 = load float, ptr %ptr0
74+
%ld1 = load float, ptr %ptr1
75+
%mul0 = fmul float %ld0, %ld0
76+
%mul1 = fmul float %ld1, %ld1
77+
%mul2 = fmul float %ld0, %ld0
78+
%mul3 = fmul float %ld1, %ld1
79+
store float %mul0, ptr %ptr0
80+
store float %mul1, ptr %ptr1
81+
store float %mul2, ptr %ptr2
82+
store float %mul3, ptr %ptr3
83+
ret void
84+
}
85+
;.
86+
; THRESHOLD_0: [[META0]] = distinct !{!"sandboxregion"}
87+
; THRESHOLD_0: [[META1]] = distinct !{!"sandboxregion"}
88+
;.
89+
; THRESHOLD_99: [[META0]] = distinct !{!"sandboxregion"}
90+
; THRESHOLD_99: [[META1]] = distinct !{!"sandboxregion"}
91+
;.

llvm/test/Transforms/SandboxVectorizer/bottomup_basic.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
2-
; RUN: opt -passes=sandbox-vectorizer -sbvec-vec-reg-bits=1024 -sbvec-allow-non-pow2 -sbvec-passes="bottom-up-vec<>" %s -S | FileCheck %s
2+
; RUN: opt -passes=sandbox-vectorizer -sbvec-vec-reg-bits=1024 -sbvec-allow-non-pow2 -sbvec-passes="bottom-up-vec<tr-accept>" %s -S | FileCheck %s
33

44
define void @store_load(ptr %ptr) {
55
; CHECK-LABEL: define void @store_load(

llvm/test/Transforms/SandboxVectorizer/bottomup_seed_slice.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
2-
; RUN: opt -passes=sandbox-vectorizer -sbvec-vec-reg-bits=1024 -sbvec-allow-non-pow2 -sbvec-passes="bottom-up-vec<>" %s -S | FileCheck %s
2+
; RUN: opt -passes=sandbox-vectorizer -sbvec-vec-reg-bits=1024 -sbvec-allow-non-pow2 -sbvec-passes="bottom-up-vec<tr-accept>" %s -S | FileCheck %s
33

44

55
declare void @foo()

llvm/test/Transforms/SandboxVectorizer/bottomup_seed_slice_pow2.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
2-
; RUN: opt -passes=sandbox-vectorizer -sbvec-vec-reg-bits=1024 -sbvec-allow-non-pow2=false -sbvec-passes="bottom-up-vec<>" %s -S | FileCheck %s --check-prefix=POW2
3-
; RUN: opt -passes=sandbox-vectorizer -sbvec-vec-reg-bits=1024 -sbvec-allow-non-pow2=true -sbvec-passes="bottom-up-vec<>" %s -S | FileCheck %s --check-prefix=NON-POW2
2+
; RUN: opt -passes=sandbox-vectorizer -sbvec-vec-reg-bits=1024 -sbvec-allow-non-pow2=false -sbvec-passes="bottom-up-vec<tr-accept>" %s -S | FileCheck %s --check-prefix=POW2
3+
; RUN: opt -passes=sandbox-vectorizer -sbvec-vec-reg-bits=1024 -sbvec-allow-non-pow2=true -sbvec-passes="bottom-up-vec<tr-accept>" %s -S | FileCheck %s --check-prefix=NON-POW2
44

55
define void @pow2(ptr %ptr, float %val) {
66
; POW2-LABEL: define void @pow2(

llvm/test/Transforms/SandboxVectorizer/cross_bbs.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
2-
; RUN: opt -passes=sandbox-vectorizer -sbvec-vec-reg-bits=1024 -sbvec-allow-non-pow2 -sbvec-passes="bottom-up-vec<>" %s -S | FileCheck %s
2+
; RUN: opt -passes=sandbox-vectorizer -sbvec-vec-reg-bits=1024 -sbvec-allow-non-pow2 -sbvec-passes="bottom-up-vec<tr-accept>" %s -S | FileCheck %s
33

44
define void @cross_bbs(ptr %ptr) {
55
; CHECK-LABEL: define void @cross_bbs(

llvm/test/Transforms/SandboxVectorizer/default_pass_pipeline.ll

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,10 @@
44

55
; This checks the default pass pipeline for the sandbox vectorizer.
66
define void @pipeline() {
7+
; CHECK: fpm
78
; CHECK: bottom-up-vec
89
; CHECK: rpm
10+
; CHECK: tr-accept-or-revert
911
; CHECK-EMPTY:
1012
ret void
1113
}

llvm/test/Transforms/SandboxVectorizer/pack.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
2-
; RUN: opt -passes=sandbox-vectorizer -sbvec-vec-reg-bits=1024 -sbvec-allow-non-pow2 -sbvec-passes="bottom-up-vec<>" %s -S | FileCheck %s
2+
; RUN: opt -passes=sandbox-vectorizer -sbvec-vec-reg-bits=1024 -sbvec-allow-non-pow2 -sbvec-passes="bottom-up-vec<tr-accept>" %s -S | FileCheck %s
33

44
define void @pack_constants(ptr %ptr) {
55
; CHECK-LABEL: define void @pack_constants(

llvm/test/Transforms/SandboxVectorizer/repeated_instrs.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
2-
; RUN: opt -passes=sandbox-vectorizer -sbvec-vec-reg-bits=1024 -sbvec-allow-non-pow2 -sbvec-passes="bottom-up-vec<>" %s -S | FileCheck %s
2+
; RUN: opt -passes=sandbox-vectorizer -sbvec-vec-reg-bits=1024 -sbvec-allow-non-pow2 -sbvec-passes="bottom-up-vec<tr-accept>" %s -S | FileCheck %s
33

44
define i32 @repeated_splat(ptr %ptr, i32 %v) #0 {
55
; CHECK-LABEL: define i32 @repeated_splat(

0 commit comments

Comments
 (0)