diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2021-08-22 19:00:43 +0000 | 
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2021-12-06 16:30:02 +0000 | 
| commit | 5f7ddb1456d5b926e85710da690bf548ef0c9fc8 (patch) | |
| tree | f8845b108c5c07836b95c8229c96cd745fc9fb2c /contrib/llvm-project/llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp | |
| parent | 3f82687cdf02983d8f3294df4d97b09cf211141b (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 *  | 
