diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2021-08-22 19:00:43 +0000 |
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2021-11-13 20:39:49 +0000 |
| commit | fe6060f10f634930ff71b7c50291ddc610da2475 (patch) | |
| tree | 1483580c790bd4d27b6500a7542b5ee00534d3cc /contrib/llvm-project/llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp | |
| parent | b61bce17f346d79cecfd8f195a64b10f77be43b1 (diff) | |
| parent | 344a3780b2e33f6ca763666c380202b18aab72a3 (diff) | |
Diffstat (limited to 'contrib/llvm-project/llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp')
| -rw-r--r-- | contrib/llvm-project/llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/contrib/llvm-project/llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp b/contrib/llvm-project/llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp index 135055a43afc..746a7599c58c 100644 --- a/contrib/llvm-project/llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp +++ b/contrib/llvm-project/llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp @@ -77,6 +77,7 @@ extern "C" LLVM_EXTERNAL_VISIBILITY void LLVMInitializeWebAssemblyTarget() { initializeWebAssemblyMemIntrinsicResultsPass(PR); initializeWebAssemblyRegStackifyPass(PR); initializeWebAssemblyRegColoringPass(PR); + initializeWebAssemblyNullifyDebugValueListsPass(PR); initializeWebAssemblyFixIrreducibleControlFlowPass(PR); initializeWebAssemblyLateEHPreparePass(PR); initializeWebAssemblyExceptionInfoPass(PR); @@ -87,6 +88,7 @@ extern "C" LLVM_EXTERNAL_VISIBILITY void LLVMInitializeWebAssemblyTarget() { initializeWebAssemblyRegNumberingPass(PR); initializeWebAssemblyDebugFixupPass(PR); initializeWebAssemblyPeepholePass(PR); + initializeWebAssemblyMCLowerPrePassPass(PR); } //===----------------------------------------------------------------------===// @@ -118,11 +120,17 @@ WebAssemblyTargetMachine::WebAssemblyTargetMachine( const Target &T, const Triple &TT, StringRef CPU, StringRef FS, const TargetOptions &Options, Optional<Reloc::Model> RM, Optional<CodeModel::Model> CM, CodeGenOpt::Level OL, bool JIT) - : LLVMTargetMachine(T, - TT.isArch64Bit() ? "e-m:e-p:64:64-i64:64-n32:64-S128" - : "e-m:e-p:32:32-i64:64-n32:64-S128", - TT, CPU, FS, Options, getEffectiveRelocModel(RM, TT), - getEffectiveCodeModel(CM, CodeModel::Large), OL), + : LLVMTargetMachine( + T, + TT.isArch64Bit() + ? (TT.isOSEmscripten() + ? "e-m:e-p:64:64-i64:64-f128:64-n32:64-S128-ni:1:10:20" + : "e-m:e-p:64:64-i64:64-n32:64-S128-ni:1:10:20") + : (TT.isOSEmscripten() + ? "e-m:e-p:32:32-i64:64-f128:64-n32:64-S128-ni:1:10:20" + : "e-m:e-p:32:32-i64:64-n32:64-S128-ni:1:10:20"), + TT, CPU, FS, Options, getEffectiveRelocModel(RM, TT), + getEffectiveCodeModel(CM, CodeModel::Large), OL), TLOF(new WebAssemblyTargetObjectFile()) { // WebAssembly type-checks instructions, but a noreturn function with a return // type that doesn't match the context will cause a check failure. So we lower @@ -441,6 +449,9 @@ void WebAssemblyPassConfig::addPostRegAlloc() { void WebAssemblyPassConfig::addPreEmitPass() { TargetPassConfig::addPreEmitPass(); + // Nullify DBG_VALUE_LISTs that we cannot handle. + addPass(createWebAssemblyNullifyDebugValueLists()); + // Eliminate multiple-entry loops. addPass(createWebAssemblyFixIrreducibleControlFlow()); @@ -502,6 +513,9 @@ void WebAssemblyPassConfig::addPreEmitPass() { // Fix debug_values whose defs have been stackified. if (!WasmDisableExplicitLocals) addPass(createWebAssemblyDebugFixup()); + + // Collect information to prepare for MC lowering / asm printing. + addPass(createWebAssemblyMCLowerPrePass()); } yaml::MachineFunctionInfo * |
