Skip to content

Commit 2cb0644

Browse files
committed
[RISCV] Split the pseudo instruction splitting pass
Extracts the atomic pseudo-instructions' splitting from `riscv-expand-pseudo` / `RISCVExpandPseudo` into its own pass, `riscv-expand-atomic-pseudo` / `RISCVExpandAtomicPseudo`. This allows for the expansion of atomic operations to continue to happen late (the new pass is added in `addPreEmitPass2`, so those expansions continue to happen in the same place), while the remaining pseudo-instructions can now be expanded earlier and benefit from more optimization passes. The nonatomics pass is now added in `addPreSched2`. Differential Revision: https://reviews.llvm.org/D79635
1 parent d1df560 commit 2cb0644

File tree

6 files changed

+631
-529
lines changed

6 files changed

+631
-529
lines changed

llvm/lib/Target/RISCV/CMakeLists.txt

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ add_public_tablegen_target(RISCVCommonTableGen)
1919
add_llvm_target(RISCVCodeGen
2020
RISCVAsmPrinter.cpp
2121
RISCVCallLowering.cpp
22+
RISCVExpandAtomicPseudoInsts.cpp
2223
RISCVExpandPseudoInsts.cpp
2324
RISCVFrameLowering.cpp
2425
RISCVInstrInfo.cpp

llvm/lib/Target/RISCV/RISCV.h

+3
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ void initializeRISCVMergeBaseOffsetOptPass(PassRegistry &);
4343
FunctionPass *createRISCVExpandPseudoPass();
4444
void initializeRISCVExpandPseudoPass(PassRegistry &);
4545

46+
FunctionPass *createRISCVExpandAtomicPseudoPass();
47+
void initializeRISCVExpandAtomicPseudoPass(PassRegistry &);
48+
4649
InstructionSelector *createRISCVInstructionSelector(const RISCVTargetMachine &,
4750
RISCVSubtarget &,
4851
RISCVRegisterBankInfo &);

0 commit comments

Comments
 (0)