[PATCH] D97360: [TTI] Consider select form of and/or i1 as having arithmetic cost
    Sanjay Patel via Phabricator via llvm-commits 
    llvm-commits at lists.llvm.org
       
    Mon Mar  1 07:39:34 PST 2021
    
    
  
spatel added a comment.
I can't tell from the tests (so we should probably add at least 1 to confirm) - do we expect the same behavior for vector types?
================
Comment at: llvm/include/llvm/Analysis/TargetTransformInfoImpl.h:997
+      const Value *Op0, *Op1;
+      if (match(U, m_LogicalAnd(m_Value(Op0), m_Value(Op1))) ||
+          match(U, m_LogicalOr(m_Value(Op0), m_Value(Op1)))) {
----------------
It would be nice to have a code comment here to show the expected patterns:
  // select x, y, false --> x & y
  // select x, true, y --> x | y
Repository:
  rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D97360/new/
https://reviews.llvm.org/D97360
    
    
More information about the llvm-commits
mailing list