[llvm] [RISCV] Add a check in lowerSELECT after foldBinOpIntoSelectIfProfitable (PR #97391)

Yingwei Zheng via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 2 01:37:19 PDT 2024


================
@@ -58,3 +58,15 @@ entry:
   %res = sub i64 2, %select_
   ret i64 %res
 }
+
+define i64 @fold_binop_into_select_return_constant(i1 %c) {
----------------
dtcxzyw wrote:

Please make sure that this function cannot be folded by middle-end.
See: https://godbolt.org/z/h1M7frG4j


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


More information about the llvm-commits mailing list