本文整理汇总了C++中StackmapValue::constrainedChild方法的典型用法代码示例。如果您正苦于以下问题:C++ StackmapValue::constrainedChild方法的具体用法?C++ StackmapValue::constrainedChild怎么用?C++ StackmapValue::constrainedChild使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StackmapValue
的用法示例。
在下文中一共展示了StackmapValue::constrainedChild方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: forEachArgImpl
void StackmapSpecial::forEachArgImpl(
unsigned numIgnoredB3Args, unsigned numIgnoredAirArgs,
Inst& inst, Arg::Role role, const ScopedLambda<Inst::EachArgCallback>& callback)
{
StackmapValue* value = inst.origin->as<StackmapValue>();
ASSERT(value);
// Check that insane things have not happened.
ASSERT(inst.args.size() >= numIgnoredAirArgs);
ASSERT(value->children().size() >= numIgnoredB3Args);
ASSERT(inst.args.size() - numIgnoredAirArgs == value->children().size() - numIgnoredB3Args);
for (unsigned i = 0; i < inst.args.size() - numIgnoredAirArgs; ++i) {
Arg& arg = inst.args[i + numIgnoredAirArgs];
ConstrainedValue child = value->constrainedChild(i + numIgnoredB3Args);
Arg::Role thisRole = role;
// Cool down the role if the use is cold.
if (child.rep().kind() == ValueRep::Any && thisRole == Arg::Use)
thisRole = Arg::ColdUse;
callback(arg, role, Arg::typeForB3Type(child.value()->type()));
}
}
示例2: forEachArgImpl
void StackmapSpecial::forEachArgImpl(
unsigned numIgnoredB3Args, unsigned numIgnoredAirArgs,
Inst& inst, RoleMode roleMode, Optional<unsigned> firstRecoverableIndex,
const ScopedLambda<Inst::EachArgCallback>& callback)
{
StackmapValue* value = inst.origin->as<StackmapValue>();
ASSERT(value);
// Check that insane things have not happened.
ASSERT(inst.args.size() >= numIgnoredAirArgs);
ASSERT(value->children().size() >= numIgnoredB3Args);
ASSERT(inst.args.size() - numIgnoredAirArgs >= value->children().size() - numIgnoredB3Args);
for (unsigned i = 0; i < value->children().size() - numIgnoredB3Args; ++i) {
Arg& arg = inst.args[i + numIgnoredAirArgs];
ConstrainedValue child = value->constrainedChild(i + numIgnoredB3Args);
Arg::Role role;
switch (roleMode) {
case ForceLateUseUnlessRecoverable:
ASSERT(firstRecoverableIndex);
if (arg != inst.args[*firstRecoverableIndex] && arg != inst.args[*firstRecoverableIndex + 1]) {
role = Arg::LateColdUse;
break;
}
FALLTHROUGH;
case SameAsRep:
switch (child.rep().kind()) {
case ValueRep::WarmAny:
case ValueRep::SomeRegister:
case ValueRep::Register:
case ValueRep::Stack:
case ValueRep::StackArgument:
case ValueRep::Constant:
role = Arg::Use;
break;
case ValueRep::LateRegister:
role = Arg::LateUse;
break;
case ValueRep::ColdAny:
role = Arg::ColdUse;
break;
case ValueRep::LateColdAny:
role = Arg::LateColdUse;
break;
default:
RELEASE_ASSERT_NOT_REACHED();
break;
}
break;
case ForceLateUse:
role = Arg::LateColdUse;
break;
}
Type type = child.value()->type();
callback(arg, role, Arg::typeForB3Type(type), Arg::widthForB3Type(type));
}
}
示例3: forEachArgImpl
void StackmapSpecial::forEachArgImpl(
unsigned numIgnoredB3Args, unsigned numIgnoredAirArgs,
Inst& inst, RoleMode roleMode, const ScopedLambda<Inst::EachArgCallback>& callback)
{
StackmapValue* value = inst.origin->as<StackmapValue>();
ASSERT(value);
// Check that insane things have not happened.
ASSERT(inst.args.size() >= numIgnoredAirArgs);
ASSERT(value->children().size() >= numIgnoredB3Args);
ASSERT(inst.args.size() - numIgnoredAirArgs == value->children().size() - numIgnoredB3Args);
for (unsigned i = 0; i < inst.args.size() - numIgnoredAirArgs; ++i) {
Arg& arg = inst.args[i + numIgnoredAirArgs];
ConstrainedValue child = value->constrainedChild(i + numIgnoredB3Args);
Arg::Role role;
switch (roleMode) {
case SameAsRep:
switch (child.rep().kind()) {
case ValueRep::WarmAny:
case ValueRep::SomeRegister:
case ValueRep::Register:
case ValueRep::Stack:
case ValueRep::StackArgument:
case ValueRep::Constant:
role = Arg::Use;
break;
case ValueRep::ColdAny:
role = Arg::ColdUse;
break;
case ValueRep::LateColdAny:
role = Arg::LateUse;
break;
}
break;
case ForceLateUse:
role = Arg::LateUse;
break;
}
callback(arg, role, Arg::typeForB3Type(child.value()->type()));
}
}