[PATCH] D63255: [ARM] Select MVE add and sub

Dave Green via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 18 06:28:49 PDT 2019


dmgreen added a comment.

Hello. This is probably dependent upon at least some of the uncommitted MVE instructions being added (I haven't checked if add/sub are in tree yet).

If by confusing you are referring to the changes in lib/Target/ARM/ARMISelLowering.cpp, then yes I can see that. Essentially I am breaking things so that we can work from the position that most targets are usually in - the default set of instructions are legal and we choose specific ones to mark as legal or not legal. As opposed to what the code was previously doing - marking all instructions as expand. No one will be using the MVE instructions yet (and the compiler shouldn't generate them until we enable that), so it's probably fine to not have this as 100% working at the moment.

Our downstream version looks something like this, as an illustration:

  for (auto VT : iTypes) {
    addRegisterClass(VT, &ARM::QPRRegClass);
    setOperationAction(ISD::VECTOR_SHUFFLE, VT, Custom);
    setOperationAction(ISD::INSERT_VECTOR_ELT, VT, Custom);
    setOperationAction(ISD::EXTRACT_VECTOR_ELT, VT, Custom);
    setOperationAction(ISD::BUILD_VECTOR, VT, Custom);
    setOperationAction(ISD::MLOAD, VT, Legal);
    setOperationAction(ISD::MSTORE, VT, Legal);
    setOperationAction(ISD::MGATHER, VT, Legal);
    setOperationAction(ISD::SETCC, VT, Custom);
    setOperationAction(ISD::SHL, VT, Custom);
    setOperationAction(ISD::SRA, VT, Custom);
    setOperationAction(ISD::SRL, VT, Custom);
    setOperationAction(ISD::SIGN_EXTEND_INREG, VT, Legal);
    setOperationAction(ISD::ABS, VT, Legal);
  
    // No native support for these.
    setOperationAction(ISD::UDIV, VT, Expand);
    setOperationAction(ISD::SDIV, VT, Expand);
    setOperationAction(ISD::UREM, VT, Expand);
    setOperationAction(ISD::SREM, VT, Expand);
  
    // Pre and Post inc are supported
    for (unsigned im = (unsigned)ISD::PRE_INC;
         im != (unsigned)ISD::LAST_INDEXED_MODE; ++im) {
      setIndexedLoadAction(im, VT, Legal);
      setIndexedStoreAction(im, VT, Legal);
    }
  }

I can change it to only mark the current supported set of nodes as legal if you things that's better.  Eventually we will probably want to remove the `for (every opcode) setOperationAction(Opc, VT, Expand);` loops.


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

https://reviews.llvm.org/D63255





More information about the llvm-commits mailing list