[PATCH] D134277: [RISCV][test] Combining comparison and logic ops. #17574
Craig Topper via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Sep 21 17:46:28 PDT 2022
craig.topper added inline comments.
================
Comment at: llvm/test/CodeGen/RISCV/zbb-cmp-combine.ll:6
+; RUN: | FileCheck %s --check-prefixes=CHECK,CHECK-RV64IF
+; Tests aimed to check oprimization which combines
+; two comparison operations and logic operation into
----------------
oprimization -> optimization
================
Comment at: llvm/test/CodeGen/RISCV/zbb-cmp-combine.ll:241
+; CHECK-RV64IF-NEXT: ret
+ %l0 = fcmp ult float %a, %c
+ %l1 = fcmp ult float %b, %c
----------------
I don't think this is correct for FP. "fcmp ult" returns true if either operand is a nan. fmin will return a non-nan input unless both are nan. So for this code, if %a is nan, %b and %c are non-nan the original code returned true. But the rewritten code will only compare %b and %c and ignore %a.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D134277/new/
https://reviews.llvm.org/D134277
More information about the llvm-commits
mailing list