diff --git a/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp b/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp --- a/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp +++ b/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp @@ -255,6 +255,12 @@ return false; case Intrinsic::aarch64_sve_ptrue: case Intrinsic::aarch64_sve_pnext: + case Intrinsic::aarch64_sve_cmpeq: + case Intrinsic::aarch64_sve_cmpne: + case Intrinsic::aarch64_sve_cmpge: + case Intrinsic::aarch64_sve_cmpgt: + case Intrinsic::aarch64_sve_cmphs: + case Intrinsic::aarch64_sve_cmphi: case Intrinsic::aarch64_sve_cmpeq_wide: case Intrinsic::aarch64_sve_cmpne_wide: case Intrinsic::aarch64_sve_cmpge_wide: @@ -265,6 +271,11 @@ case Intrinsic::aarch64_sve_cmphi_wide: case Intrinsic::aarch64_sve_cmplo_wide: case Intrinsic::aarch64_sve_cmpls_wide: + case Intrinsic::aarch64_sve_fcmpeq: + case Intrinsic::aarch64_sve_fcmpne: + case Intrinsic::aarch64_sve_fcmpge: + case Intrinsic::aarch64_sve_fcmpgt: + case Intrinsic::aarch64_sve_fcmpuo: return true; } } diff --git a/llvm/test/CodeGen/AArch64/sve-ptest-removal-cmpeq.ll b/llvm/test/CodeGen/AArch64/sve-ptest-removal-cmpeq.ll --- a/llvm/test/CodeGen/AArch64/sve-ptest-removal-cmpeq.ll +++ b/llvm/test/CodeGen/AArch64/sve-ptest-removal-cmpeq.ll @@ -20,10 +20,7 @@ define i32 @cmpeq_nxv4i32( %pg, %a, %b) { ; CHECK-LABEL: cmpeq_nxv4i32: ; CHECK: // %bb.0: -; CHECK-NEXT: ptrue p1.s -; CHECK-NEXT: and p1.b, p0/z, p0.b, p1.b ; CHECK-NEXT: cmpeq p0.s, p0/z, z0.s, z1.s -; CHECK-NEXT: ptest p1, p0.b ; CHECK-NEXT: cset w0, ne ; CHECK-NEXT: ret %1 = tail call @llvm.aarch64.sve.cmpeq.nxv4i32( %pg, %a, %b) diff --git a/llvm/test/CodeGen/AArch64/sve-ptest-removal-cmpge.ll b/llvm/test/CodeGen/AArch64/sve-ptest-removal-cmpge.ll --- a/llvm/test/CodeGen/AArch64/sve-ptest-removal-cmpge.ll +++ b/llvm/test/CodeGen/AArch64/sve-ptest-removal-cmpge.ll @@ -20,10 +20,7 @@ define i32 @cmpge_nxv4i32( %pg, %a, %b) { ; CHECK-LABEL: cmpge_nxv4i32: ; CHECK: // %bb.0: -; CHECK-NEXT: ptrue p1.s -; CHECK-NEXT: and p1.b, p0/z, p0.b, p1.b ; CHECK-NEXT: cmpge p0.s, p0/z, z0.s, z1.s -; CHECK-NEXT: ptest p1, p0.b ; CHECK-NEXT: cset w0, ne ; CHECK-NEXT: ret %1 = tail call @llvm.aarch64.sve.cmpge.nxv4i32( %pg, %a, %b) diff --git a/llvm/test/CodeGen/AArch64/sve-ptest-removal-cmpgt.ll b/llvm/test/CodeGen/AArch64/sve-ptest-removal-cmpgt.ll --- a/llvm/test/CodeGen/AArch64/sve-ptest-removal-cmpgt.ll +++ b/llvm/test/CodeGen/AArch64/sve-ptest-removal-cmpgt.ll @@ -20,10 +20,7 @@ define i32 @cmpgt_nxv4i32( %pg, %a, %b) { ; CHECK-LABEL: cmpgt_nxv4i32: ; CHECK: // %bb.0: -; CHECK-NEXT: ptrue p1.s -; CHECK-NEXT: and p1.b, p0/z, p0.b, p1.b ; CHECK-NEXT: cmpgt p0.s, p0/z, z0.s, z1.s -; CHECK-NEXT: ptest p1, p0.b ; CHECK-NEXT: cset w0, ne ; CHECK-NEXT: ret %1 = tail call @llvm.aarch64.sve.cmpgt.nxv4i32( %pg, %a, %b) diff --git a/llvm/test/CodeGen/AArch64/sve-ptest-removal-cmphi.ll b/llvm/test/CodeGen/AArch64/sve-ptest-removal-cmphi.ll --- a/llvm/test/CodeGen/AArch64/sve-ptest-removal-cmphi.ll +++ b/llvm/test/CodeGen/AArch64/sve-ptest-removal-cmphi.ll @@ -20,10 +20,7 @@ define i32 @cmphi_nxv4i32( %pg, %a, %b) { ; CHECK-LABEL: cmphi_nxv4i32: ; CHECK: // %bb.0: -; CHECK-NEXT: ptrue p1.s -; CHECK-NEXT: and p1.b, p0/z, p0.b, p1.b ; CHECK-NEXT: cmphi p0.s, p0/z, z0.s, z1.s -; CHECK-NEXT: ptest p1, p0.b ; CHECK-NEXT: cset w0, ne ; CHECK-NEXT: ret %1 = tail call @llvm.aarch64.sve.cmphi.nxv4i32( %pg, %a, %b) diff --git a/llvm/test/CodeGen/AArch64/sve-ptest-removal-cmphs.ll b/llvm/test/CodeGen/AArch64/sve-ptest-removal-cmphs.ll --- a/llvm/test/CodeGen/AArch64/sve-ptest-removal-cmphs.ll +++ b/llvm/test/CodeGen/AArch64/sve-ptest-removal-cmphs.ll @@ -20,10 +20,7 @@ define i32 @cmphs_nxv4i32( %pg, %a, %b) { ; CHECK-LABEL: cmphs_nxv4i32: ; CHECK: // %bb.0: -; CHECK-NEXT: ptrue p1.s -; CHECK-NEXT: and p1.b, p0/z, p0.b, p1.b ; CHECK-NEXT: cmphs p0.s, p0/z, z0.s, z1.s -; CHECK-NEXT: ptest p1, p0.b ; CHECK-NEXT: cset w0, ne ; CHECK-NEXT: ret %1 = tail call @llvm.aarch64.sve.cmphs.nxv4i32( %pg, %a, %b) diff --git a/llvm/test/CodeGen/AArch64/sve-ptest-removal-cmpne.ll b/llvm/test/CodeGen/AArch64/sve-ptest-removal-cmpne.ll --- a/llvm/test/CodeGen/AArch64/sve-ptest-removal-cmpne.ll +++ b/llvm/test/CodeGen/AArch64/sve-ptest-removal-cmpne.ll @@ -20,10 +20,7 @@ define i32 @cmpne_nxv4i32( %pg, %a, %b) { ; CHECK-LABEL: cmpne_nxv4i32: ; CHECK: // %bb.0: -; CHECK-NEXT: ptrue p1.s -; CHECK-NEXT: and p1.b, p0/z, p0.b, p1.b ; CHECK-NEXT: cmpne p0.s, p0/z, z0.s, z1.s -; CHECK-NEXT: ptest p1, p0.b ; CHECK-NEXT: cset w0, ne ; CHECK-NEXT: ret %1 = tail call @llvm.aarch64.sve.cmpne.nxv4i32( %pg, %a, %b) diff --git a/llvm/test/CodeGen/AArch64/sve-ptest.ll b/llvm/test/CodeGen/AArch64/sve-ptest.ll --- a/llvm/test/CodeGen/AArch64/sve-ptest.ll +++ b/llvm/test/CodeGen/AArch64/sve-ptest.ll @@ -7,10 +7,8 @@ define i32 @fcmpeq_nxv4f32( %pg, %a, %b) { ; CHECK-LABEL: fcmpeq_nxv4f32: ; CHECK: // %bb.0: -; CHECK-NEXT: ptrue p1.s -; CHECK-NEXT: and p1.b, p0/z, p0.b, p1.b -; CHECK-NEXT: fcmeq p0.s, p0/z, z0.s, z1.s -; CHECK-NEXT: ptest p1, p0.b +; CHECK-NEXT: fcmeq p1.s, p0/z, z0.s, z1.s +; CHECK-NEXT: ptest p0, p1.b ; CHECK-NEXT: cset w0, ne ; CHECK-NEXT: ret %1 = tail call @llvm.aarch64.sve.fcmpeq.nxv4f32( %pg, %a, %b) @@ -22,10 +20,8 @@ define i32 @fcmpne_nxv4f32( %pg, %a, %b) { ; CHECK-LABEL: fcmpne_nxv4f32: ; CHECK: // %bb.0: -; CHECK-NEXT: ptrue p1.s -; CHECK-NEXT: and p1.b, p0/z, p0.b, p1.b -; CHECK-NEXT: fcmne p0.s, p0/z, z0.s, z1.s -; CHECK-NEXT: ptest p1, p0.b +; CHECK-NEXT: fcmne p1.s, p0/z, z0.s, z1.s +; CHECK-NEXT: ptest p0, p1.b ; CHECK-NEXT: cset w0, ne ; CHECK-NEXT: ret %1 = tail call @llvm.aarch64.sve.fcmpne.nxv4f32( %pg, %a, %b) @@ -37,10 +33,8 @@ define i32 @fcmpge_nxv4f32( %pg, %a, %b) { ; CHECK-LABEL: fcmpge_nxv4f32: ; CHECK: // %bb.0: -; CHECK-NEXT: ptrue p1.s -; CHECK-NEXT: and p1.b, p0/z, p0.b, p1.b -; CHECK-NEXT: fcmge p0.s, p0/z, z0.s, z1.s -; CHECK-NEXT: ptest p1, p0.b +; CHECK-NEXT: fcmge p1.s, p0/z, z0.s, z1.s +; CHECK-NEXT: ptest p0, p1.b ; CHECK-NEXT: cset w0, ne ; CHECK-NEXT: ret %1 = tail call @llvm.aarch64.sve.fcmpge.nxv4f32( %pg, %a, %b) @@ -52,10 +46,8 @@ define i32 @fcmpgt_nxv4f32( %pg, %a, %b) { ; CHECK-LABEL: fcmpgt_nxv4f32: ; CHECK: // %bb.0: -; CHECK-NEXT: ptrue p1.s -; CHECK-NEXT: and p1.b, p0/z, p0.b, p1.b -; CHECK-NEXT: fcmgt p0.s, p0/z, z0.s, z1.s -; CHECK-NEXT: ptest p1, p0.b +; CHECK-NEXT: fcmgt p1.s, p0/z, z0.s, z1.s +; CHECK-NEXT: ptest p0, p1.b ; CHECK-NEXT: cset w0, ne ; CHECK-NEXT: ret %1 = tail call @llvm.aarch64.sve.fcmpgt.nxv4f32( %pg, %a, %b) @@ -67,10 +59,8 @@ define i32 @fcmpuo_nxv4f32( %pg, %a, %b) { ; CHECK-LABEL: fcmpuo_nxv4f32: ; CHECK: // %bb.0: -; CHECK-NEXT: ptrue p1.s -; CHECK-NEXT: and p1.b, p0/z, p0.b, p1.b -; CHECK-NEXT: fcmuo p0.s, p0/z, z0.s, z1.s -; CHECK-NEXT: ptest p1, p0.b +; CHECK-NEXT: fcmuo p1.s, p0/z, z0.s, z1.s +; CHECK-NEXT: ptest p0, p1.b ; CHECK-NEXT: cset w0, ne ; CHECK-NEXT: ret %1 = tail call @llvm.aarch64.sve.fcmpuo.nxv4f32( %pg, %a, %b)