[PATCH] D147892: [VPlan] Unify Value2VPValue and VPExternalDefs maps (NFCI).

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 18 02:31:30 PDT 2023


fhahn added a comment.

In D147892#4274496 <https://reviews.llvm.org/D147892#4274496>, @thurston wrote:

> (Repost from github)
>
> This patch appears to cause a heap-use-after-free e.g., https://lab.llvm.org/buildbot/#/builders/239/builds/1843/steps/14/logs/stdio:
>
>   FAIL: LLVM :: Transforms/LoopVectorize/SystemZ/pr38110.ll (57359 of 71288)
>   ******************** TEST 'LLVM :: Transforms/LoopVectorize/SystemZ/pr38110.ll' FAILED ********************
>   Script:
>   --
>   : 'RUN: at line 1';   /b/sanitizer-aarch64-linux-bootstrap-asan/build/llvm_build_asan/bin/opt -passes='loop-vectorize' -mcpu=z13 -force-vector-width=2 -S < /b/sanitizer-aarch64-linux-bootstrap-asan/build/llvm-project/llvm/test/Transforms/LoopVectorize/SystemZ/pr38110.ll | /b/sanitizer-aarch64-linux-bootstrap-asan/build/llvm_build_asan/bin/FileCheck /b/sanitizer-aarch64-linux-bootstrap-asan/build/llvm-project/llvm/test/Transforms/LoopVectorize/SystemZ/pr38110.ll
>   --
>   Exit Code: 2
>   Command Output (stderr):
>   --
>   =================================================================
>   ==932340==ERROR: AddressSanitizer: heap-use-after-free on address 0x50e000000b50 at pc 0xaaaacf039884 bp 0xffffca0e3220 sp 0xffffca0e3218
>   READ of size 8 at 0x50e000000b50 thread T0
>       #0 0xaaaacf039880 in llvm::VPValue::getDefiningRecipe() /b/sanitizer-aarch64-linux-bootstrap-asan/build/llvm-project/llvm/lib/Transforms/Vectorize/VPlan.cpp:117:37
>       #1 0xaaaacef5cda4 in llvm::VPlan::getVPValue(llvm::Value*, bool) /b/sanitizer-aarch64-linux-bootstrap-asan/build/llvm-project/llvm/lib/Transforms/Vectorize/VPlan.h:2346:5
>       #2 0xaaaacef5a7c4 in llvm::InnerLoopVectorizer::truncateToMinimalBitwidths(llvm::VPTransformState&) /b/sanitizer-aarch64-linux-bootstrap-asan/build/llvm-project/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:3611:32
>       #3 0xaaaacef5d648 in llvm::InnerLoopVectorizer::fixVectorizedLoop(llvm::VPTransformState&, llvm::VPlan&) /b/sanitizer-aarch64-linux-bootstrap-asan/build/llvm-project/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:3739:5
>       #4 0xaaaacefaf0e4 in llvm::LoopVectorizationPlanner::executePlan(llvm::ElementCount, unsigned int, llvm::VPlan&, llvm::InnerLoopVectorizer&, llvm::DominatorTree*, bool) /b/sanitizer-aarch64-linux-bootstrap-asan/build/llvm-project/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:7802:7
>       #5 0xaaaacefe67c8 in llvm::LoopVectorizePass::processLoop(llvm::Loop*) /b/sanitizer-aarch64-linux-bootstrap-asan/build/llvm-project/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:10496:13
>       #6 0xaaaaceff4028 in llvm::LoopVectorizePass::runImpl(llvm::Function&, llvm::ScalarEvolution&, llvm::LoopInfo&, llvm::TargetTransformInfo&, llvm::DominatorTree&, llvm::BlockFrequencyInfo*, llvm::TargetLibraryInfo*, llvm::DemandedBits&, llvm::AssumptionCache&, llvm::LoopAccessInfoManager&, llvm::OptimizationRemarkEmitter&, llvm::ProfileSummaryInfo*) /b/sanitizer-aarch64-linux-bootstrap-asan/build/llvm-project/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:10593:30
>       #7 0xaaaaceff5440 in llvm::LoopVectorizePass::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) /b/sanitizer-aarch64-linux-bootstrap-asan/build/llvm-project/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:10626:9
>       #8 0xaaaacd88aaa8 in llvm::PassManager<llvm::Function, llvm::AnalysisManager<llvm::Function>>::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) /b/sanitizer-aarch64-linux-bootstrap-asan/build/llvm-project/llvm/include/llvm/IR/PassManager.h:517:40
>       #9 0xaaaacd896838 in llvm::ModuleToFunctionPassAdaptor::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) /b/sanitizer-aarch64-linux-bootstrap-asan/build/llvm-project/llvm/lib/IR/PassManager.cpp:124:38
>       #10 0xaaaacd888284 in llvm::PassManager<llvm::Module, llvm::AnalysisManager<llvm::Module>>::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) /b/sanitizer-aarch64-linux-bootstrap-asan/build/llvm-project/llvm/include/llvm/IR/PassManager.h:517:40
>       #11 0xaaaac851509c in llvm::runPassPipeline(llvm::StringRef, llvm::Module&, llvm::TargetMachine*, llvm::TargetLibraryInfoImpl*, llvm::ToolOutputFile*, llvm::ToolOutputFile*, llvm::ToolOutputFile*, llvm::StringRef, llvm::ArrayRef<llvm::PassPlugin>, llvm::opt_tool::OutputKind, llvm::opt_tool::VerifierKind, bool, bool, bool, bool, bool, bool) /b/sanitizer-aarch64-linux-bootstrap-asan/build/llvm-project/llvm/tools/opt/NewPMDriver.cpp:522:7
>       #12 0xaaaac85446c4 in main /b/sanitizer-aarch64-linux-bootstrap-asan/build/llvm-project/llvm/tools/opt/opt.cpp:701:12
>       #13 0xffff92e373f8  (/lib/aarch64-linux-gnu/libc.so.6+0x273f8) (BuildId: f37f3aa07c797e333fd106472898d361f71798f5)
>       #14 0xffff92e374c8 in __libc_start_main (/lib/aarch64-linux-gnu/libc.so.6+0x274c8) (BuildId: f37f3aa07c797e333fd106472898d361f71798f5)
>       #15 0xaaaac842bb6c in _start (/b/sanitizer-aarch64-linux-bootstrap-asan/build/llvm_build_asan/bin/opt+0x7f6bb6c)

Thanks for the revert, should be fixed by adjusting the order of the conditions in the assert in VPValue in the recommitted version.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D147892



More information about the llvm-commits mailing list