Skip to content

Commit 9bd32d7

Browse files
authored
[CodeGen] Update DwarfEHPreparePass references in CodeGenPassBuilder.h (#74068)
Forgot to update the counterpart in `CodeGenPassBuilder.h`. Also Rename `dwarfehprepare` -> `dwarf-eh-prepare`.
1 parent b2cc4b9 commit 9bd32d7

File tree

10 files changed

+17
-15
lines changed

10 files changed

+17
-15
lines changed

llvm/include/llvm/CodeGen/CodeGenPassBuilder.h

+3-2
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
#include "llvm/Analysis/TargetTransformInfo.h"
2424
#include "llvm/Analysis/TypeBasedAliasAnalysis.h"
2525
#include "llvm/CodeGen/CallBrPrepare.h"
26+
#include "llvm/CodeGen/DwarfEHPrepare.h"
2627
#include "llvm/CodeGen/ExpandReductions.h"
2728
#include "llvm/CodeGen/InterleavedAccess.h"
2829
#include "llvm/CodeGen/MachinePassManager.h"
@@ -678,14 +679,14 @@ void CodeGenPassBuilder<Derived>::addPassesToHandleExceptions(
678679
case ExceptionHandling::DwarfCFI:
679680
case ExceptionHandling::ARM:
680681
case ExceptionHandling::AIX:
681-
addPass(DwarfEHPass(getOptLevel()));
682+
addPass(DwarfEHPreparePass(&TM));
682683
break;
683684
case ExceptionHandling::WinEH:
684685
// We support using both GCC-style and MSVC-style exceptions on Windows, so
685686
// add both preparation passes. Each pass will only actually run if it
686687
// recognizes the personality function.
687688
addPass(WinEHPreparePass());
688-
addPass(DwarfEHPass(getOptLevel()));
689+
addPass(DwarfEHPreparePass(&TM));
689690
break;
690691
case ExceptionHandling::Wasm:
691692
// Wasm EH uses Windows EH instructions, but it does not need to demote PHIs

llvm/include/llvm/CodeGen/MachinePassRegistry.def

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ FUNCTION_ANALYSIS("targetir", TargetIRAnalysis,
3838
#endif
3939
FUNCTION_PASS("callbrprepare", CallBrPreparePass, ())
4040
FUNCTION_PASS("consthoist", ConstantHoistingPass, ())
41+
FUNCTION_PASS("dwarf-eh-prepare", DwarfEHPreparePass, (TM))
4142
FUNCTION_PASS("ee-instrument", EntryExitInstrumenterPass, (false))
4243
FUNCTION_PASS("expand-large-div-rem", ExpandLargeDivRemPass, ())
4344
FUNCTION_PASS("expand-large-fp-convert", ExpandLargeFpConvertPass, ())
@@ -123,7 +124,6 @@ DUMMY_FUNCTION_PASS("atomic-expand", AtomicExpandPass, ())
123124
DUMMY_FUNCTION_PASS("cfguard-check", CFGuardCheckPass, ())
124125
DUMMY_FUNCTION_PASS("cfguard-dispatch", CFGuardDispatchPass, ())
125126
DUMMY_FUNCTION_PASS("codegenprepare", CodeGenPreparePass, ())
126-
DUMMY_FUNCTION_PASS("dwarfehprepare", DwarfEHPass, ())
127127
DUMMY_FUNCTION_PASS("expandmemcmp", ExpandMemCmpPass, ())
128128
DUMMY_FUNCTION_PASS("gc-info-printer", GCInfoPrinterPass, ())
129129
DUMMY_FUNCTION_PASS("gc-lowering", GCLoweringPass, ())

llvm/lib/CodeGen/DwarfEHPrepare.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242

4343
using namespace llvm;
4444

45-
#define DEBUG_TYPE "dwarfehprepare"
45+
#define DEBUG_TYPE "dwarf-eh-prepare"
4646

4747
STATISTIC(NumResumesLowered, "Number of resume calls lowered");
4848
STATISTIC(NumCleanupLandingPadsUnreachable,

llvm/lib/Passes/PassRegistry.def

+1-1
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ FUNCTION_PASS("dot-dom-only", DomOnlyPrinter())
302302
FUNCTION_PASS("dot-post-dom", PostDomPrinter())
303303
FUNCTION_PASS("dot-post-dom-only", PostDomOnlyPrinter())
304304
FUNCTION_PASS("dse", DSEPass())
305-
FUNCTION_PASS("dwarfehprepare", DwarfEHPreparePass(TM))
305+
FUNCTION_PASS("dwarf-eh-prepare", DwarfEHPreparePass(TM))
306306
FUNCTION_PASS("expand-large-div-rem", ExpandLargeDivRemPass(TM))
307307
FUNCTION_PASS("expand-large-fp-convert", ExpandLargeFpConvertPass(TM))
308308
FUNCTION_PASS("fix-irreducible", FixIrreduciblePass())
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
; RUN: not --crash opt %s -dwarfehprepare -o - 2>&1 | FileCheck %s
1+
; RUN: not --crash opt %s -dwarf-eh-prepare -o - 2>&1 | FileCheck %s
22

33
; CHECK: Trying to construct TargetPassConfig without a target machine. Scheduling a CodeGen pass without a target triple set?

llvm/test/CodeGen/Mips/compactbranches/beqc-bnec-register-constraint.ll

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
; RUN: llc -march=mips -mcpu=mips32r6 -O1 -start-after=dwarfehprepare < %s | FileCheck %s
2-
; RUN: llc -march=mips64 -mcpu=mips64r6 -O1 -start-after=dwarfehprepare < %s | FileCheck %s
1+
; RUN: llc -march=mips -mcpu=mips32r6 -O1 -start-after=dwarf-eh-prepare < %s | FileCheck %s
2+
; RUN: llc -march=mips64 -mcpu=mips64r6 -O1 -start-after=dwarf-eh-prepare < %s | FileCheck %s
33

44

55
; beqc/bnec have the constraint that $rs < $rt && $rs != 0 && $rt != 0

llvm/test/CodeGen/X86/dwarf-eh-prepare-dbg.ll

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2-
; RUN: opt -S -mtriple=x86_64-linux-gnu -dwarfehprepare < %s | FileCheck %s
3-
; RUN: opt -S -mtriple=x86_64-linux-gnu -passes=dwarfehprepare < %s | FileCheck %s
2+
; RUN: opt -S -mtriple=x86_64-linux-gnu -dwarf-eh-prepare < %s | FileCheck %s
3+
; RUN: opt -S -mtriple=x86_64-linux-gnu -passes=dwarf-eh-prepare < %s | FileCheck %s
44

55
; PR57469: If _Unwind_Resume is defined in the same module and we have debug
66
; info, then the inserted _Unwind_Resume calls also need to have a dummy debug

llvm/test/CodeGen/X86/dwarf-eh-prepare.ll

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
; RUN: opt -mtriple=x86_64-linux-gnu -dwarfehprepare -simplifycfg-require-and-preserve-domtree=1 -run-twice < %s -S | FileCheck %s
2-
; RUN: opt -mtriple=x86_64-linux-gnu -passes=dwarfehprepare -codegen-opt-level=2 -simplifycfg-require-and-preserve-domtree=1 -run-twice < %s -S | FileCheck %s
1+
; RUN: opt -mtriple=x86_64-linux-gnu -dwarf-eh-prepare -simplifycfg-require-and-preserve-domtree=1 -run-twice < %s -S | FileCheck %s
2+
; RUN: opt -mtriple=x86_64-linux-gnu -passes=dwarf-eh-prepare -codegen-opt-level=2 -simplifycfg-require-and-preserve-domtree=1 -run-twice < %s -S | FileCheck %s
33

44
; Check basic functionality of IR-to-IR DWARF EH preparation. This should
55
; eliminate resumes. This pass requires a TargetMachine, so we put it under X86

llvm/test/CodeGen/X86/dwarf_eh_resume.ll

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
; RUN: opt -mtriple=x86_64-linux-gnu -dwarfehprepare -S %s | FileCheck %s
2-
; RUN: opt -mtriple=x86_64-linux-gnu -passes=dwarfehprepare -S %s | FileCheck %s
1+
; RUN: opt -mtriple=x86_64-linux-gnu -dwarf-eh-prepare -S %s | FileCheck %s
2+
; RUN: opt -mtriple=x86_64-linux-gnu -passes=dwarf-eh-prepare -S %s | FileCheck %s
33

44
declare i32 @hoge(...)
55

llvm/tools/opt/opt.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,8 @@ static bool shouldPinPassToLegacyPM(StringRef Pass) {
339339
"nvptx-", "mips-", "lanai-", "hexagon-", "bpf-", "avr-",
340340
"thumb2-", "arm-", "si-", "gcn-", "amdgpu-", "aarch64-",
341341
"amdgcn-", "polly-", "riscv-", "dxil-"};
342-
std::vector<StringRef> PassNameContain = {"ehprepare"};
342+
// TODO: remove "ehprepare"
343+
std::vector<StringRef> PassNameContain = {"-eh-prepare", "ehprepare"};
343344
std::vector<StringRef> PassNameExact = {
344345
"safe-stack",
345346
"cost-model",

0 commit comments

Comments
 (0)