[PATCH] D157907: [NFC] Refactor X86TargetLowering::getGlobalWrapperKind()

Michael Buch via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 22 07:01:47 PDT 2023


Michael137 added a comment.

In D157907#4605677 <https://reviews.llvm.org/D157907#4605677>, @jasonmolenda wrote:

> Hi, this is causing a regression on the greendragon x86_64 lldb bot, it took a little while to repo and narrow down today.  https://green.lab.llvm.org/green/view/LLDB/job/lldb-cmake/ is failing on TestDequeFromStdModule.py, I can repo it on an intel mac.  We're crashing under
>
>   LLVM ERROR: unable to evaluate offset to undefined symbol 'L21$pb'
>   
>   4   liblldb.18.0.0git.dylib       	       0x1357b08a4 llvm::report_fatal_error(llvm::Twine const&, bool) + 388 (ErrorHandling.cpp:123)
>   5   liblldb.18.0.0git.dylib       	       0x13f73da2b getLabelOffset(llvm::MCAsmLayout const&, llvm::MCSymbol const&, bool, unsigned long long&) + 187 (MCFragment.cpp:107)
>   6   liblldb.18.0.0git.dylib       	       0x13f73aa48 getSymbolOffsetImpl(llvm::MCAsmLayout const&, llvm::MCSymbol const&, bool, unsigned long long&) + 72 (MCFragment.cpp:118)
>   7   liblldb.18.0.0git.dylib       	       0x13f73abde getSymbolOffsetImpl(llvm::MCAsmLayout const&, llvm::MCSymbol const&, bool, unsigned long long&) + 478 (MCFragment.cpp:143)
>   8   liblldb.18.0.0git.dylib       	       0x13f73ac56 llvm::MCAsmLayout::getSymbolOffset(llvm::MCSymbol const&) const + 38 (MCFragment.cpp:158)
>   9   liblldb.18.0.0git.dylib       	       0x13f6df97f llvm::MCAssembler::evaluateFixup(llvm::MCAsmLayout const&, llvm::MCFixup const&, llvm::MCFragment const*, llvm::MCValue&, unsigned long long&, bool&) const + 1151 (MCAssembler.cpp:262)
>   10  liblldb.18.0.0git.dylib       	       0x13f6e2aec llvm::MCAssembler::handleFixup(llvm::MCAsmLayout const&, llvm::MCFragment&, llvm::MCFixup const&) + 92 (MCAssembler.cpp:804)
>   11  liblldb.18.0.0git.dylib       	       0x13f6e362b llvm::MCAssembler::layout(llvm::MCAsmLayout&) + 2651 (MCAssembler.cpp:933)
>   12  liblldb.18.0.0git.dylib       	       0x13f6e40cd llvm::MCAssembler::Finish() + 77 (MCAssembler.cpp:944)
>   13  liblldb.18.0.0git.dylib       	       0x13f75b10b llvm::MCObjectStreamer::finishImpl() + 203 (MCObjectStreamer.cpp:932)
>   14  liblldb.18.0.0git.dylib       	       0x13f744709 (anonymous namespace)::MCMachOStreamer::finishImpl() + 761 (MCMachOStreamer.cpp:533)
>   15  liblldb.18.0.0git.dylib       	       0x13f785b10 llvm::MCStreamer::finish(llvm::SMLoc) + 224 (MCStreamer.cpp:1021)
>   16  liblldb.18.0.0git.dylib       	       0x1381ac986 llvm::AsmPrinter::doFinalization(llvm::Module&) + 6502 (AsmPrinter.cpp:2398)
>   17  liblldb.18.0.0git.dylib       	       0x13f1708ae llvm::FPPassManager::doFinalization(llvm::Module&) + 78 (LegacyPassManager.cpp:1499)
>   18  liblldb.18.0.0git.dylib       	       0x13f1699be (anonymous namespace)::MPPassManager::runOnModule(llvm::Module&) + 1358 (LegacyPassManager.cpp:1586)
>   19  liblldb.18.0.0git.dylib       	       0x13f1692ba llvm::legacy::PassManagerImpl::run(llvm::Module&) + 266 (LegacyPassManager.cpp:535)
>   20  liblldb.18.0.0git.dylib       	       0x13f170af1 llvm::legacy::PassManager::run(llvm::Module&) + 33 (LegacyPassManager.cpp:1677)
>   21  liblldb.18.0.0git.dylib       	       0x138d51d7d llvm::MCJIT::emitObject(llvm::Module*) + 477 (MCJIT.cpp:171)
>
> @Michael137 might be better able to understand the nature of the regression, I'm not very familiar with this part of llvm, I'm trying to get repo steps for him on an aarch64 mac to build & run it under translation.  I think we'll need to revert this until we can figure out the failure.

I can repro under Rosetta. Let me know if you need any details on how to repro or about the Module we're trying to compile.
We initialise our JIT ExecutionEngine as follows:

  builder.setEngineKind(llvm::EngineKind::JIT)                              
      .setErrorStr(&error_string)                                           
      .setRelocationModel(triple.isOSBinFormatMachO() ? llvm::Reloc::PIC_   
                                                      : llvm::Reloc::Static)
      .setMCJITMemoryManager(std::make_unique<MemoryManager>(*this))        
      .setOptLevel(llvm::CodeGenOpt::Less);                                 

And the `Subtarget::PICStyle == Large` (which is a codepath that changed in this patch).


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D157907/new/

https://reviews.llvm.org/D157907



More information about the llvm-commits mailing list