[PATCH] D35167: [AMDGPU] Add an llvm.amdgcn.wqm intrinsic for WQM

Connor Abbott via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 26 15:28:19 PDT 2017


cwabbott added inline comments.


================
Comment at: lib/Target/AMDGPU/SIWholeQuadMode.cpp:676-688
+void SIWholeQuadMode::lowerCopyInstrs() {
+  for (MachineInstr *MI : LowerToCopyInstrs) {
+    const DebugLoc &DL = MI->getDebugLoc();
+    unsigned Dest = MI->getOperand(0).getReg();
+    unsigned Src = MI->getOperand(1).getReg();
+    MachineInstr *Copy =
+        BuildMI(*MI->getParent(), MI, DL, TII->get(AMDGPU::COPY), Dest)
----------------
nhaehnle wrote:
> You can probably use MI->setDesc for this.
It's not quite that simple, since I'm also using this code to optimize llvm.amdgcn.set.inactive with an undef second argument, in which case we need to get rid of the second (undef) argument. But I think the end-result is still a little shorter and otherwise equivalent, so I'll change it.


https://reviews.llvm.org/D35167





More information about the llvm-commits mailing list