[GlobalISel] Fix an assertion failure in matchHoistLogicOpWithSameOpcodeHands().
authorAmara Emerson <amara@apple.com>
Sun, 26 Feb 2023 23:42:57 +0000 (15:42 -0800)
committerAmara Emerson <amara@apple.com>
Sun, 26 Feb 2023 23:42:57 +0000 (15:42 -0800)
commit4bc6434624222a846115f3bed826c75e5d0bb613
tree3048aebb1aa270c235136b3df3237bdc407f6872
parent0303eafcb34647f7d5a4015aad266b5766f5dc5e
[GlobalISel] Fix an assertion failure in matchHoistLogicOpWithSameOpcodeHands().

We use this combine in the AArch64 postlegalizer combiner, which causes this
function to query the legalizer rules for the action for an invalid opcode/type
combination (G_AND and p0). Moving the legalizer query until after the validity
check in matchHoistLogicOpWithSameOpcodeHands() fixes this.
llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp
llvm/test/CodeGen/AArch64/GlobalISel/postlegalizer-combiner-sameopcode-hands-crash.mir [new file with mode: 0644]