Skip to content

Commit c95361e

Browse files
committed
[RISCV][GISel] Remove legalIf from G_ZEXT, G_SEXT, G_ANYEXT.
I think after making G_SEXT_INREG legal this isn't needed. At the very least its not tested anymore. Reviewed By: arsenm Differential Revision: https://reviews.llvm.org/D157678
1 parent 9cf375b commit c95361e

File tree

1 file changed

+1
-22
lines changed

1 file changed

+1
-22
lines changed

llvm/lib/Target/RISCV/GISel/RISCVLegalizerInfo.cpp

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -44,29 +44,8 @@ RISCVLegalizerInfo::RISCVLegalizerInfo(const RISCVSubtarget &ST) {
4444
.clampScalar(1, XLenLLT, XLenLLT)
4545
.clampScalar(0, XLenLLT, XLenLLT);
4646

47-
// Extensions
48-
auto ExtLegalFunc = [=](const LegalityQuery &Query) {
49-
unsigned DstSize = Query.Types[0].getSizeInBits();
50-
51-
// Make sure that we have something that will fit in a register, and
52-
// make sure it's a power of 2.
53-
if (DstSize < 8 || DstSize > XLen || !isPowerOf2_32(DstSize))
54-
return false;
55-
56-
const LLT SrcTy = Query.Types[1];
57-
58-
// Make sure we fit in a register otherwise. Don't bother checking that
59-
// the source type is below 2 * XLen bits. We shouldn't be allowing anything
60-
// through which is wider than the destination in the first place.
61-
unsigned SrcSize = SrcTy.getSizeInBits();
62-
if (SrcSize < 8 || !isPowerOf2_32(SrcSize))
63-
return false;
64-
65-
return true;
66-
};
6747
getActionDefinitionsBuilder({G_ZEXT, G_SEXT, G_ANYEXT})
68-
.legalIf(ExtLegalFunc)
69-
.clampScalar(0, XLenLLT, XLenLLT);
48+
.maxScalar(0, XLenLLT);
7049

7150
getActionDefinitionsBuilder(G_SEXT_INREG)
7251
.legalFor({XLenLLT})

0 commit comments

Comments
 (0)