[all-commits] [llvm/llvm-project] 839a8f: AMDGPU: Copy SubtargetPredicate from pseudo to rea...

Changpeng Fang via All-commits all-commits at lists.llvm.org
Fri Mar 8 10:30:24 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 839a8fecb4c5dfe1b4484d5fc942a9490867c47a
      https://github.com/llvm/llvm-project/commit/839a8fecb4c5dfe1b4484d5fc942a9490867c47a
  Author: Changpeng Fang <changpeng.fang at amd.com>
  Date:   2024-03-08 (Fri, 08 Mar 2024)

  Changed paths:
    M llvm/lib/Target/AMDGPU/VOP1Instructions.td
    M llvm/lib/Target/AMDGPU/VOP2Instructions.td
    M llvm/lib/Target/AMDGPU/VOP3PInstructions.td
    M llvm/lib/Target/AMDGPU/VOPInstructions.td

  Log Message:
  -----------
  AMDGPU: Copy SubtargetPredicate from pseudo to real for dpp16 and dpp8 (#84517)

We usually expect to copy SubtargetPredicate (and OtherPredicates) from
pseudo to real. However, in dpp16 and dpp8, there are assignments like
SubtargetPredicate = HasDPP/HasDPP16/HasDpp8. These assignments override
predicates copied from pseudo, and thus the predicates used to define
pseudo get lost.

Losing predicates is a subtle issue usually not easy to be found. It may
result in instructions being generated on GPUs that do not support the
features to generate them.
https://github.com/llvm/llvm-project/pull/84354 addressed one of such
issues, and inspired this work.

Fortunately, we found that the assignment of SubtargetPredicate usually
comes together with assignment of AssemblerPredicate, and with the same
value. For example:
  let AssemblerPredicate = HasDPP16;
  let SubtargetPredicate = HasDPP16;
One of them is redundant and can be removed.

In this work, we remove the redundant assignment of SubtargetPredicate,
and then copy it from pseudo for VOP*_DPP and VOP*_DPP8. With this
change, we can safely use SubtargetPredicate to define pseudo
instructions.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list