Subzero. Introduces a new LoweringContext::insert() method.
Emitting an instruction in Subzero requires a fair amount of
boilerplated code:
Context.insert(<InstType>::create(Func, <Args>...));
The ordeal is worse if one needs access to the recently create
instructionL
auto *Instr = <InstType>::create(Func, <Args>...);
Context.insert(Instr);
Instr->...
This CL introduces a new LoweringContext::insert() method:
template <<InstType>, <Args>...>
<InstType> *LoweringContext::insert(<Args>...) {
auto *New = Inst::create(Node.Cfg, <Args>...);
insert(New);
return New;
}
This is essentially a syntatic sugar that allows instructions to be
emitted by using
Context.insert<InstType>(<Args>...);
The compiler should be able to inline the calls (and get rid of the
return value) when appropriate.
make bloat reviews a small increase in translator code size
BUG=
R=sehr@chromium.org, stichnot@chromium.org
Review URL: https://codereview.chromium.org/1527143003 .
9 files changed