[llvm-branch-commits] [compiler-rt] [llvm] [clang] [libc] [libcxx] [flang] [RISCV] Support select optimization (PR #80124)

Wang Pengcheng via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Thu Feb 1 01:18:31 PST 2024


================
@@ -0,0 +1,873 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
+; RUN: opt -select-optimize -mtriple=riscv64 -S < %s \
+; RUN:   | FileCheck %s --check-prefix=CHECK-SELECT
+; RUN: opt -select-optimize -mtriple=riscv64 -mattr=+enable-select-opt -S < %s \
+; RUN:   | FileCheck %s --check-prefix=CHECK-BRANCH
+; RUN: opt -select-optimize -mtriple=riscv64 -mattr=+enable-select-opt,+predictable-select-expensive -S < %s \
+; RUN:   | FileCheck %s --check-prefix=CHECK-BRANCH
+
+%struct.st = type { i32, i64, ptr, ptr, i16, ptr, ptr, i64, i64 }
+
+; This test has a select at the end of if.then, which is better transformed to a branch on OoO cores.
+
+define void @replace(ptr nocapture noundef %newst, ptr noundef %t, ptr noundef %h, i64 noundef %c, i64 noundef %rc, i64 noundef %ma, i64 noundef %n) {
----------------
wangpc-pp wrote:

Thanks a lot! This methodology of adding ` llvm_unreachable()` is really useful! I have reduced the tests. cc @davemgreen 

https://github.com/llvm/llvm-project/pull/80124


More information about the llvm-branch-commits mailing list