This is an archive of the discontinued LLVM Phabricator instance.

[CodeGen] Fix nullptr crash in tryConvertSVEWideCompare
ClosedPublic

Authored by david-arm on Jun 4 2020, 8:13 AM.

Details

Summary

When the input to a wide compare instruction is a DUP or SPLAT_VECTOR
node we should be deal with cases where the DUP/SPLAT_VECTOR input
operand is not an immediate value. I've fixed the code to return
SDValue() in such cases and added a couple of tests - one each to
represent the signed and unsigned cases.

Diff Detail

Event Timeline

david-arm created this revision.Jun 4 2020, 8:13 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 4 2020, 8:13 AM
This revision is now accepted and ready to land.Jun 8 2020, 7:05 AM
sdesmalen added inline comments.Jun 8 2020, 7:23 AM
llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
11455

Is it better to add the condition && isa<ConstantSDNode>(Comparator.getOperand(0))on line 11366? Then at this point we can just assert(Imm && "Did not find a valid immediate");

This revision was automatically updated to reflect the committed changes.