[PATCH] D132837: [ISel] Enable generating more fma instructions.
Jay Foad via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Sep 20 05:59:02 PDT 2022
foad added a comment.
I think the patch looks good now, but I am a little confused by the test changes: one of them now uses fmac instead of mac, and the other uses mad instead of fma.
Also could you add another version of fmac_sequence_innermost_fmul to show that it still works if you swap the operands of the outermost fadd?
================
Comment at: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:14175
+ SDValue TmpFMA = FMA;
+ while (E && TmpFMA && isFusedOp(TmpFMA)) {
+ SDValue FMul = TmpFMA->getOperand(2);
----------------
You don't need to test TmpFMA here. Optionally, this loop could be rewritten as:
```
if (E) {
do {
...
} while (isFusedOp(TmpFMA));
}
```
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D132837/new/
https://reviews.llvm.org/D132837
More information about the llvm-commits
mailing list