[PATCH] D75467: [instcombine] remove fsub to fneg hacks; only emit fneg

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 10 07:32:20 PDT 2020


spatel added inline comments.


================
Comment at: llvm/include/llvm/IR/PatternMatch.h:622
 inline bind_ty<Instruction> m_Instruction(Instruction *&I) { return I; }
 /// Match a binary operator, capturing it if we match.
+inline bind_ty<UnaryOperator> m_UnOp(UnaryOperator *&I) { return I; }
----------------
Match a binary -> Match a unary


================
Comment at: llvm/include/llvm/IR/PatternMatch.h:802-803
+
+  // The evaluation order is always stable, regardless of Commutability.
+  // The LHS is always matched first.
+  AnyUnaryOp_match(const OP_t &X) : X(X) {}
----------------
The copied comment doesn't make sense for a unary op; there's no commutability/LHS here.


================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp:379
 
+  // TODO de-duplicate binary and unary matches cmatchers with n-ary matching
+  UnaryOperator *UO;
----------------
typo: cmatchers?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D75467/new/

https://reviews.llvm.org/D75467





More information about the llvm-commits mailing list