[GISel]: Enhance the MachineIRBuilder API
authorAditya Nandakumar <aditya_nandakumar@apple.com>
Thu, 6 Jul 2017 19:40:07 +0000 (19:40 +0000)
committerAditya Nandakumar <aditya_nandakumar@apple.com>
Thu, 6 Jul 2017 19:40:07 +0000 (19:40 +0000)
commit1745121a45a1d895c6527f228451797788f04fa2
tree0e63175e6104a2161975590be6563d7b0dafe84c
parenta80cb1d7a71b21b64ea54267b932f137d531c997
[GISel]: Enhance the MachineIRBuilder API

Allows the MachineIRBuilder APIs to directly create registers (based on
LLT or TargetRegisterClass) as well as accept MachineInstrBuilders
and implicitly converts to register(with getOperand(0).getReg()).

Eg usage:
LLT s32 = LLT::scalar(32);
auto C32 = Builder.buildConstant(s32, 32);
auto Tmp = Builder.buildInstr(TargetOpcode::G_SUB, s32, C32,
OtherReg);
auto Tmp2 = Builder.buildInstr(Opcode, DstReg,
Builder.buildConstant(s32, 31)); ....

Only a few methods added for now.

Reviewed by Tim

llvm-svn: 307302
llvm/include/llvm/CodeGen/GlobalISel/MachineIRBuilder.h
llvm/lib/Target/AArch64/AArch64LegalizerInfo.cpp