[llvm] 1d8af68 - Revert "[Verifier] Additional check for intrinsic get.active.lane.mask"

Sjoerd Meijer via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 27 01:28:30 PDT 2020


Author: Sjoerd Meijer
Date: 2020-08-27T09:27:05+01:00
New Revision: 1d8af682ef1d1c15c5e8e4341abf18fee0ad238a

URL: https://github.com/llvm/llvm-project/commit/1d8af682ef1d1c15c5e8e4341abf18fee0ad238a
DIFF: https://github.com/llvm/llvm-project/commit/1d8af682ef1d1c15c5e8e4341abf18fee0ad238a.diff

LOG: Revert "[Verifier] Additional check for intrinsic get.active.lane.mask"

This reverts commit 8d5f64c4edbc190a5a8790157fa1d99cfac34016.

Thanks to Eli Friedma for pointing out that this check is not appropiate here,
this check will be moved to the Lint pass.

Added: 
    

Modified: 
    llvm/lib/IR/Verifier.cpp
    llvm/test/Verifier/get-active-lane-mask.ll

Removed: 
    


################################################################################
diff  --git a/llvm/lib/IR/Verifier.cpp b/llvm/lib/IR/Verifier.cpp
index bdc04862ff57..d9e3a61e6fa2 100644
--- a/llvm/lib/IR/Verifier.cpp
+++ b/llvm/lib/IR/Verifier.cpp
@@ -4841,9 +4841,6 @@ void Verifier::visitIntrinsicCall(Intrinsic::ID ID, CallBase &Call) {
     auto *ElemTy = Call.getType()->getScalarType();
     Assert(ElemTy->isIntegerTy(1), "get_active_lane_mask: element type is not "
            "i1", Call);
-    if (auto *TripCount = dyn_cast<ConstantInt>(Call.getArgOperand(1)))
-      Assert(!TripCount->isZero(), "get_active_lane_mask: operand #2 "
-             "must be greater than 0", Call);
     break;
   }
   case Intrinsic::masked_load: {

diff  --git a/llvm/test/Verifier/get-active-lane-mask.ll b/llvm/test/Verifier/get-active-lane-mask.ll
index e518fe237b5c..94d819b5c75b 100644
--- a/llvm/test/Verifier/get-active-lane-mask.ll
+++ b/llvm/test/Verifier/get-active-lane-mask.ll
@@ -1,46 +1,21 @@
 ; RUN: not llvm-as < %s -o /dev/null 2>&1 | FileCheck %s
 
+declare <4 x i32> @llvm.get.active.lane.mask.v4i32.i32(i32, i32)
 
-define <4 x i32> @t1(i32 %IV, i32 %TC) {
+define <4 x i32> @t1(i32 %IV, i32 %BTC) {
 ; CHECK:      get_active_lane_mask: element type is not i1
-; CHECK-NEXT: %res = call <4 x i32> @llvm.get.active.lane.mask.v4i32.i32(i32 %IV, i32 %TC)
+; CHECK-NEXT: %res = call <4 x i32> @llvm.get.active.lane.mask.v4i32.i32(i32 %IV, i32 %BTC)
 
-  %res = call <4 x i32> @llvm.get.active.lane.mask.v4i32.i32(i32 %IV, i32 %TC)
+  %res = call <4 x i32> @llvm.get.active.lane.mask.v4i32.i32(i32 %IV, i32 %BTC)
   ret <4 x i32> %res
 }
 
-define i32 @t2(i32 %IV, i32 %TC) {
+declare i32 @llvm.get.active.lane.mask.i32.i32(i32, i32)
+
+define i32 @t2(i32 %IV, i32 %BTC) {
 ; CHECK:      Intrinsic has incorrect return type!
 ; CHECK-NEXT: i32 (i32, i32)* @llvm.get.active.lane.mask.i32.i32
 
-  %res = call i32 @llvm.get.active.lane.mask.i32.i32(i32 %IV, i32 %TC)
+  %res = call i32 @llvm.get.active.lane.mask.i32.i32(i32 %IV, i32 %BTC)
   ret i32 %res
 }
-
-define <4 x i1> @t3(i32 %IV) {
-; CHECK:      get_active_lane_mask: operand #2 must be greater than 0
-; CHECK-NEXT: %res = call <4 x i1> @llvm.get.active.lane.mask.v4i1.i32(i32 %IV, i32 0)
-
-  %res = call <4 x i1> @llvm.get.active.lane.mask.v4i1.i32(i32 %IV, i32 0)
-  ret <4 x i1> %res
-}
-
-define <4 x i1> @t4(i32 %IV) {
-; CHECK-NOT: get_active_lane_mask
-; CHECK-NOT: call <4 x i1> @llvm.get.active.lane.mask
-
-  %res = call <4 x i1> @llvm.get.active.lane.mask.v4i1.i32(i32 %IV, i32 1)
-  ret <4 x i1> %res
-}
-
-define <4 x i1> @t5(i32 %IV) {
-; CHECK-NOT: get_active_lane_mask
-; CHECK-NOT: call <4 x i1> @llvm.get.active.lane.mask
-
-  %res = call <4 x i1> @llvm.get.active.lane.mask.v4i1.i32(i32 %IV, i32 -1)
-  ret <4 x i1> %res
-}
-
-declare <4 x i32> @llvm.get.active.lane.mask.v4i32.i32(i32, i32)
-declare i32 @llvm.get.active.lane.mask.i32.i32(i32, i32)
-declare <4 x i1> @llvm.get.active.lane.mask.v4i1.i32(i32, i32)


        


More information about the llvm-commits mailing list