File tree Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -368,8 +368,8 @@ OpFoldResult MakeRangeOp::fold(FoldAdaptor adaptor) {
368
368
LogicalResult MakeRangeOp::verify () {
369
369
int64_t start = getStartAttr ().getInt ();
370
370
int64_t end = getEndAttr ().getInt ();
371
- if (start > end) {
372
- return this ->emitOpError () << " start must be less than or equal to end" ;
371
+ if (start >= end) {
372
+ return this ->emitOpError () << " start must be less than end" ;
373
373
}
374
374
auto ty = getType ();
375
375
if (ty.getShape ().size () != 1 ) {
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ tt.func public @_2d_tensor() {
22
22
23
23
// -----
24
24
tt.func public @bad_start_end () {
25
- // expected-error @+1 {{start must be less than or equal to end}}
25
+ // expected-error @+1 {{start must be less than end}}
26
26
%a = tt.make_range { start = 0 : i32 , end = -16 : i32 } : tensor <16 xi32 >
27
27
tt.return
28
28
}
@@ -33,3 +33,11 @@ tt.func public @bad_num_elems() {
33
33
%a = tt.make_range { start = 0 : i32 , end = 32 : i32 } : tensor <16 xi32 >
34
34
tt.return
35
35
}
36
+
37
+ // -----
38
+
39
+ tt.func @same_start_end () {
40
+ // expected-error @+1 {{'tt.make_range' op start must be less than end}}
41
+ %0 = tt.make_range {end = 1 : i32 , start = 1 : i32 } : tensor <0 xi32 >
42
+ tt.return
43
+ }
You can’t perform that action at this time.
0 commit comments