[SDAG] Introduce a common MEMBARRIER node [nfc]
authorPhilip Reames <preames@rivosinc.com>
Mon, 9 Jan 2023 22:45:45 +0000 (14:45 -0800)
committerPhilip Reames <listmail@philipreames.com>
Mon, 9 Jan 2023 23:20:08 +0000 (15:20 -0800)
commit037636e695daff1834f0bda0aed52e606c7ebf9a
tree6f179071908a5aec11c8a34db8d4ccaad1236dc9
parent596c5581556cbd4103d982066fb76e745fb8480e
[SDAG] Introduce a common MEMBARRIER node [nfc]

We have multiple targets which have defined custom instructions and sdag nodes to represent a compiler memory barrier. This patch consolidates the sdag node definition into common code.

This is a companion to D92842, but a bit different in focus. This change consolidates the existing sdag node definitions; that patch skipped defining a sdag node by instead going straight to a target node. That patch is also not NFC - as being so is quite hard for commoning up the instruction definitions.

I started with two backends to ensure the new common code was reusable while not having a massive diff. Once this lands, I'll submit a series of NFCs for backends where the changes are obvious, or reviews if more discussion is needed.

Differential Revision: https://reviews.llvm.org/D141317
llvm/include/llvm/CodeGen/ISDOpcodes.h
llvm/include/llvm/Target/TargetSelectionDAG.td
llvm/lib/CodeGen/SelectionDAG/SelectionDAGDumper.cpp
llvm/lib/Target/SystemZ/SystemZISelLowering.cpp
llvm/lib/Target/SystemZ/SystemZISelLowering.h
llvm/lib/Target/SystemZ/SystemZInstrInfo.td
llvm/lib/Target/SystemZ/SystemZOperators.td
llvm/lib/Target/X86/X86ISelLowering.cpp
llvm/lib/Target/X86/X86ISelLowering.h
llvm/lib/Target/X86/X86InstrCompiler.td
llvm/lib/Target/X86/X86InstrInfo.td