[llvm] r193677 - Revert "SelectionDAG: Teach the legalizer to split SETCC if VSELECT needs splitting too."

Richard Sandiford rsandifo at linux.vnet.ibm.com
Thu Oct 31 04:47:01 PDT 2013


Juergen Ributzka <juergen at apple.com> writes:
> Hi Richard,
>
> the code hits an assertion in the DAG Type Legalizer. It is one of
> these generic test cases that only fail on the build bots, because
> there is no explicit target defined in the test case. That is also why
> I didn’t catch it earlier when I ran the unit tests locally. You can
> reproduce it by running llc -march systemz
> test/CodeGen/Generic/select.ll with assertions enabled.

Hmm, OK, thanks.  I was testing on a z box, but I must have misapplied
it or something.

> The problem is that getSetCCResultType() always returns a scalar value
> type and sign extend doesn’t like to convert from vector types to
> scalar types (v1i32 -> i32). I did a quick hack to
> getSetCCResultType() in the SystemZ backend, which seems to fix the
> problem. I am not familiar with the SystemZ mainframes, so I am hoping
> you could help me by checking and testing the following change:
>
> virtual EVT getSetCCResultType(LLVMContext &C, EVT VT) const LLVM_OVERRIDE {
>   if (VT.isVector())
>     return EVT::getVectorVT(C, MVT::i32, VT.getVectorNumElements());
>   else
>     return MVT::i32;
> }

Sounds good to me, but it looks like other targets use:

  if (!VT.isVector())
    return MVT::i32;
  return VT.changeVectorElementTypeToInteger();

so maybe we should do the same here for consistency.

All vector types get scalarised on z, so I suppose the right answer
is whatever the type legaliser expects us to return.

Thanks,
Richard





More information about the llvm-commits mailing list