<div dir="ltr">Mixed types aren't allowed. They are checked for in VerifySDNode in SelectionDAG.cpp and will fail an asserts build.<br><br clear="all"><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature">~Craig</div></div><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Jul 7, 2020 at 8:25 AM Krzysztof Parzyszek via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">The problem can happen when you want to build a vector of i8, but i8 itself is not legal on your target.  All operands to BUILD_VECTOR will be legalized to the next legal integer type, so you can end up with a BUILD_VECTOR of vNi8 where all operands are i32, for example.<br>
<br>
Actual mixed types are less likely to happen, but if you are doing your own target-specific lowering, you can end up with mixed types, simply because your code doesn't have to make them all the same.<br>
<br>
--<br>
Krzysztof Parzyszek  <a href="mailto:kparzysz@quicinc.com" target="_blank">kparzysz@quicinc.com</a>   AI tools development<br>
<br>
> -----Original Message-----<br>
> From: Cameron McInally <<a href="mailto:cameron.mcinally@nyu.edu" target="_blank">cameron.mcinally@nyu.edu</a>><br>
> Sent: Tuesday, July 7, 2020 10:10 AM<br>
> To: Krzysztof Parzyszek <<a href="mailto:kparzysz@quicinc.com" target="_blank">kparzysz@quicinc.com</a>><br>
> Cc: <a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
> Subject: [EXT] Re: [llvm-dev] BUILD_VECTOR disambiguation<br>
><br>
> Thanks for the clarification. The `except` seemed dangling to me, but it's<br>
> early here.<br>
><br>
> Just curious... how do we end up with a mixed type BUILD_VECTOR?<br>
> That's counterintuitive.<br>
><br>
> On Tue, Jul 7, 2020 at 10:58 AM Krzysztof Parzyszek via llvm-dev <llvm-<br>
> <a href="mailto:dev@lists.llvm.org" target="_blank">dev@lists.llvm.org</a>> wrote:<br>
> ><br>
> > Mixed integer types are ok, but the values will get truncated to the<br>
> element type of the output value.  It's pretty much what the comment says.<br>
> ><br>
> > --<br>
> > Krzysztof Parzyszek  <a href="mailto:kparzysz@quicinc.com" target="_blank">kparzysz@quicinc.com</a>   AI tools development<br>
> ><br>
> > > -----Original Message-----<br>
> > > From: llvm-dev <<a href="mailto:llvm-dev-bounces@lists.llvm.org" target="_blank">llvm-dev-bounces@lists.llvm.org</a>> On Behalf Of<br>
> > > Cameron McInally via llvm-dev<br>
> > > Sent: Tuesday, July 7, 2020 9:53 AM<br>
> > > To: LLVM Developers Mailing List <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>><br>
> > > Subject: [EXT] [llvm-dev] BUILD_VECTOR disambiguation<br>
> > ><br>
> > > Hey devs,<br>
> > ><br>
> > > From ISDOpcodes.h...<br>
> > ><br>
> > > /// BUILD_VECTOR(ELT0, ELT1, ELT2, ELT3,...) - Return a fixed-width<br>
> > > vector /// with the specified, possibly variable, elements. The<br>
> > > number of elements /// is required to be a power of two. The types<br>
> > > of the operands must all be /// the same and must match the vector<br>
> > > element type, except that integer types /// are allowed to be larger<br>
> > > than the element type, in which case the operands /// are implicitly<br>
> truncated.<br>
> > > BUILD_VECTOR,<br>
> > ><br>
> > > Must the operand types always be the same? Or could we see a<br>
> > > BUILD_VECTOR with mixed integer types? E.g.:<br>
> > ><br>
> > > BUILD_VECTOR(i32, i32, i64, i32)<br>
> > ><br>
> > > Thanks,<br>
> > > Cam<br>
_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
</blockquote></div>