Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LLVM doesn't support aggregate types in getTypeLegalizationCost #84675

Open
dtcxzyw opened this issue Mar 10, 2024 · 0 comments
Open

LLVM doesn't support aggregate types in getTypeLegalizationCost #84675

dtcxzyw opened this issue Mar 10, 2024 · 0 comments

Comments

@dtcxzyw
Copy link
Member

dtcxzyw commented Mar 10, 2024

Reproducer: https://godbolt.org/z/53ze61ve3

target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

define void @_ZNSt8__detail8_ScannerIcEC2EPKcS3_NSt15regex_constants18syntax_option_typeESt6locale(ptr %this, i1 %call2, { i64, i64 } %0) {
entry:
  %cond = select i1 %call2, { i64, i64 } %0, { i64, i64 } zeroinitializer
  %cond.elt1 = extractvalue { i64, i64 } %cond, 1
  store i64 %cond.elt1, ptr %this, align 8
  ret void
}
> opt -passes="print<cost-model>" -S test.ll
Printing analysis 'Cost Model Analysis' for function '_ZNSt8__detail8_ScannerIcEC2EPKcS3_NSt15regex_constants18syntax_option_typeESt6locale':
Unknown type!
UNREACHABLE executed at /home/dtcxzyw/WorkSpace/Projects/compilers/llvm-project/llvm/lib/CodeGen/ValueTypes.cpp:590!
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0.      Program arguments: bin/opt -passes=print<cost-model> reduced.ll
 #0 0x00007f6cb39e9300 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/home/dtcxzyw/WorkSpace/Projects/compilers/LLVM/llvm-build/bin/../lib/libLLVMSupport.so.19.0git+0x1e9300)
 #1 0x00007f6cb39e670f llvm::sys::RunSignalHandlers() (/home/dtcxzyw/WorkSpace/Projects/compilers/LLVM/llvm-build/bin/../lib/libLLVMSupport.so.19.0git+0x1e670f)
 #2 0x00007f6cb39e6865 SignalHandler(int) Signals.cpp:0:0
 #3 0x00007f6cb3442520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
 #4 0x00007f6cb34969fc __pthread_kill_implementation ./nptl/pthread_kill.c:44:76
 #5 0x00007f6cb34969fc __pthread_kill_internal ./nptl/pthread_kill.c:78:10
 #6 0x00007f6cb34969fc pthread_kill ./nptl/pthread_kill.c:89:10
 #7 0x00007f6cb3442476 gsignal ./signal/../sysdeps/posix/raise.c:27:6
 #8 0x00007f6cb34287f3 abort ./stdlib/abort.c:81:7
 #9 0x00007f6cb3901e3e (/home/dtcxzyw/WorkSpace/Projects/compilers/LLVM/llvm-build/bin/../lib/libLLVMSupport.so.19.0git+0x101e3e)
#10 0x00007f6cb073f685 (/home/dtcxzyw/WorkSpace/Projects/compilers/LLVM/llvm-build/bin/../lib/../lib/libLLVMCodeGen.so.19.0git+0x73f685)
#11 0x00007f6cb073f75c llvm::EVT::getEVT(llvm::Type*, bool) (/home/dtcxzyw/WorkSpace/Projects/compilers/LLVM/llvm-build/bin/../lib/../lib/libLLVMCodeGen.so.19.0git+0x73f75c)
#12 0x00007f6cb2809fef llvm::BasicTTIImplBase<llvm::X86TTIImpl>::getTypeLegalizationCost(llvm::Type*) const (/home/dtcxzyw/WorkSpace/Projects/compilers/LLVM/llvm-build/bin/../lib/../lib/libLLVMX86CodeGen.so.19.0git+0x409fef)
#13 0x00007f6cb2815e35 llvm::BasicTTIImplBase<llvm::X86TTIImpl>::getCmpSelInstrCost(unsigned int, llvm::Type*, llvm::Type*, llvm::CmpInst::Predicate, llvm::TargetTransformInfo::TargetCostKind, llvm::Instruction const*) (/home/dtcxzyw/WorkSpace/Projects/compilers/LLVM/llvm-build/bin/../lib/../lib/libLLVMX86CodeGen.so.19.0git+0x415e35)
#14 0x00007f6cb28036ca llvm::TargetTransformInfoImplCRTPBase<llvm::X86TTIImpl>::getInstructionCost(llvm::User const*, llvm::ArrayRef<llvm::Value const*>, llvm::TargetTransformInfo::TargetCostKind) (/home/dtcxzyw/WorkSpace/Projects/compilers/LLVM/llvm-build/bin/../lib/../lib/libLLVMX86CodeGen.so.19.0git+0x4036ca)
#15 0x00007f6cae86cb75 llvm::TargetTransformInfo::getInstructionCost(llvm::User const*, llvm::ArrayRef<llvm::Value const*>, llvm::TargetTransformInfo::TargetCostKind) const (/home/dtcxzyw/WorkSpace/Projects/compilers/LLVM/llvm-build/bin/../lib/../lib/libLLVMAnalysis.so.19.0git+0x46cb75)
#16 0x00007f6cae5580c8 llvm::CostModelPrinterPass::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) (/home/dtcxzyw/WorkSpace/Projects/compilers/LLVM/llvm-build/bin/../lib/../lib/libLLVMAnalysis.so.19.0git+0x1580c8)
#17 0x00007f6cb0c6ed96 llvm::detail::PassModel<llvm::Function, llvm::CostModelPrinterPass, llvm::AnalysisManager<llvm::Function>>::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) (/home/dtcxzyw/WorkSpace/Projects/compilers/LLVM/llvm-build/bin/../lib/../lib/libLLVMPasses.so.19.0git+0x6ed96)
#18 0x00007f6cae1188b1 llvm::PassManager<llvm::Function, llvm::AnalysisManager<llvm::Function>>::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) (/home/dtcxzyw/WorkSpace/Projects/compilers/LLVM/llvm-build/bin/../lib/../lib/libLLVMCore.so.19.0git+0x3188b1)
#19 0x00007f6cb24a5556 llvm::detail::PassModel<llvm::Function, llvm::PassManager<llvm::Function, llvm::AnalysisManager<llvm::Function>>, llvm::AnalysisManager<llvm::Function>>::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) (/home/dtcxzyw/WorkSpace/Projects/compilers/LLVM/llvm-build/bin/../lib/../lib/libLLVMX86CodeGen.so.19.0git+0xa5556)
#20 0x00007f6cae1175ab llvm::ModuleToFunctionPassAdaptor::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (/home/dtcxzyw/WorkSpace/Projects/compilers/LLVM/llvm-build/bin/../lib/../lib/libLLVMCore.so.19.0git+0x3175ab)
#21 0x00007f6cb24a6946 llvm::detail::PassModel<llvm::Module, llvm::ModuleToFunctionPassAdaptor, llvm::AnalysisManager<llvm::Module>>::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (/home/dtcxzyw/WorkSpace/Projects/compilers/LLVM/llvm-build/bin/../lib/../lib/libLLVMX86CodeGen.so.19.0git+0xa6946)
#22 0x00007f6cae115421 llvm::PassManager<llvm::Module, llvm::AnalysisManager<llvm::Module>>::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (/home/dtcxzyw/WorkSpace/Projects/compilers/LLVM/llvm-build/bin/../lib/../lib/libLLVMCore.so.19.0git+0x315421)
#23 0x00007f6cb3d674c5 llvm::runPassPipeline(llvm::StringRef, llvm::Module&, llvm::TargetMachine*, llvm::TargetLibraryInfoImpl*, llvm::ToolOutputFile*, llvm::ToolOutputFile*, llvm::ToolOutputFile*, llvm::StringRef, llvm::ArrayRef<llvm::PassPlugin>, llvm::ArrayRef<std::function<void (llvm::PassBuilder&)>>, llvm::opt_tool::OutputKind, llvm::opt_tool::VerifierKind, bool, bool, bool, bool, bool, bool, bool) (/home/dtcxzyw/WorkSpace/Projects/compilers/LLVM/llvm-build/bin/../lib/libLLVMOptDriver.so.19.0git+0x234c5)
#24 0x00007f6cb3d72096 optMain (/home/dtcxzyw/WorkSpace/Projects/compilers/LLVM/llvm-build/bin/../lib/libLLVMOptDriver.so.19.0git+0x2e096)
#25 0x00007f6cb3429d90 __libc_start_call_main ./csu/../sysdeps/nptl/libc_start_call_main.h:58:16
#26 0x00007f6cb3429e40 call_init ./csu/../csu/libc-start.c:128:20
#27 0x00007f6cb3429e40 __libc_start_main ./csu/../csu/libc-start.c:379:5
#28 0x000055d247b26095 _start (bin/opt+0x1095)
Aborted (core dumped)

See also dtcxzyw/llvm-opt-benchmark#355.
cc @goldsteinn

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant