[PATCH] D48467: [X86] Recognize an fnma in the presence of an intervening shuffle.
Simon Pilgrim via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Jun 22 11:46:00 PDT 2018
RKSimon added inline comments.
================
Comment at: lib/Target/X86/X86ISelLowering.cpp:31185
+ return Negate(Op0, Op1);
+}
+
----------------
Please move the isFNEG as a NFC commit
================
Comment at: lib/Target/X86/X86ISelLowering.cpp:31210
+ break;
+ }
+ if (!UsedByFMA)
----------------
Can this be written as a llvm::any_of pattern?
================
Comment at: lib/Target/X86/X86ISelLowering.cpp:31214
+
+ ShuffleVectorSDNode *SVOp = dyn_cast<ShuffleVectorSDNode>(N);
+ auto NegOp0 = isFNEG(N->getOperand(0).getNode());
----------------
Early out if !SVOp || !SVOp->isSplat()
================
Comment at: lib/Target/X86/X86ISelLowering.cpp:31215
+ ShuffleVectorSDNode *SVOp = dyn_cast<ShuffleVectorSDNode>(N);
+ auto NegOp0 = isFNEG(N->getOperand(0).getNode());
+
----------------
Don't use auto for non-obvious (casts etc.) cases.
================
Comment at: lib/Target/X86/X86ISelLowering.cpp:31218
+ if (SVOp && SVOp->isSplat() && NegOp0.getNode() &&
+ N->getOperand(1).isUndef()) {
+ EVT VT = N->getValueType(0);
----------------
Its unlikely that Op1 isn't undef, but if you have cases of this you could handle both ops but testing SVOp->getSplatIndex()
Repository:
rL LLVM
https://reviews.llvm.org/D48467
More information about the llvm-commits
mailing list