[all-commits] [llvm/llvm-project] 709246: [RFC][GISel] Add a way to ignore COPY instructions...

Pierre van Houtryve via All-commits all-commits at lists.llvm.org
Thu Feb 9 23:37:56 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 70924673af680303d64e540d7767c0eeda5217fc
      https://github.com/llvm/llvm-project/commit/70924673af680303d64e540d7767c0eeda5217fc
  Author: Pierre van Houtryve <pierre.vanhoutryve at amd.com>
  Date:   2023-02-10 (Fri, 10 Feb 2023)

  Changed paths:
    M llvm/include/llvm/CodeGen/GlobalISel/InstructionSelector.h
    M llvm/include/llvm/CodeGen/GlobalISel/InstructionSelectorImpl.h
    M llvm/include/llvm/Target/TargetSelectionDAG.td
    M llvm/lib/Target/AMDGPU/AMDGPUInstructions.td
    M llvm/lib/Target/AMDGPU/SIInstructions.td
    M llvm/test/CodeGen/AMDGPU/bfi_int.ll
    A llvm/test/TableGen/GlobalISelEmitterFlags.td
    M llvm/utils/TableGen/CodeGenDAGPatterns.cpp
    M llvm/utils/TableGen/CodeGenDAGPatterns.h
    M llvm/utils/TableGen/GlobalISelEmitter.cpp

  Log Message:
  -----------
  [RFC][GISel] Add a way to ignore COPY instructions in InstructionSelector

RFC to add a way to ignore COPY instructions when pattern-matching MIR in GISel.
    - Add a new "GISelFlags" class to TableGen. Both `Pattern`  and `PatFrags` defs can use it to alter matching behaviour.
    - Flags start at zero and are scoped: the setter returns a `SaveAndRestore` object so that when the current scope ends, the flags are restored to their previous values. This allows child patterns to modify the flags without affecting the parent pattern.
    - Child patterns always reuse the parent's pattern, but they can override its values. For more examples, see `GlobalISelEmitterFlags.td` tests.
    - [AMDGPU] Use the IgnoreCopies flag in BFI patterns, which are known to be bothered by cross-regbank copies.

Reviewed By: arsenm

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




More information about the All-commits mailing list