[llvm] 90cb5f2 - [RISCV] Add +xventanacondops command line to select-binop-identity.ll. NFC
Craig Topper via llvm-commits
llvm-commits at lists.llvm.org
Mon Dec 19 19:17:35 PST 2022
Author: Craig Topper
Date: 2022-12-19T19:12:39-08:00
New Revision: 90cb5f2fc8dc25ba34a980254f471d991a65350d
URL: https://github.com/llvm/llvm-project/commit/90cb5f2fc8dc25ba34a980254f471d991a65350d
DIFF: https://github.com/llvm/llvm-project/commit/90cb5f2fc8dc25ba34a980254f471d991a65350d.diff
LOG: [RISCV] Add +xventanacondops command line to select-binop-identity.ll. NFC
Added:
Modified:
llvm/test/CodeGen/RISCV/select-binop-identity.ll
Removed:
################################################################################
diff --git a/llvm/test/CodeGen/RISCV/select-binop-identity.ll b/llvm/test/CodeGen/RISCV/select-binop-identity.ll
index f9a9c2c05d53..3d3cdd78cbf3 100644
--- a/llvm/test/CodeGen/RISCV/select-binop-identity.ll
+++ b/llvm/test/CodeGen/RISCV/select-binop-identity.ll
@@ -5,6 +5,8 @@
; RUN: | FileCheck -check-prefix=RV64I %s
; RUN: llc -mtriple=riscv64 -mcpu=sifive-u74 -verify-machineinstrs < %s \
; RUN: | FileCheck -check-prefix=SFB64 %s
+; RUN: llc -mtriple=riscv64 -mattr=+xventanacondops -verify-machineinstrs < %s \
+; RUN: | FileCheck -check-prefix=CONDOPS64 %s
; InstCombine canonicalizes (c ? x | y : x) to (x | (c ? y : 0)) similar for
; other binary operations using their identity value as the constant.
@@ -35,6 +37,15 @@ define signext i32 @and_select_all_ones_i32(i1 zeroext %c, i32 signext %x, i32 s
; SFB64-NEXT: .LBB0_2:
; SFB64-NEXT: mv a0, a2
; SFB64-NEXT: ret
+;
+; CONDOPS64-LABEL: and_select_all_ones_i32:
+; CONDOPS64: # %bb.0:
+; CONDOPS64-NEXT: li a3, -1
+; CONDOPS64-NEXT: vt.maskcn a3, a3, a0
+; CONDOPS64-NEXT: vt.maskc a0, a1, a0
+; CONDOPS64-NEXT: or a0, a0, a3
+; CONDOPS64-NEXT: and a0, a0, a2
+; CONDOPS64-NEXT: ret
%a = select i1 %c, i32 %x, i32 -1
%b = and i32 %a, %y
ret i32 %b
@@ -65,6 +76,15 @@ define i64 @and_select_all_ones_i64(i1 zeroext %c, i64 %x, i64 %y) {
; SFB64-NEXT: .LBB1_2:
; SFB64-NEXT: mv a0, a2
; SFB64-NEXT: ret
+;
+; CONDOPS64-LABEL: and_select_all_ones_i64:
+; CONDOPS64: # %bb.0:
+; CONDOPS64-NEXT: vt.maskcn a1, a1, a0
+; CONDOPS64-NEXT: li a3, -1
+; CONDOPS64-NEXT: vt.maskc a0, a3, a0
+; CONDOPS64-NEXT: or a0, a0, a1
+; CONDOPS64-NEXT: and a0, a2, a0
+; CONDOPS64-NEXT: ret
%a = select i1 %c, i64 -1, i64 %x
%b = and i64 %y, %a
ret i64 %b
@@ -93,6 +113,12 @@ define signext i32 @or_select_all_zeros_i32(i1 zeroext %c, i32 signext %x, i32 s
; SFB64-NEXT: .LBB2_2:
; SFB64-NEXT: mv a0, a2
; SFB64-NEXT: ret
+;
+; CONDOPS64-LABEL: or_select_all_zeros_i32:
+; CONDOPS64: # %bb.0:
+; CONDOPS64-NEXT: vt.maskc a0, a1, a0
+; CONDOPS64-NEXT: or a0, a2, a0
+; CONDOPS64-NEXT: ret
%a = select i1 %c, i32 %x, i32 0
%b = or i32 %y, %a
ret i32 %b
@@ -123,6 +149,12 @@ define i64 @or_select_all_zeros_i64(i1 zeroext %c, i64 %x, i64 %y) {
; SFB64-NEXT: .LBB3_2:
; SFB64-NEXT: mv a0, a2
; SFB64-NEXT: ret
+;
+; CONDOPS64-LABEL: or_select_all_zeros_i64:
+; CONDOPS64: # %bb.0:
+; CONDOPS64-NEXT: vt.maskcn a0, a1, a0
+; CONDOPS64-NEXT: or a0, a0, a2
+; CONDOPS64-NEXT: ret
%a = select i1 %c, i64 0, i64 %x
%b = or i64 %a, %y
ret i64 %b
@@ -151,6 +183,12 @@ define signext i32 @xor_select_all_zeros_i32(i1 zeroext %c, i32 signext %x, i32
; SFB64-NEXT: .LBB4_2:
; SFB64-NEXT: mv a0, a2
; SFB64-NEXT: ret
+;
+; CONDOPS64-LABEL: xor_select_all_zeros_i32:
+; CONDOPS64: # %bb.0:
+; CONDOPS64-NEXT: vt.maskcn a0, a1, a0
+; CONDOPS64-NEXT: xor a0, a2, a0
+; CONDOPS64-NEXT: ret
%a = select i1 %c, i32 0, i32 %x
%b = xor i32 %y, %a
ret i32 %b
@@ -181,6 +219,12 @@ define i64 @xor_select_all_zeros_i64(i1 zeroext %c, i64 %x, i64 %y) {
; SFB64-NEXT: .LBB5_2:
; SFB64-NEXT: mv a0, a2
; SFB64-NEXT: ret
+;
+; CONDOPS64-LABEL: xor_select_all_zeros_i64:
+; CONDOPS64: # %bb.0:
+; CONDOPS64-NEXT: vt.maskc a0, a1, a0
+; CONDOPS64-NEXT: xor a0, a0, a2
+; CONDOPS64-NEXT: ret
%a = select i1 %c, i64 %x, i64 0
%b = xor i64 %a, %y
ret i64 %b
@@ -209,6 +253,12 @@ define signext i32 @add_select_all_zeros_i32(i1 zeroext %c, i32 signext %x, i32
; SFB64-NEXT: .LBB6_2:
; SFB64-NEXT: mv a0, a2
; SFB64-NEXT: ret
+;
+; CONDOPS64-LABEL: add_select_all_zeros_i32:
+; CONDOPS64: # %bb.0:
+; CONDOPS64-NEXT: vt.maskcn a0, a1, a0
+; CONDOPS64-NEXT: addw a0, a2, a0
+; CONDOPS64-NEXT: ret
%a = select i1 %c, i32 0, i32 %x
%b = add i32 %y, %a
ret i32 %b
@@ -241,6 +291,12 @@ define i64 @add_select_all_zeros_i64(i1 zeroext %c, i64 %x, i64 %y) {
; SFB64-NEXT: .LBB7_2:
; SFB64-NEXT: mv a0, a2
; SFB64-NEXT: ret
+;
+; CONDOPS64-LABEL: add_select_all_zeros_i64:
+; CONDOPS64: # %bb.0:
+; CONDOPS64-NEXT: vt.maskc a0, a1, a0
+; CONDOPS64-NEXT: add a0, a0, a2
+; CONDOPS64-NEXT: ret
%a = select i1 %c, i64 %x, i64 0
%b = add i64 %a, %y
ret i64 %b
@@ -269,6 +325,12 @@ define signext i32 @sub_select_all_zeros_i32(i1 zeroext %c, i32 signext %x, i32
; SFB64-NEXT: .LBB8_2:
; SFB64-NEXT: mv a0, a2
; SFB64-NEXT: ret
+;
+; CONDOPS64-LABEL: sub_select_all_zeros_i32:
+; CONDOPS64: # %bb.0:
+; CONDOPS64-NEXT: vt.maskcn a0, a1, a0
+; CONDOPS64-NEXT: subw a0, a2, a0
+; CONDOPS64-NEXT: ret
%a = select i1 %c, i32 0, i32 %x
%b = sub i32 %y, %a
ret i32 %b
@@ -301,6 +363,12 @@ define i64 @sub_select_all_zeros_i64(i1 zeroext %c, i64 %x, i64 %y) {
; SFB64-NEXT: .LBB9_2:
; SFB64-NEXT: mv a0, a2
; SFB64-NEXT: ret
+;
+; CONDOPS64-LABEL: sub_select_all_zeros_i64:
+; CONDOPS64: # %bb.0:
+; CONDOPS64-NEXT: vt.maskc a0, a1, a0
+; CONDOPS64-NEXT: sub a0, a2, a0
+; CONDOPS64-NEXT: ret
%a = select i1 %c, i64 %x, i64 0
%b = sub i64 %y, %a
ret i64 %b
More information about the llvm-commits
mailing list