[all-commits] [llvm/llvm-project] eb4422: [CodeGen] Introduce a generic MEMBARRIER instructi...

Philip Reames via All-commits all-commits at lists.llvm.org
Wed Jan 11 07:27:01 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: eb44226986fcbeb4325e5f668e5646e9646958bc
      https://github.com/llvm/llvm-project/commit/eb44226986fcbeb4325e5f668e5646e9646958bc
  Author: Philip Reames <preames at rivosinc.com>
  Date:   2023-01-11 (Wed, 11 Jan 2023)

  Changed paths:
    M llvm/include/llvm/CodeGen/SelectionDAGISel.h
    M llvm/include/llvm/Support/TargetOpcodes.def
    M llvm/include/llvm/Target/Target.td
    M llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
    M llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
    M llvm/lib/Target/RISCV/RISCVAsmPrinter.cpp
    M llvm/lib/Target/RISCV/RISCVInstrInfo.td
    M llvm/lib/Target/SystemZ/SystemZAsmPrinter.cpp
    M llvm/lib/Target/SystemZ/SystemZInstrInfo.td
    M llvm/lib/Target/SystemZ/SystemZLongBranch.cpp
    M llvm/lib/Target/VE/VEInstrInfo.td
    M llvm/lib/Target/X86/X86InstrCompiler.td
    M llvm/lib/Target/X86/X86MCInstLower.cpp
    M llvm/lib/Target/XCore/XCoreInstrInfo.td
    M llvm/test/CodeGen/X86/atomic-idempotent.ll
    M llvm/unittests/MIR/MachineMetadata.cpp

  Log Message:
  -----------
  [CodeGen] Introduce a generic MEMBARRIER instruction [mostly-nfc]

This is a follow up to D141317 which extends the common code to include a target independent pseudo instruction. This is an alternative to (subset of) D92842 which tries to be as close to NFC as possible.

A couple things to call out.
* The test change in X86 is because we loose the scheduling information on the instruction. However, I think this was actually a bug in x86 since no instruction was emitted for a MEMBARRIER. Concluding that a meta instruction has latency just seems wrong?
* I intentionally left some parts of D92842 out. Specifically, several of the changes in the X86 code (data independence and outlining) appear functional, and likely worthy of their own review. Additionally, I'm not handling ARM/AArch64 at all. Those targets need the ordering whereas none of the others do. I want to get this in and tested before retrofitting in ordering to support those targets.

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




More information about the All-commits mailing list