[PATCH] D96469: [AMDGPU] WIP: use single cache policy operand

Stanislav Mekhanoshin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 11 09:04:34 PST 2021


rampitec added inline comments.


================
Comment at: llvm/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp:4876
+  // since parseOptionalOperand just consumed all of the individual bits.
+  if (ResTy == MatchOperand_Success && Mnemonic.startswith("scratch_")) {
+    unsigned CPPos = 0;
----------------
dp wrote:
> rampitec wrote:
> > arsenm wrote:
> > > Don't see why this needs to check the mnemonic, but I guess that's part of the temporary hack
> > Yes, it is hack to only change small number of instructions for now.
> It would be interesting to add global_ to play with hardcoded glc.
Right, that's one problem to solve.


================
Comment at: llvm/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp:6919
+    } else if (Op.Type == AMDGPUOperand::ImmTyCachePolicy) {
+      continue;
     } else {
----------------
dp wrote:
> Maybe it would be cleaner to parse this as a real sequence of operands instead of replacing parsed operands later?
I consider this a temp code. parseOptionalOperand() can create and update cache policy operand directly, but it cannot do so now because it has no access to mnemonics. When all instructions are handled it can be moved there.


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

https://reviews.llvm.org/D96469



More information about the llvm-commits mailing list