[PATCH] D66958: [AMDGPU] Enable constant offset promotion to immediate operand for VMEM stores

Valery Pykhtin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 29 09:41:40 PDT 2019


vpykhtin created this revision.
vpykhtin added reviewers: rampitec, arsenm.
Herald added subscribers: llvm-commits, t-tye, tpr, dstuttard, yaxunl, nhaehnle, wdng, jvesely, kzhuravl.
Herald added a project: LLVM.

This was left disabled for some reason, let's enable.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D66958

Files:
  lib/Target/AMDGPU/SILoadStoreOptimizer.cpp


Index: lib/Target/AMDGPU/SILoadStoreOptimizer.cpp
===================================================================
--- lib/Target/AMDGPU/SILoadStoreOptimizer.cpp
+++ lib/Target/AMDGPU/SILoadStoreOptimizer.cpp
@@ -1316,13 +1316,14 @@
     MemInfoMap &Visited,
     SmallPtrSet<MachineInstr *, 4> &AnchorList) {
 
+  if (!(MI.mayLoad() ^ MI.mayStore()))
+    return false;
+
   // TODO: Support flat and scratch.
-  if (AMDGPU::getGlobalSaddrOp(MI.getOpcode()) < 0 ||
-      TII->getNamedOperand(MI, AMDGPU::OpName::vdata) != NULL)
+  if (AMDGPU::getGlobalSaddrOp(MI.getOpcode()) < 0)
     return false;
 
-  // TODO: Support Store.
-  if (!MI.mayLoad())
+  if (MI.mayLoad() && TII->getNamedOperand(MI, AMDGPU::OpName::vdata) != NULL)
     return false;
 
   if (AnchorList.count(&MI))


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D66958.217912.patch
Type: text/x-patch
Size: 787 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190829/0f19bfe8/attachment.bin>


More information about the llvm-commits mailing list