[PATCH] D39726: [X86] Attempt to match multiple binary reduction ops at once. NFCI

Simon Pilgrim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Nov 11 10:16:47 PST 2017


RKSimon added a comment.

Thanks Andrea



================
Comment at: lib/Target/X86/X86ISelLowering.cpp:30119-30126
+    // Match against one of the candidate binary ops.
+    if (i == 0) {
+      if (llvm::none_of(CandidateBinOps, [Op](ISD::NodeType BinOp) {
+            return Op.getOpcode() == BinOp;
+          }))
+        return SDValue();
+      CandidateBinOp = Op.getOpcode();
----------------
andreadb wrote:
> If you want, you can move this check outside of the loop. The value of CandidateBinOp is only set by the first iteration of the loop, based on node `Op`.
> If you decide to move the check before the loop, then the check for `Op.getOpcode() != CandidateBinOp` can be moved at around line 30140 (i.e. after the block of code that sets the Op for the next stage).
> If you decide to move the check before the loop, then the check for Op.getOpcode() != CandidateBinOp can be moved at around line 30140 (i.e. after the block of code that sets the Op for the next stage).

This bit I'm not going to do as Op doesn't have to match BinOp on the last loop - its's easier to leave the existing test at the start of the loop.


Repository:
  rL LLVM

https://reviews.llvm.org/D39726





More information about the llvm-commits mailing list