Skip to content

Commit

Permalink
[RISCV] Move NodeExtensionHelper assert to getOrCreateExtendedOp. NFC
Browse files Browse the repository at this point in the history
Move the narrow types assert from the ZERO_EXTEND/SIGN_EXTEND case in
fillUpExtensionSupport to getOrCreateExtendedOp so we check the other nodes
too.
  • Loading branch information
lukel97 committed Mar 11, 2024
1 parent d3ec8c2 commit 0ef61ed
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions llvm/lib/Target/RISCV/RISCVISelLowering.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13490,6 +13490,7 @@ struct NodeExtensionHelper {
MVT NarrowVT = getNarrowType(Root, *SupportsExt);

SDValue Source = getSource();
assert(Subtarget.getTargetLowering()->isTypeLegal(Source.getValueType()));
if (Source.getValueType() == NarrowVT)
return Source;

Expand Down Expand Up @@ -13657,9 +13658,6 @@ struct NodeExtensionHelper {
unsigned ScalarBits = VT.getScalarSizeInBits();
unsigned NarrowScalarBits = NarrowVT.getScalarSizeInBits();

assert(
Subtarget.getTargetLowering()->isTypeLegal(NarrowElt.getValueType()));

// Ensure the extension's semantic is equivalent to rvv vzext or vsext.
if (ScalarBits != NarrowScalarBits * 2)
break;
Expand Down

0 comments on commit 0ef61ed

Please sign in to comment.