[PATCH] D65024: [GlobalISel][AArch64] Contract trivial same-size cross-bank copies into G_STOREs

Amara Emerson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 19 16:18:59 PDT 2019


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

Pre-emptive LGTM with the minor changes done.



================
Comment at: llvm/lib/Target/AArch64/AArch64InstructionSelector.cpp:1170
+  assert(I.getOpcode() == TargetOpcode::G_STORE && "Expected G_STORE");
+  // If we're storing 32 bits, it doesn't matter if it's 32 bits on a FPR or a
+  // GPR. So, if we run into something like this:
----------------
paquette wrote:
> aemerson wrote:
> > You mention 32 bits here but the example uses 64 bit types. Also, it doesn't matter whether we use 32 or 64 bit stores right?
> Right, it doesn't matter. I'll update the comment for consistency though.
Maybe replace the "storing 32 bits" with something like "storing a scalar".


================
Comment at: llvm/lib/Target/AArch64/AArch64InstructionSelector.cpp:1184
+  if (!Copy || Copy->getOpcode() != TargetOpcode::COPY)
+    return;
+  Register CopyDstReg = Copy->getOperand(0).getReg();
----------------
paquette wrote:
> paquette wrote:
> > aemerson wrote:
> > > This pattern can now be replaced with getOpcodeDef()?
> > It's not quite equivalent, since it looks through copies. I think that it would still work though, if I rejigger the rest of the function a bit.
> Oh, wait, it looks for a specific opcode. I don't think that will work too well with copies.
You're right, it specifically skips copies so it's no good here.


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

https://reviews.llvm.org/D65024





More information about the llvm-commits mailing list