This is an archive of the discontinued LLVM Phabricator instance.

[RISCV] Fix a codegen crash in getSetCCResultType
ClosedPublic

Authored by frasercrmck on Jan 26 2021, 3:52 AM.

Details

Summary

This patch fixes some crashes coming from
RISCVISelLowering::getSetCCResultType, which would occasionally return
an EVT constructed from an invalid MVT, which has a null Type pointer.

The attached test shows this happening currently for some fixed-length
vectors, which hit this issue when the V extension was enabled, even
though they're not legal types under the V extension. The fix was also
pre-emptively extended to scalable vectors which can't be represented as
an MVT, even though a test case couldn't be found for them.

Diff Detail