[PATCH] D55294: [GISel]: Refactor MachineIRBuilder to allow passing additional parameters to build Instrs

Aditya Nandakumar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 10 12:48:59 PST 2018


aditya_nandakumar marked 4 inline comments as done.
aditya_nandakumar added a comment.

All the buildInstr support so far has been for instructions that have register only operands. The ones missing are probably non register operands (such as predicates, immediate, FPConstant etc)



================
Comment at: include/llvm/CodeGen/GlobalISel/MachineIRBuilder.h:65
+public:
+  enum DstType { Ty_LLT, Ty_Reg, Ty_RC };
+  DstOp(unsigned R) : Reg(R), Ty(DstType::Ty_Reg) {}
----------------
bogner wrote:
> Does this need to be public? I think it's only used internally to DstOp.
> 
> Also, this can probably be an enum class easily enough, since you don't convert it to or from an integer type ever.
I think the CSEBuilder might need to use it (depending on if it should materialize a copy or not). I haven't implemented that part yet. If it's not needed, as a part of that change, I'll make it private.

I will change it to enum class.


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D55294/new/

https://reviews.llvm.org/D55294





More information about the llvm-commits mailing list