[llvm] dcfc2c3 - [NFC] Remove shadowed variable in InnerLoopVectorizer::createInductionVariable
Florian Hahn via llvm-commits
llvm-commits at lists.llvm.org
Tue Jun 29 04:58:19 PDT 2021
Hi,
> On Jun 29, 2021, at 09:14, David Sherwood via llvm-commits <llvm-commits at lists.llvm.org> wrote:
>
>
> Author: David Sherwood
> Date: 2021-06-29T09:14:35+01:00
> New Revision: dcfc2c3fac980b137415c17f2f19c06c3e2bd7fb
>
> URL: https://github.com/llvm/llvm-project/commit/dcfc2c3fac980b137415c17f2f19c06c3e2bd7fb
> DIFF: https://github.com/llvm/llvm-project/commit/dcfc2c3fac980b137415c17f2f19c06c3e2bd7fb.diff
>
> LOG: [NFC] Remove shadowed variable in InnerLoopVectorizer::createInductionVariable
>
> Avoid creating a IRBuilder stack variable with the same name as the
> class member.
>
It looks like this may be responsible for an ASAN failure (https://lab.llvm.org/buildbot/#/builders/168/builds/1061/steps/10/logs/stdio <https://lab.llvm.org/buildbot/#/builders/168/builds/1061/steps/10/logs/stdio>):
=================================================================
==35296==ERROR: AddressSanitizer: heap-use-after-free on address 0x608000002258 at pc 0x000005b74936 bp 0x7fff798eadb0 sp 0x7fff798eada8
READ of size 8 at 0x608000002258 thread T0
#0 0x5b74935 in getInt /b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm-project/llvm/include/llvm/ADT/PointerIntPair.h:61:57
#1 0x5b74935 in isSentinel /b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm-project/llvm/include/llvm/ADT/ilist_node_base.h:45:52
#2 0x5b74935 in isKnownSentinel /b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm-project/llvm/include/llvm/ADT/ilist_node_base.h:46:41
#3 0x5b74935 in operator* /b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm-project/llvm/include/llvm/ADT/ilist_iterator.h:138:5
#4 0x5b74935 in operator-> /b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm-project/llvm/include/llvm/ADT/ilist_iterator.h:141:40
#5 0x5b74935 in SetInsertPoint /b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm-project/llvm/include/llvm/IR/IRBuilder.h:204:31
#6 0x5b74935 in restoreIP /b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm-project/llvm/include/llvm/IR/IRBuilder.h:285:7
#7 0x5b74935 in llvm::IRBuilderBase::InsertPointGuard::~InsertPointGuard() /b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm-project/llvm/include/llvm/IR/IRBuilder.h:382:15
#8 0xc4e362b in llvm::InnerLoopVectorizer::createInductionVariable(llvm::Loop*, llvm::Value*, llvm::Value*, llvm::Value*, llvm::Instruction*) /b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm-project/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:3104:1
#9 0xc4ee14c in llvm::InnerLoopVectorizer::createVectorizedLoopSkeleton() /b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm-project/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:3712:7
#10 0xc56139c in llvm::LoopVectorizationPlanner::executePlan(llvm::InnerLoopVectorizer&, llvm::DominatorTree*) /b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm-project/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:8089:26
#11 0xc59464e in llvm::LoopVectorizePass::processLoop(llvm::Loop*) /b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm-project/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:10212:13
#12 0xc5a165c in llvm::LoopVectorizePass::runImpl(llvm::Function&, llvm::ScalarEvolution&, llvm::LoopInfo&, llvm::TargetTransformInfo&, llvm::DominatorTree&, llvm::BlockFrequencyInfo&, llvm::TargetLibraryInfo*, llvm::DemandedBits&, llvm::AAResults&, llvm::AssumptionCache&, std::__1::function<llvm::LoopAccessInfo const& (llvm::Loop&)>&, llvm::OptimizationRemarkEmitter&, llvm::ProfileSummaryInfo*) /b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm-project/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:10311:30
#13 0xc5a3310 in llvm::LoopVectorizePass::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) /b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm-project/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:10345:9
#14 0xc8f9f41 in llvm::detail::PassModel<llvm::Function, llvm::LoopVectorizePass, llvm::PreservedAnalyses, llvm::AnalysisManager<llvm::Function> >::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) /b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm-project/llvm/include/llvm/IR/PassManagerInternal.h:85:17
#15 0xa653120 in llvm::PassManager<llvm::Function, llvm::AnalysisManager<llvm::Function> >::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) /b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm-project/llvm/include/llvm/IR/PassManager.h:509:21
#16 0x59b6ca1 in llvm::detail::PassModel<llvm::Function, llvm::PassManager<llvm::Function, llvm::AnalysisManager<llvm::Function> >, llvm::PreservedAnalyses, llvm::AnalysisManager<llvm::Function> >::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) /b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm-project/llvm/include/llvm/IR/PassManagerInternal.h:85:17
#17 0xa66285d in llvm::ModuleToFunctionPassAdaptor::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) /b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm-project/llvm/lib/IR/PassManager.cpp:117:22
#18 0x4c7f481 in llvm::detail::PassModel<llvm::Module, llvm::ModuleToFunctionPassAdaptor, llvm::PreservedAnalyses, llvm::AnalysisManager<llvm::Module> >::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) /b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm-project/llvm/include/llvm/IR/PassManagerInternal.h:85:17
#19 0xa64fa41 in llvm::PassManager<llvm::Module, llvm::AnalysisManager<llvm::Module> >::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) /b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm-project/llvm/include/llvm/IR/PassManager.h:509:21
#20 0x4c627bf in llvm::runPassPipeline(llvm::StringRef, llvm::Module&, llvm::TargetMachine*, llvm::TargetLibraryInfoImpl*, llvm::ToolOutputFile*, llvm::ToolOutputFile*, llvm::ToolOutputFile*, llvm::StringRef, llvm::ArrayRef<llvm::StringRef>, llvm::opt_tool::OutputKind, llvm::opt_tool::VerifierKind, bool, bool, bool, bool, bool, bool) /b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm-project/llvm/tools/opt/NewPMDriver.cpp:457:7
#21 0x4c99c0a in main /b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm-project/llvm/tools/opt/opt.cpp:830:12
#22 0x7f3868a4d09a in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2409a)
#23 0x4b783f9 in _start (/b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm_build_asan/bin/opt+0x4b783f9)
0x608000002258 is located 56 bytes inside of 96-byte region [0x608000002220,0x608000002280)
freed by thread T0 here:
#0 0x4c522a0 in operator delete(void*) /b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm-project/compiler-rt/lib/asan/asan_new_delete.cpp:152:3
#1 0xa4fc3e3 in deleteNode /b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm-project/llvm/include/llvm/IR/Instruction.h:859:6
#2 0xa4fc3e3 in erase /b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm-project/llvm/include/llvm/ADT/ilist.h:268:5
#3 0xa4fc3e3 in llvm::Instruction::eraseFromParent() /b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm-project/llvm/lib/IR/Instruction.cpp:79:37
#4 0xc4e3622 in llvm::InnerLoopVectorizer::createInductionVariable(llvm::Loop*, llvm::Value*, llvm::Value*, llvm::Value*, llvm::Instruction*) /b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm-project/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:3101:27
#5 0xc4ee14c in llvm::InnerLoopVectorizer::createVectorizedLoopSkeleton() /b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm-project/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:3712:7
#6 0xc56139c in llvm::LoopVectorizationPlanner::executePlan(llvm::InnerLoopVectorizer&, llvm::DominatorTree*) /b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm-project/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:8089:26
#7 0xc59464e in llvm::LoopVectorizePass::processLoop(llvm::Loop*) /b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm-project/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:10212:13
#8 0xc5a165c in llvm::LoopVectorizePass::runImpl(llvm::Function&, llvm::ScalarEvolution&, llvm::LoopInfo&, llvm::TargetTransformInfo&, llvm::DominatorTree&, llvm::BlockFrequencyInfo&, llvm::TargetLibraryInfo*, llvm::DemandedBits&, llvm::AAResults&, llvm::AssumptionCache&, std::__1::function<llvm::LoopAccessInfo const& (llvm::Loop&)>&, llvm::OptimizationRemarkEmitter&, llvm::ProfileSummaryInfo*) /b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm-project/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:10311:30
#9 0xc5a3310 in llvm::LoopVectorizePass::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) /b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm-project/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:10345:9
#10 0xc8f9f41 in llvm::detail::PassModel<llvm::Function, llvm::LoopVectorizePass, llvm::PreservedAnalyses, llvm::AnalysisManager<llvm::Function> >::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) /b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm-project/llvm/include/llvm/IR/PassManagerInternal.h:85:17
#11 0xa653120 in llvm::PassManager<llvm::Function, llvm::AnalysisManager<llvm::Function> >::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) /b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm-project/llvm/include/llvm/IR/PassManager.h:509:21
#12 0x59b6ca1 in llvm::detail::PassModel<llvm::Function, llvm::PassManager<llvm::Function, llvm::AnalysisManager<llvm::Function> >, llvm::PreservedAnalyses, llvm::AnalysisManager<llvm::Function> >::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) /b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm-project/llvm/include/llvm/IR/PassManagerInternal.h:85:17
#13 0xa66285d in llvm::ModuleToFunctionPassAdaptor::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) /b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm-project/llvm/lib/IR/PassManager.cpp:117:22
#14 0x4c7f481 in llvm::detail::PassModel<llvm::Module, llvm::ModuleToFunctionPassAdaptor, llvm::PreservedAnalyses, llvm::AnalysisManager<llvm::Module> >::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) /b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm-project/llvm/include/llvm/IR/PassManagerInternal.h:85:17
#15 0xa64fa41 in llvm::PassManager<llvm::Module, llvm::AnalysisManager<llvm::Module> >::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) /b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm-project/llvm/include/llvm/IR/PassManager.h:509:21
#16 0x4c627bf in llvm::runPassPipeline(llvm::StringRef, llvm::Module&, llvm::TargetMachine*, llvm::TargetLibraryInfoImpl*, llvm::ToolOutputFile*, llvm::ToolOutputFile*, llvm::ToolOutputFile*, llvm::StringRef, llvm::ArrayRef<llvm::StringRef>, llvm::opt_tool::OutputKind, llvm::opt_tool::VerifierKind, bool, bool, bool, bool, bool, bool) /b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm-project/llvm/tools/opt/NewPMDriver.cpp:457:7
#17 0x4c99c0a in main /b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm-project/llvm/tools/opt/opt.cpp:830:12
#18 0x7f3868a4d09a in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2409a)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210629/0eefc8b5/attachment.html>
More information about the llvm-commits
mailing list