[PATCH] D156748: [RISCV] Add no NaN support to lowerFMAXIMUM_FMINIMUM.
Yeting Kuo via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Jul 31 20:09:48 PDT 2023
fakepaper56 accepted this revision.
fakepaper56 added a comment.
This revision is now accepted and ready to land.
LGTM.
================
Comment at: llvm/lib/Target/RISCV/RISCVISelLowering.cpp:4659
+ SDValue NewX, NewY;
+ if (Op->getFlags().hasNoNaNs() || DAG.isKnownNeverNaN(X)) {
+ NewY = Y;
----------------
How about to initialize `NewY` as `Y` and assign it to select node if `Op->getFlags().hasNoNaNs() || DAG.isKnownNeverNaN(X)` like,
```
SDValue NewY = Y;
if (Op->getFlags().hasNoNaNs() || DAG.isKnownNeverNaN(X)) {
SDValue XIsNonNan = DAG.getSetCC(DL, XLenVT, X, X, ISD::SETOEQ);
NewY = DAG.getSelect(DL, VT, XIsNonNan, Y, X);
}
```
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D156748/new/
https://reviews.llvm.org/D156748
More information about the llvm-commits
mailing list