[all-commits] [llvm/llvm-project] da9ed3: [AArch64] Avoid adding duplicate implicit operands...

Andrew Wei via All-commits all-commits at lists.llvm.org
Tue Sep 7 02:13:17 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: da9ed3dc719bbe0dbe8d4d8b7e6e2061532392fe
      https://github.com/llvm/llvm-project/commit/da9ed3dc719bbe0dbe8d4d8b7e6e2061532392fe
  Author: Andrew Wei <weiwei64 at huawei.com>
  Date:   2021-09-07 (Tue, 07 Sep 2021)

  Changed paths:
    M llvm/lib/Target/AArch64/AArch64ExpandPseudoInsts.cpp
    A llvm/test/CodeGen/AArch64/expand-subs-pseudo.mir

  Log Message:
  -----------
  [AArch64] Avoid adding duplicate implicit operands when expanding pseudo insts.

When expanding pseudo insts, in order to create a new machine instr, we use BuildMI,
which will add implicit operands by default. And transferImpOps will also copy implicit
operands from old ones. Finally, duplicate implicit operands are added to the same inst.
Sometimes this can cause correctness issues. Like below inst,
    renamable $w18 = nsw SUBSWrr renamable $w30, renamable $w14, implicit-def dead $nzcv
After expanding, it will become
    $w18 = SUBSWrs renamable $w13, renamable $w14, 0, implicit-def $nzcv, implicit-def dead $nzcv
A redundant implicit-def $nzcv is added, but the dead flag is missing.

Reviewed By: dmgreen

Differential Revision: https://reviews.llvm.org/D109069




More information about the All-commits mailing list