[PATCH] D159339: [urgent][CodeGen] First check the kind and then the llvm::Function properties.

David Tenty via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Sep 8 18:24:32 PDT 2023


daltenty added a comment.

In D159339#4642210 <https://reviews.llvm.org/D159339#4642210>, @v.g.vassilev wrote:

> In D159339#4642147 <https://reviews.llvm.org/D159339#4642147>, @daltenty wrote:
>
>> FYI: I tried to reproduce this on `powerpc64le-linux-gnu` at `-02` and didn't see it at this point, though I get a whole lot of other uninitialized reads, so there's definitely some general problems in this space in the LLVM codebase
>
> Are these also present in llvm16?

I do see a similar case in llvm16 yes:

  algrind --tool=memcheck --leak-check=full ./bin/clang-repl
  ==3583806== Memcheck, a memory error detector
  ==3583806== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
  ==3583806== Using Valgrind-3.17.0 and LibVEX; rerun with -h for copyright info
  ==3583806== Command: ./bin/clang-repl
  ==3583806==
  clang-repl> #include <memory>
  ==3583806== Conditional jump or move depends on uninitialised value(s)
  ==3583806==    at 0x28D08F4: operator== (llvm-project/llvm/include/llvm/Support/Alignment.h:301)
  ==3583806==    by 0x28D08F4: llvm::DataLayout::operator==(llvm::DataLayout const&) const (llvm-project/llvm/lib/IR/DataLayout.cpp:549)
  ==3583806==    by 0x2AA31BB: operator!= (llvm-project/llvm/include/llvm/IR/DataLayout.h:233)
  ==3583806==    by 0x2AA31BB: llvm::orc::LLJIT::applyDataLayout(llvm::Module&) (llvm-project/llvm/lib/ExecutionEngine/Orc/LLJIT.cpp:927)
  ==3583806==    by 0x2AA009F: operator() (llvm-project/llvm/lib/ExecutionEngine/Orc/LLJIT.cpp:754)
  ==3583806==    by 0x2AA009F: withModuleDo<(lambda at /home/daltenty/llvm/dev/llvm-project/llvm/lib/ExecutionEngine/Orc/LLJIT.cpp:754:28)> (llvm-project/llvm/include/llvm/ExecutionEngine/Orc/ThreadSafeModule.h:136)
  ==3583806==    by 0x2AA009F: llvm::orc::LLJIT::addIRModule(llvm::IntrusiveRefCntPtr<llvm::orc::ResourceTracker>, llvm::orc::ThreadSafeModule) (llvm-project/llvm/lib/ExecutionEngine/Orc/LLJIT.cpp:754)
  ==3583806==    by 0x2AA0693: llvm::orc::LLJIT::addIRModule(llvm::orc::JITDylib&, llvm::orc::ThreadSafeModule) (llvm-project/llvm/lib/ExecutionEngine/Orc/LLJIT.cpp:761)
  ==3583806==    by 0x2AAB563: (anonymous namespace)::GenericLLVMIRPlatformSupport::setupJITDylib(llvm::orc::JITDylib&) (llvm-project/llvm/lib/ExecutionEngine/Orc/LLJIT.cpp:253)
  ==3583806==    by 0x2AA2B2F: GenericLLVMIRPlatformSupport (llvm-project/llvm/lib/ExecutionEngine/Orc/LLJIT.cpp:200)
  ==3583806==    by 0x2AA2B2F: make_unique<(anonymous namespace)::GenericLLVMIRPlatformSupport, llvm::orc::LLJIT &> (unique_ptr.h:1065)
  ==3583806==    by 0x2AA2B2F: llvm::orc::setUpGenericLLVMIRPlatform(llvm::orc::LLJIT&) (llvm-project/llvm/lib/ExecutionEngine/Orc/LLJIT.cpp:947)
  ==3583806==    by 0x2AA2273: llvm::orc::LLJIT::LLJIT(llvm::orc::LLJITBuilderState&, llvm::Error&) (llvm-project/llvm/lib/ExecutionEngine/Orc/LLJIT.cpp:911)
  ==3583806==    by 0x26AE233: llvm::orc::LLJITBuilderSetters<llvm::orc::LLJIT, llvm::orc::LLJITBuilder, llvm::orc::LLJITBuilderState>::create() (llvm-project/llvm/include/llvm/ExecutionEngine/Orc/LLJIT.h:381)
  ==3583806==    by 0x2F39D7F: clang::IncrementalExecutor::IncrementalExecutor(llvm::orc::ThreadSafeContext&, llvm::Error&, clang::TargetInfo const&) (llvm-project/clang/lib/Interpreter/IncrementalExecutor.cpp:40)
  ==3583806==    by 0x2F33A47: make_unique<clang::IncrementalExecutor, llvm::orc::ThreadSafeContext &, llvm::Error &, const clang::TargetInfo &> (unique_ptr.h:1065)
  ==3583806==    by 0x2F33A47: clang::Interpreter::Execute(clang::PartialTranslationUnit&) (llvm-project/clang/lib/Interpreter/Interpreter.cpp:223)
  ==3583806==    by 0x26AE71B: clang::Interpreter::ParseAndExecute(llvm::StringRef) (llvm-project/clang/include/clang/Interpreter/Interpreter.h:68)
  ==3583806==    by 0x26ADD6B: main (llvm-project/clang/tools/clang-repl/ClangRepl.cpp:127)
  ==3583806==

This definitely seems to be point to `DataLayout.FunctionPtrAlign`.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D159339



More information about the cfe-commits mailing list