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

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 18 03:39:10 PST 2018


nikic marked 5 inline comments as done.
nikic added inline comments.


================
Comment at: test/CodeGen/X86/uadd_sat_vec.ll:614
+;
+; AVX512-LABEL: v16i1:
+; AVX512:       # %bb.0:
----------------
RKSimon wrote:
> 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?
I've handled this in LowerUADDSAT_USUBSAT for now, with the suggested OR and AND+NOT expansions. If/when we move the X86 ADDUS/SUBUS combines into generic DAGCombine we can move this one as well.


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

https://reviews.llvm.org/D55787





More information about the llvm-commits mailing list