ISLE: simplify select/bitselect when both choices are the same (#6141)

This commit is contained in:
Karl Meakin
2023-04-11 23:41:19 +01:00
committed by GitHub
parent b9a58148cf
commit c0166f78f9
2 changed files with 18 additions and 0 deletions

View File

@@ -5,6 +5,20 @@ target aarch64
target s390x
target riscv64
function %select_self(i8, i32) -> i32 {
block0(v0: i8, v1: i32):
v2 = select v0, v1, v1
return v2
; check: return v1
}
function %bitselect_self(i32, i32) -> i32 {
block0(v0: i32, v1: i32):
v2 = bitselect v0, v1, v1
return v2
; check: return v1
}
function %select_sgt_to_smax(i32, i32) -> i32 {
block0(v0: i32, v1: i32):
v2 = icmp sgt v0, v1