[PATCH] D42244: [globalisel] Introduce LegalityQuery to better encapsulate the legalizer decisions. NFC.

Justin Bogner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 23 11:46:12 PST 2018


bogner accepted this revision.
bogner added a comment.
This revision is now accepted and ready to land.

LGTM. I have a couple of style comments you can take or leave as you see fit.



================
Comment at: include/llvm/CodeGen/GlobalISel/LegalizerInfo.h:62-63
+
+  LegalityQuery(unsigned Opcode, ArrayRef<LLT> Types)
+      : Opcode(Opcode), Types(Types) {}
+};
----------------
Pretty sure there's no need to spell this out. For a struct/class with only public members and no constructor you can aggregate-initialize with an initializer-list.


================
Comment at: include/llvm/CodeGen/GlobalISel/LegalizerInfo.h:130-133
+    bool operator==(const LegalizeActionStep &Other) const {
+      return Action == Other.Action && TypeIdx == Other.TypeIdx &&
+             NewType == Other.NewType;
+    }
----------------
I was going to say that we usually name the parameter RHS and do the std::tie(A, B) == std::tie(RHS.A, RHS.B) pattern here, but a quick look shows that we're not at all consistent about that, so I guess you can do whatever you think is clearest.


https://reviews.llvm.org/D42244





More information about the llvm-commits mailing list