[PATCH] D119696: [AMDGPU] Improve v_cmpx usage on GFX10.3.

Jay Foad via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 25 03:36:20 PST 2022


foad added inline comments.


================
Comment at: llvm/lib/Target/AMDGPU/SIInstrInfo.cpp:3768
     Inst32.add(MI.getOperand(0));
-  } else {
+  } else if (MI.getOperand(0).isReg()) {
+    // VOPCX instructions won't be writing to an explicit dst, so this should
----------------
Testing `MI.getOperand(0).isReg()` is ugly here. It happens to work, because operand 0 of a nosdst cmpx e64 instruction is src0_modifiers which is an immediate. But really I think this code ought to say:
```
  if MI has vdst
    copy MI.vdst to Inst32
  [else] if MI has sdst
    assert that MI.sdst is vcc (so there is no need to copy it, because the Inst32 will implicitly use vcc)
```


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D119696



More information about the llvm-commits mailing list