[PATCH] D48826: [AMDGPU] Add support for TFE/LWE in image intrinsics

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 2 07:14:04 PDT 2018


arsenm added inline comments.


================
Comment at: lib/Target/AMDGPU/SIAddIMGInit.cpp:16
+
+#define DEBUG_TYPE "si-img-init"
+#include "AMDGPU.h"
----------------
This needs to go below includes


================
Comment at: lib/Target/AMDGPU/SIAddIMGInit.cpp:27
+#include "llvm/IR/Function.h"
+#include "llvm/IR/LLVMContext.h"
+#include "llvm/Support/Debug.h"
----------------
Why do you need to include this?


================
Comment at: lib/Target/AMDGPU/SIAddIMGInit.cpp:46
+
+  StringRef getPassName() const override { return "SI Add IMG init"; }
+
----------------
You don't need this, the default comes from the INITIALIZE_PASS


================
Comment at: lib/Target/AMDGPU/SIAddIMGInit.cpp:83
+      auto Opcode = MI.getOpcode();
+      if (TII->isMIMG(Opcode) && !TII->get(Opcode).mayStore()) {
+        MachineOperand *tfe = TII->getNamedOperand(MI, AMDGPU::OpName::tfe);
----------------
MI.mayStore() works


================
Comment at: lib/Target/AMDGPU/SIAddIMGInit.cpp:84-86
+        MachineOperand *tfe = TII->getNamedOperand(MI, AMDGPU::OpName::tfe);
+        MachineOperand *lwe = TII->getNamedOperand(MI, AMDGPU::OpName::lwe);
+        MachineOperand *d16 = TII->getNamedOperand(MI, AMDGPU::OpName::d16);
----------------
Capitalize


================
Comment at: lib/Target/AMDGPU/SIAddIMGInit.cpp:112
+          // Abandon attempt if no dmask operand is found.
+          if (!MO_Dmask) continue;
+
----------------
New line


Repository:
  rL LLVM

https://reviews.llvm.org/D48826





More information about the llvm-commits mailing list