[PATCH] D104410: GlobalISel/Utils: Refactor constant splat match functions

Jessica Paquette via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 7 13:27:07 PDT 2021


paquette added inline comments.


================
Comment at: llvm/lib/CodeGen/GlobalISel/Utils.cpp:367
 
+bool isGImplicitDef(const MachineInstr *MI) {
+  return MI->getOpcode() == TargetOpcode::G_IMPLICIT_DEF;
----------------
This will need a nullptr check.

I'm not sure about how I feel about adding functions for generic opcode checks, since I think it could end up being confusing if we don't add them for every opcode. :/

That being said, these do look nicer than using `MI->getOpcode()` everywhere.

(Maybe someone else can give a stronger opinion here.)


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

https://reviews.llvm.org/D104410



More information about the llvm-commits mailing list