[PATCH] D80596: New intrinsc @llvm.get.active.lane.mask()

Simon Moll via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 28 01:03:07 PDT 2020


simoll added inline comments.


================
Comment at: llvm/docs/LangRef.rst:16174
+      declare <8 x i1> @llvm.get.active.lane.mask.v8i1.i64(i64 %VIV[0], i64 %BTC)
+      declare <16 x i1> @llvm.get.active.lane.mask.v16i1.i64.v16i64(i64 %VIV[0], i64 %BTC)
+
----------------
Since this intrinsic is really only useful (by itself) with scalable types, i guess you should add an example with scalable types here.


================
Comment at: llvm/docs/LangRef.rst:16201
+The '``llvm.get.active.lane.mask.*``' intrinsics are semantically equivalent to
+`icmp ule %VIV, (splat %BTC)`, where VIV is the Vector Induction Variable, and
+BTC the back-edge taken count splat into a vector, except when the vector
----------------
I don't like how this is described in terms of the vector hwloop thing. If i am not mistaken, the semantics is simply:

  %m[i] = icmp ule (%base + i) <= %n

is equivalent to
  
  %m = @llvm.get.active.lane.mask(%base, %n)


================
Comment at: llvm/docs/LangRef.rst:16201
+The '``llvm.get.active.lane.mask.*``' intrinsics are semantically equivalent to
+`icmp ule %VIV, (splat %BTC)`, where VIV is the Vector Induction Variable, and
+BTC the back-edge taken count splat into a vector, except when the vector
----------------
simoll wrote:
> I don't like how this is described in terms of the vector hwloop thing. If i am not mistaken, the semantics is simply:
> 
>   %m[i] = icmp ule (%base + i) <= %n
> 
> is equivalent to
>   
>   %m = @llvm.get.active.lane.mask(%base, %n)
`%VIV` and `%BTC` are both integers now (no splat needed).


================
Comment at: llvm/docs/LangRef.rst:16217
+
+      %induction = add <4 x i64> %broadcast.splat, <i64 0, i64 1, i64 2, i64 3>
+      %elem0 = extractelement <4 x i32> %induction, i32 0
----------------
This example seems a bit convoluted - i understand that this is because this is the code pattern you emit in LV. How about you drop the first two lines and call the intrinsic directly with two unspecified `i64` arguments?


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D80596/new/

https://reviews.llvm.org/D80596





More information about the llvm-commits mailing list