[PATCH] D59006: [x86] improve the default expansion of uaddsat/usubsat

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 21 10:00:21 PDT 2019


nikic added inline comments.


================
Comment at: llvm/lib/Target/X86/X86ISelLowering.cpp:23891
+  SDValue X = Op.getOperand(0);
+  SDValue Y = Op.getOperand(1);
   if (VT.getScalarType() == MVT::i1) {
----------------
RKSimon wrote:
> Move these down inside the "if (VT.is128BitVector())" loop ?
Or also replace the usages in the i1 branch :)


================
Comment at: llvm/lib/Target/X86/X86ISelLowering.cpp:23912
+    if ((VT == MVT::v4i32 && !Subtarget.hasSSE41()) ||
+        (VT == MVT::v2i64 && !Subtarget.hasVLX())) {
+      SDLoc DL(Op);
----------------
Instead of hardcoding specific types and subtargets, maybe check operation legality?

```
if (Op.getOpcode() == ISD::UADDSAT && !TLI.isOperationLegal(ISD::UMIN, VT)) {
    // ...
}
if (Op.getOpcode() == ISD::USUBSAT && !TLI.isOperationLegal(ISD::UMAX, VT)) {
    // ...
}
```


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

https://reviews.llvm.org/D59006





More information about the llvm-commits mailing list