[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:45:54 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) {
+; CHECK-LABEL: fold_binop_into_select_return_constant:
+; CHECK:       # %bb.0: # %entry
+; CHECK-NEXT:    li a0, 0
+; CHECK-NEXT:    ret
+entry:
----------------
dtcxzyw wrote:

Sorry, I cannot reproduce this crash with a8e1c3e1239604ac787b6a2d39b5278ddec8aa8a.


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


More information about the llvm-commits mailing list