This is an archive of the discontinued LLVM Phabricator instance.

[GlobalISel] Add buildMerge with SrcOp initializer list
ClosedPublic

Authored by Petar.Avramovic on Feb 7 2020, 7:39 AM.

Details

Summary

Allows more flexible use of buildMerge in places where
use operands are available as SrcOp since it does not
require explicit conversion to Register.
Simplify code with new buildMerge.

Diff Detail

Event Timeline

Petar.Avramovic created this revision.Feb 7 2020, 7:39 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 7 2020, 7:39 AM
arsenm accepted this revision.Feb 7 2020, 7:44 AM
This revision is now accepted and ready to land.Feb 7 2020, 7:44 AM
foad added a subscriber: foad.Feb 7 2020, 8:53 AM
foad added inline comments.
llvm/include/llvm/CodeGen/GlobalISel/MachineIRBuilder.h
792

Why std::initializer_list instead of ArrayRef? Is it something to do with ambiguous overloads? Do we still need the ArrayRef<Register> overload at all?

Petar.Avramovic marked an inline comment as done.Feb 7 2020, 9:39 AM
Petar.Avramovic added inline comments.
llvm/include/llvm/CodeGen/GlobalISel/MachineIRBuilder.h
792

Old one with ArrayRef<Register> is required when argument is something like an actual SmallVector<Register>. It could also be used with brace enclosed initializer list filled with Registers.
New one is for brace enclosed initializer list with arguments that can be converted to SrcOp.

This revision was automatically updated to reflect the committed changes.