[llvm-dev] how to type-legalize a dag

Rail Shafigulin via llvm-dev llvm-dev at lists.llvm.org
Tue Mar 15 15:48:51 PDT 2016


On Tue, Mar 15, 2016 at 2:21 PM, Krzysztof Parzyszek via llvm-dev <
llvm-dev at lists.llvm.org> wrote:

> On 3/15/2016 4:16 PM, Rail Shafigulin via llvm-dev wrote:
>
>> Below is the output of llc with a -debug-only=isel. As you could see the
>> output type for load, store, and add changes from v4i32 to i32 during
>> legalization. How can I preserve the output type to v4i32?
>>
>
> Make sure that there is a register class associated with v4i32.
>
> See TargetLoweringBase::addRegisterClass. It's generally called in
> <target>ISelLowering.cpp.
>
> -Krzysztof
>
> --
> Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted
> by The Linux Foundation
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>

I'd like to ask you another question (if you don't mind). My
EsenciaISelLowering.cpp contains the following code in the
EsenciaTargetLowering class constructor:

  setOperationAction(ISD::BR_CC,             MVT::i32, Custom);
  setOperationAction(ISD::BR_CC,             MVT::f32, Custom);
  setOperationAction(ISD::BR_JT,             MVT::Other, Expand);
  setOperationAction(ISD::BRCOND,            MVT::Other, Expand);
  setOperationAction(ISD::SETCC,             MVT::i32, Expand);
  setOperationAction(ISD::SETCC,             MVT::f32, Expand);
  setOperationAction(ISD::SELECT,            MVT::i32, Expand);
  setOperationAction(ISD::SELECT,            MVT::f32, Expand);
  setOperationAction(ISD::SELECT_CC,         MVT::i32, Custom);
  setOperationAction(ISD::SELECT_CC,         MVT::f32, Custom);

I sort of have an intuition what it is doing, but quite nail it.Do you mind
explaining it? Also I didn't add any of the setOperationAction for the
MVT::v4i32 and my simple test case worked. How come?


-- 
Rail Shafigulin
Software Engineer
Esencia Technologies
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160315/ae99c2cc/attachment.html>


More information about the llvm-dev mailing list