[PATCH] D55787: [X86] Use UADDSAT/USUBSAT instead of ADDUS/SUBUS

Simon Pilgrim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 17 23:49:26 PST 2018


RKSimon added inline comments.


================
Comment at: test/CodeGen/X86/uadd_sat_vec.ll:614
+;
+; AVX512-LABEL: v16i1:
+; AVX512:       # %bb.0:
----------------
craig.topper wrote:
> nikic wrote:
> > This expansion is pretty crazy...
> Yeah I wouldn't expect vXi1 to be good, but this is even worse than I imagined. Its definitely being scalarized and then promoted. But the scalarization looks weird. But I'm not sure how much we care.
> 
> We can pretty easily replace with vXi1 ADDUSAT with OR X,Y and SUBUSAT with X & ~Y if we care.
You can either add vXi1 handling to LowerUADDSAT_USUBSAT in a similar way to LowerADD_SUB or you can add a DAGCombine transform just to convert them - I don't think we're losing any info converting to bool logic ops?


================
Comment at: test/CodeGen/X86/usub_sat_vec.ll:2
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
+; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+sse2 | FileCheck %s --check-prefix=SSE --check-prefix=SSE2
+; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+ssse3 | FileCheck %s --check-prefix=SSE --check-prefix=SSSE3
----------------
Might as well use --check-prefixes
```
--check-prefixes=SSE,SSE2
```


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

https://reviews.llvm.org/D55787





More information about the llvm-commits mailing list