[PATCH] D139068: [AArch64][SVE] Allow to lower WHILEop operations with constant operands to PTRUE
Sander de Smalen via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Dec 14 09:31:45 PST 2022
sdesmalen added inline comments.
================
Comment at: llvm/test/CodeGen/AArch64/sve2-intrinsics-while.ll:141
+entry:
+ %out = call <vscale x 16 x i1> @llvm.aarch64.sve.whilege.nxv16i1.i32(i32 2147483647, i32 0)
+ ret <vscale x 16 x i1> %out
----------------
Similar comment as for whilegt, it's better to pick some numbers that actually end up as a valid vl if you remove the overflow check, e.g.
@llvm.aarch64.sve.whilege.nxv16i1.i32(i32 -2147483641, i32 2147483647)
================
Comment at: llvm/test/CodeGen/AArch64/sve2-intrinsics-while.ll:269
+entry:
+ %out = call <vscale x 16 x i1> @llvm.aarch64.sve.whilehs.nxv16i1.i32(i32 4294967295, i32 6)
+ ret <vscale x 16 x i1> %out
----------------
Similar comment as for whilehi, this doesn't overflow. You could use
@llvm.aarch64.sve.whilehs.nxv16i1.i32(i32 6, i32 4294967295) ; this would wrap around to vl8
================
Comment at: llvm/test/CodeGen/AArch64/sve2-intrinsics-while.ll:409
+entry:
+ %out = call <vscale x 16 x i1> @llvm.aarch64.sve.whilegt.nxv16i1.i32(i32 2147483647, i32 -2147483646)
+ ret <vscale x 16 x i1> %out
----------------
It's better to pick some numbers that actually end up as a valid `vl` if you remove the overflow check, e.g.
@llvm.aarch64.sve.whilegt.nxv16i1.i32(i32 -2147483641, i32 2147483647)
Can you use similar numbers whilege?
================
Comment at: llvm/test/CodeGen/AArch64/sve2-intrinsics-while.ll:537
+entry:
+ %out = call <vscale x 16 x i1> @llvm.aarch64.sve.whilehi.nxv16i1.i32(i32 4294967295, i32 6)
+ ret <vscale x 16 x i1> %out
----------------
This doesn't overflow right? 4294967295 - 6 => 4294967289 (no overflow here).
For whilehi, it would overflow if the start value would be lower than the end value, e.g.
@llvm.aarch64.sve.whilehi.nxv16i1.i32(i32 7, i32 4294967295) ; this would wrap around to vl8
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D139068/new/
https://reviews.llvm.org/D139068
More information about the llvm-commits
mailing list