[PATCH] D104410: GlobalISel/Utils: Add util function and matcher for constant splat

Jessica Paquette via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 28 09:37:38 PDT 2021


paquette added inline comments.


================
Comment at: llvm/lib/CodeGen/GlobalISel/Utils.cpp:941
 
+Optional<Register> llvm::getVectorConstantSplatUndef(
+    Register VReg, const MachineRegisterInfo &MRI, bool AllowUndef,
----------------
This looks really similar to `getBuildVectorConstantSplat`. Would it make sense to improve that function instead?


================
Comment at: llvm/lib/CodeGen/GlobalISel/Utils.cpp:944
+    bool MatchFConstant, bool MatchIConstant) {
+  // Look through copies.
+  MachineInstr *MI;
----------------
Petar.Avramovic wrote:
> foad wrote:
> > Isn't there an existing utility you can call to do this?
> There is code that does similar thing with look through in a few places but not a utility function. 
`getDefIgnoringCopies` doesn't work here?


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

https://reviews.llvm.org/D104410



More information about the llvm-commits mailing list