[PATCH] D49837: [SelectionDAG] Handle unary SelectPatternFlavor for ABS case in SelectionDAGBuilder::visitSelect.

Nemanja Ivanovic via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 12 05:19:12 PDT 2019


nemanjai added a comment.

OK, it appears that the PPC issue is really just a phase ordering problem that is quite easy to resolve. We now get the `ISD::ABS` node earlier so we may very well end up in a situation where we need to legalize the result type of such node. So our `Custom` legalization of all vector types can't really work any longer. Applying this in `PPCISelLowering.cpp` should fix the `UNREACHABLE` failure:

  @@ -551,7 +552,9 @@ PPCTargetLowering::PPCTargetLowering(const PPCTarg
         // add/sub are legal for all supported vector VT's.
         setOperationAction(ISD::ADD, VT, Legal);
         setOperationAction(ISD::SUB, VT, Legal);
  -      setOperationAction(ISD::ABS, VT, Custom);
  +      // Custom lowering for legal vector result types.
  +      if (VT.getSizeInBits() == 128)
  +        setOperationAction(ISD::ABS, VT, Custom);
  
         // Vector instructions introduced in P8
         if (Subtarget.hasP8Altivec() && (VT.SimpleTy != MVT::v1i128)) {


Repository:
  rL LLVM

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

https://reviews.llvm.org/D49837





More information about the llvm-commits mailing list