File tree Expand file tree Collapse file tree 2 files changed +25
-0
lines changed
test/Triton/Intel/RemoveMasks
third_party/intel/lib/Utils Expand file tree Collapse file tree 2 files changed +25
-0
lines changed Original file line number Diff line number Diff line change 1+ // RUN: triton-opt %s -triton-intel-remove-masks | FileCheck %s
2+
3+ module {
4+ // COM: Regression test for issue #4556.
5+ // COM: Ensure test compiles without triggering an assertion.
6+ tt.func public @issue_4556 (%arg0: tensor <16 x1 x1 x!tt.ptr <f32 >>) {
7+ // CHECK-LABEL: issue_4556
8+ %c0_i32 = arith.constant 0 : i32
9+ %c1_i32 = arith.constant 1 : i32
10+ %c196_i32 = arith.constant 196 : i32
11+ %cst_0 = arith.constant dense <0.000000e+00 > : tensor <16 x1 x1 xf32 >
12+ %cst_196 = arith.constant dense <196 > : tensor <1 x1 x1 xi32 >
13+ scf.for %iv = %c0_i32 to %c196_i32 step %c1_i32 : i32 {
14+ %0 = tt.splat %iv : i32 -> tensor <1 x1 x1 xi32 >
15+ %1 = arith.cmpi slt , %0 , %cst_196 : tensor <1 x1 x1 xi32 >
16+ %mask = tt.broadcast %1 : tensor <1 x1 x1 xi1 > -> tensor <16 x1 x1 xi1 >
17+ %2 = tt.load %arg0 , %mask , %cst_0 : tensor <16 x1 x1 x!tt.ptr <f32 >>
18+ scf.yield
19+ }
20+ tt.return
21+ }
22+ }
Original file line number Diff line number Diff line change @@ -144,6 +144,9 @@ Value getFinalValue(Value value) {
144144 BlockArgument blockArg = cast<BlockArgument>(value);
145145 Operation *parentOp = blockArg.getOwner ()->getParentOp ();
146146 if (scf::ForOp forOp = dyn_cast<scf::ForOp>(parentOp)) {
147+ if (blockArg == forOp.getInductionVar ())
148+ return value;
149+
147150 int numIVs = forOp.getNumInductionVars ();
148151 int initArgIdx = blockArg.getArgNumber () - numIVs;
149152 auto initArgs = forOp.getInitArgs ();
You can’t perform that action at this time.
0 commit comments