llvm-project icon indicating copy to clipboard operation
llvm-project copied to clipboard

ToT fails to compile LegalizeIntegerTypes with code coverage enabled

Open vedantk opened this issue 9 years ago • 3 comments

Bugzilla Link 32285
Resolution FIXED
Resolved on Mar 16, 2017 07:19
Version trunk
OS All
Attachments Reduced *.ll reproducer
CC @RKSimon,@JonPsson

Extended Description

ToT hits an assertion failure when compiling LegalizeIntegerTypes.cpp with clang-based code coverage. I am attaching some reproducers:

  • bugpoint-reduced-simplified.ll (simply run with 'opt -O3')
  • A traditional preprocessed source / repro script

I suspect the following patch is responsible:

https://reviews.llvm.org/D29540

Here is the backtrace:

Assertion failed: (Ty->isVectorTy() && "Can only scalarize vectors"), function getScalarizationOverhead, file /Users/vk/src/llvm.org-master/llvm/include/llvm/CodeGen/BasicTTIImpl.h, line 294. 4 libsystem_c.dylib 0x0000000104190f83 abort + 127 5 libsystem_c.dylib 0x00000001041596a6 basename_r + 0 6 opt 0x0000000101caedc3 llvm::BasicTTIImplBasellvm::X86TTIImpl::getIntrinsicInstrCost(llvm::Intrinsic::ID, llvm::Type*, llvm::ArrayRefllvm::Value*, llvm::FastMathFlags, unsigned int) + 1267 7 opt 0x00000001022282dc llvm::TargetTransformInfo::getIntrinsicInstrCost(llvm::Intrinsic::ID, llvm::Type*, llvm::ArrayRefllvm::Value*, llvm::FastMathFlags, unsigned int) const + 28 8 opt 0x0000000102cdf678 getVectorIntrinsicCost(llvm::CallInst*, unsigned int, llvm::TargetTransformInfo const&, llvm::TargetLibraryInfo const*) + 376 9 opt 0x0000000102cde4d6 (anonymous namespace)::LoopVectorizationCostModel::getInstructionCost(llvm::Instruction*, unsigned int) + 3190 10 opt 0x0000000102cdf92e (anonymous namespace)::LoopVectorizationCostModel::expectedCost(unsigned int) + 222 11 opt 0x0000000102cc33b9 llvm::LoopVectorizePass::processLoop(llvm::Loop*) + 11913 12 opt 0x0000000102cce620 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&) + 528 13 opt 0x0000000102ccfefc (anonymous namespace)::LoopVectorize::runOnFunction(llvm::Function&) + 1196 14 opt 0x0000000102657e7d llvm::FPPassManager::runOnFunction(llvm::Function&) + 541 15 opt 0x00000001026580e3 llvm::FPPassManager::runOnModule(llvm::Module&) + 51 16 opt 0x000000010265862d llvm::legacy::PassManagerImpl::run(llvm::Module&) + 957

vedantk avatar Mar 15 '17 18:03 vedantk

Fix commited as r297954

JonPsson avatar Mar 16 '17 14:03 JonPsson

Thanks for test case!

I think this was an omission to check for a void return type.

See my fix at https://reviews.llvm.org/D31024.

JonPsson avatar Mar 16 '17 08:03 JonPsson

Unfortunately I can't upload the preprocessed cpp source, since it's over 1MB (even when compressed).

vedantk avatar Mar 15 '17 18:03 vedantk