[PATCH] D113371: [X86] combinePMULH - recognise 'cheap' trunctions via PACKS/PACKUS as well as SEXT/ZEXT
    Roman Lebedev via Phabricator via llvm-commits 
    llvm-commits at lists.llvm.org
       
    Sun Nov  7 14:10:05 PST 2021
    
    
  
lebedev.ri added inline comments.
================
Comment at: llvm/lib/Target/X86/X86ISelLowering.cpp:48325-48327
+    unsigned NumBits = V.getScalarValueSizeInBits();
+    unsigned NumSignBits = DAG.ComputeNumSignBits(V);
+    return (NumSignBits + 16) > NumBits;
----------------
Can you mirror rG61225c081858efe55dfc7051b338c797fab07cff and introduce `DAG.ComputeMinSignedBits()`?
Then this becomes an obvious `return DAG.ComputeMinSignedBits() <= 16;`
================
Comment at: llvm/lib/Target/X86/X86ISelLowering.cpp:48331
+    KnownBits Known = DAG.computeKnownBits(V);
+    return (Known.countMinLeadingZeros() + 16) >= Known.getBitWidth();
+  };
----------------
`return Known.countMaxActiveBits() <= 16;`
Repository:
  rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D113371/new/
https://reviews.llvm.org/D113371
    
    
More information about the llvm-commits
mailing list