mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-23 19:23:23 +01:00
GlobalISel: Add typeIsNot LegalityPredicate
This allows sorting the legal/custom rules first as is recommended
This commit is contained in:
parent
830b971553
commit
c5f936ea9a
@ -218,11 +218,19 @@ Predicate any(Predicate P0, Predicate P1, Args... args) {
|
||||
return any(any(P0, P1), args...);
|
||||
}
|
||||
|
||||
/// True iff the given type index is the specified types.
|
||||
/// True iff the given type index is the specified type.
|
||||
LegalityPredicate typeIs(unsigned TypeIdx, LLT TypesInit);
|
||||
/// True iff the given type index is one of the specified types.
|
||||
LegalityPredicate typeInSet(unsigned TypeIdx,
|
||||
std::initializer_list<LLT> TypesInit);
|
||||
|
||||
/// True iff the given type index is not the specified type.
|
||||
inline LegalityPredicate typeIsNot(unsigned TypeIdx, LLT Type) {
|
||||
return [=](const LegalityQuery &Query) {
|
||||
return Query.Types[TypeIdx] != Type;
|
||||
};
|
||||
}
|
||||
|
||||
/// True iff the given types for the given pair of type indexes is one of the
|
||||
/// specified type pairs.
|
||||
LegalityPredicate
|
||||
|
@ -551,8 +551,8 @@ AMDGPULegalizerInfo::AMDGPULegalizerInfo(const GCNSubtarget &ST_,
|
||||
.legalFor({{PrivatePtr, S32}});
|
||||
|
||||
getActionDefinitionsBuilder(G_GLOBAL_VALUE)
|
||||
.unsupportedFor({PrivatePtr})
|
||||
.custom();
|
||||
.customIf(typeIsNot(0, PrivatePtr));
|
||||
|
||||
setAction({G_BLOCK_ADDR, CodePtr}, Legal);
|
||||
|
||||
auto &FPOpActions = getActionDefinitionsBuilder(
|
||||
|
Loading…
Reference in New Issue
Block a user