Skip to content

Commit 044d40e

Browse files
committed
AMDGPU/GlobalISel: Move lambdas to normal function
These aren't using any local state
1 parent 1b978dd commit 044d40e

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,20 @@ static LegalityPredicate isWideScalarTruncStore(unsigned TypeIdx) {
178178
};
179179
}
180180

181+
static LegalityPredicate smallerThan(unsigned TypeIdx0, unsigned TypeIdx1) {
182+
return [=](const LegalityQuery &Query) {
183+
return Query.Types[TypeIdx0].getSizeInBits() <
184+
Query.Types[TypeIdx1].getSizeInBits();
185+
};
186+
}
187+
188+
static LegalityPredicate greaterThan(unsigned TypeIdx0, unsigned TypeIdx1) {
189+
return [=](const LegalityQuery &Query) {
190+
return Query.Types[TypeIdx0].getSizeInBits() >
191+
Query.Types[TypeIdx1].getSizeInBits();
192+
};
193+
};
194+
181195
AMDGPULegalizerInfo::AMDGPULegalizerInfo(const GCNSubtarget &ST_,
182196
const GCNTargetMachine &TM)
183197
: ST(ST_) {
@@ -647,20 +661,6 @@ AMDGPULegalizerInfo::AMDGPULegalizerInfo(const GCNSubtarget &ST_,
647661
.scalarize(0);
648662
}
649663

650-
auto smallerThan = [](unsigned TypeIdx0, unsigned TypeIdx1) {
651-
return [=](const LegalityQuery &Query) {
652-
return Query.Types[TypeIdx0].getSizeInBits() <
653-
Query.Types[TypeIdx1].getSizeInBits();
654-
};
655-
};
656-
657-
auto greaterThan = [](unsigned TypeIdx0, unsigned TypeIdx1) {
658-
return [=](const LegalityQuery &Query) {
659-
return Query.Types[TypeIdx0].getSizeInBits() >
660-
Query.Types[TypeIdx1].getSizeInBits();
661-
};
662-
};
663-
664664
getActionDefinitionsBuilder(G_INTTOPTR)
665665
// List the common cases
666666
.legalForCartesianProduct(AddrSpaces64, {S64})

0 commit comments

Comments
 (0)