[PATCH] D94777: [AMDGPU][MC] Refactored parsing of dpp ctrl

Dmitry Preobrazhensky via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 15 11:32:23 PST 2021


dp added inline comments.


================
Comment at: llvm/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp:7332
+    if (Temp < 0 || Temp > 3) {
+      Error(Loc, "expected a 2-bit value");
+      return -1;
----------------
rampitec wrote:
> getLoc()? Loc is a single use variable.
If the expression value is out of bounds, and we call getLoc() later, we will refer an incorrect error position (the next token after the expression).

In the following test

    v_mov_b32_dpp v5, v1 quad_perm:[3,2,1,4] row_mask:0x0 bank_mask:0x0

assembler wil point to ']', rather than the offending '4'.


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

https://reviews.llvm.org/D94777



More information about the llvm-commits mailing list