void TypeInfer::expandOverloads(TypeSetByHwMode &VTS) {
ValidateOnExit _1(VTS, *this);
const TypeSetByHwMode &Legal = getLegalTypes();
- assert(Legal.isDefaultOnly() && "Default-mode only expected");
- const TypeSetByHwMode::SetType &LegalTypes = Legal.get(DefaultMode);
+ assert(Legal.isSimple() && "Default-mode only expected");
+ const TypeSetByHwMode::SetType &LegalTypes = Legal.getSimple();
for (auto &I : VTS)
expandOverloads(I.second, LegalTypes);
LegalTypes.insert(I.second);
LegalTypesCached = true;
}
- assert(LegalCache.isDefaultOnly() && "Default-mode only expected");
+ assert(LegalCache.isSimple() && "Default-mode only expected");
return LegalCache;
}
bool TreePatternNode::hasProperTypeByHwMode() const {
for (const TypeSetByHwMode &S : Types)
- if (!S.isDefaultOnly())
+ if (!S.isSimple())
return true;
for (const TreePatternNodePtr &C : Children)
if (C->hasProperTypeByHwMode())
LLVM_ATTRIBUTE_ALWAYS_INLINE
bool isMachineValueType() const {
- return isDefaultOnly() && Map.begin()->second.size() == 1;
+ return isSimple() && getSimple().size() == 1;
}
LLVM_ATTRIBUTE_ALWAYS_INLINE
MVT getMachineValueType() const {
assert(isMachineValueType());
- return *Map.begin()->second.begin();
+ return *getSimple().begin();
}
bool isPossible() const;
- LLVM_ATTRIBUTE_ALWAYS_INLINE
- bool isDefaultOnly() const {
- return Map.size() == 1 && Map.begin()->first == DefaultMode;
- }
-
bool isPointer() const {
return getValueTypeByHwMode().isPointer();
}
return Map.size() == 1 && Map.begin()->first == DefaultMode;
}
LLVM_ATTRIBUTE_ALWAYS_INLINE
- InfoT getSimple() const {
+ const InfoT &getSimple() const {
assert(isSimple());
return Map.begin()->second;
}