Skip to content

Commit 1d8af68

Browse files
author
Sjoerd Meijer
committed
Revert "[Verifier] Additional check for intrinsic get.active.lane.mask"
This reverts commit 8d5f64c. Thanks to Eli Friedma for pointing out that this check is not appropiate here, this check will be moved to the Lint pass.
1 parent 4e9d207 commit 1d8af68

2 files changed

Lines changed: 8 additions & 36 deletions

File tree

‎llvm/lib/IR/Verifier.cpp‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4841,9 +4841,6 @@ void Verifier::visitIntrinsicCall(Intrinsic::ID ID, CallBase &Call) {
48414841
auto *ElemTy = Call.getType()->getScalarType();
48424842
Assert(ElemTy->isIntegerTy(1), "get_active_lane_mask: element type is not "
48434843
"i1", Call);
4844-
if (auto *TripCount = dyn_cast<ConstantInt>(Call.getArgOperand(1)))
4845-
Assert(!TripCount->isZero(), "get_active_lane_mask: operand #2 "
4846-
"must be greater than 0", Call);
48474844
break;
48484845
}
48494846
case Intrinsic::masked_load: {
Lines changed: 8 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,21 @@
11
; RUN: not llvm-as < %s -o /dev/null 2>&1 | FileCheck %s
22

3+
declare <4 x i32> @llvm.get.active.lane.mask.v4i32.i32(i32, i32)
34

4-
define <4 x i32> @t1(i32 %IV, i32 %TC) {
5+
define <4 x i32> @t1(i32 %IV, i32 %BTC) {
56
; CHECK: get_active_lane_mask: element type is not i1
6-
; CHECK-NEXT: %res = call <4 x i32> @llvm.get.active.lane.mask.v4i32.i32(i32 %IV, i32 %TC)
7+
; CHECK-NEXT: %res = call <4 x i32> @llvm.get.active.lane.mask.v4i32.i32(i32 %IV, i32 %BTC)
78

8-
%res = call <4 x i32> @llvm.get.active.lane.mask.v4i32.i32(i32 %IV, i32 %TC)
9+
%res = call <4 x i32> @llvm.get.active.lane.mask.v4i32.i32(i32 %IV, i32 %BTC)
910
ret <4 x i32> %res
1011
}
1112

12-
define i32 @t2(i32 %IV, i32 %TC) {
13+
declare i32 @llvm.get.active.lane.mask.i32.i32(i32, i32)
14+
15+
define i32 @t2(i32 %IV, i32 %BTC) {
1316
; CHECK: Intrinsic has incorrect return type!
1417
; CHECK-NEXT: i32 (i32, i32)* @llvm.get.active.lane.mask.i32.i32
1518

16-
%res = call i32 @llvm.get.active.lane.mask.i32.i32(i32 %IV, i32 %TC)
19+
%res = call i32 @llvm.get.active.lane.mask.i32.i32(i32 %IV, i32 %BTC)
1720
ret i32 %res
1821
}
19-
20-
define <4 x i1> @t3(i32 %IV) {
21-
; CHECK: get_active_lane_mask: operand #2 must be greater than 0
22-
; CHECK-NEXT: %res = call <4 x i1> @llvm.get.active.lane.mask.v4i1.i32(i32 %IV, i32 0)
23-
24-
%res = call <4 x i1> @llvm.get.active.lane.mask.v4i1.i32(i32 %IV, i32 0)
25-
ret <4 x i1> %res
26-
}
27-
28-
define <4 x i1> @t4(i32 %IV) {
29-
; CHECK-NOT: get_active_lane_mask
30-
; CHECK-NOT: call <4 x i1> @llvm.get.active.lane.mask
31-
32-
%res = call <4 x i1> @llvm.get.active.lane.mask.v4i1.i32(i32 %IV, i32 1)
33-
ret <4 x i1> %res
34-
}
35-
36-
define <4 x i1> @t5(i32 %IV) {
37-
; CHECK-NOT: get_active_lane_mask
38-
; CHECK-NOT: call <4 x i1> @llvm.get.active.lane.mask
39-
40-
%res = call <4 x i1> @llvm.get.active.lane.mask.v4i1.i32(i32 %IV, i32 -1)
41-
ret <4 x i1> %res
42-
}
43-
44-
declare <4 x i32> @llvm.get.active.lane.mask.v4i32.i32(i32, i32)
45-
declare i32 @llvm.get.active.lane.mask.i32.i32(i32, i32)
46-
declare <4 x i1> @llvm.get.active.lane.mask.v4i1.i32(i32, i32)

0 commit comments

Comments
 (0)