[llvm] Update amdgpu_gfx functions to use s0-s3 for inreg SGPR arguments on targets using scratch instructions for stack #78226 (PR #81394)

via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 29 07:08:29 PST 2024


SahilPatidar wrote:

And another crash is in this file: llvm/test/CodeGen/AMDGPU/amdgpu-simplify-libcall-pow-codegen.ll.

Assertion failed: (castIsValid(op, S, Ty) && "Invalid cast!"), function Create, file /Users/sahilpatidar/Desktop/llvm-project-17.0.3.src/llvm/lib/IR/Instructions.cpp, line 3427.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0.	Program arguments: opt -mtriple=amdgcn-amd-amdhsa -mcpu=gfx900 -passes=amdgpu-simplifylib,instcombine -amdgpu-prelink
 #0 0x0000000105ee7968 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/usr/local/bin/opt+0x105ba3968)
 #1 0x0000000105ee7ebc PrintStackTraceSignalHandler(void*) (/usr/local/bin/opt+0x105ba3ebc)
 #2 0x0000000105ee5cb8 llvm::sys::RunSignalHandlers() (/usr/local/bin/opt+0x105ba1cb8)
 #3 0x0000000105ee9af4 SignalHandler(int) (/usr/local/bin/opt+0x105ba5af4)
 #4 0x0000000186cbda24 (/usr/lib/system/libsystem_platform.dylib+0x18046da24)
 #5 0x0000000186c8dcc0 (/usr/lib/system/libsystem_pthread.dylib+0x18043dcc0)
 #6 0x0000000186b99a40 (/usr/lib/system/libsystem_c.dylib+0x180349a40)
 #7 0x0000000186b98d30 (/usr/lib/system/libsystem_c.dylib+0x180348d30)
 #8 0x00000001047e7138 llvm::CastInst::Create(llvm::Instruction::CastOps, llvm::Value*, llvm::Type*, llvm::Twine const&, llvm::Instruction*) (/usr/local/bin/opt+0x1044a3138)
 #9 0x0000000105bb2c60 llvm::IRBuilderBase::CreateCast(llvm::Instruction::CastOps, llvm::Value*, llvm::Type*, llvm::Twine const&) (/usr/local/bin/opt+0x10586ec60)
#10 0x0000000105bb2e1c llvm::IRBuilderBase::CreateBitCast(llvm::Value*, llvm::Type*, llvm::Twine const&) (/usr/local/bin/opt+0x10586ee1c)
#11 0x0000000100ee816c llvm::AMDGPULibCalls::fold_pow(llvm::CallInst*, llvm::IRBuilder<llvm::ConstantFolder, llvm::IRBuilderDefaultInserter>&, llvm::AMDGPULibFunc const&) (/usr/local/bin/opt+0x100ba416c)
#12 0x0000000100ee5a70 llvm::AMDGPULibCalls::fold(llvm::CallInst*, llvm::AAResults*) (/usr/local/bin/opt+0x100ba1a70)
#13 0x0000000100eeb4b4 llvm::AMDGPUSimplifyLibCallsPass::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) (/usr/local/bin/opt+0x100ba74b4)
#14 0x0000000101092ee8 llvm::detail::PassModel<llvm::Function, llvm::AMDGPUSimplifyLibCallsPass, llvm::PreservedAnalyses, llvm::AnalysisManager<llvm::Function>>::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) (/usr/local/bin/opt+0x100d4eee8)
#15 0x00000001048f9574 llvm::PassManager<llvm::Function, llvm::AnalysisManager<llvm::Function>>::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) (/usr/local/bin/opt+0x1045b5574)
#16 0x000000010109d3d8 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>&) (/usr/local/bin/opt+0x100d593d8)
#17 0x0000000104900870 llvm::ModuleToFunctionPassAdaptor::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (/usr/local/bin/opt+0x1045bc870)
#18 0x000000010109cf24 llvm::detail::PassModel<llvm::Module, llvm::ModuleToFunctionPassAdaptor, llvm::PreservedAnalyses, llvm::AnalysisManager<llvm::Module>>::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (/usr/local/bin/opt+0x100d58f24)
#19 0x00000001048f8720 llvm::PassManager<llvm::Module, llvm::AnalysisManager<llvm::Module>>::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (/usr/local/bin/opt+0x1045b4720)
#20 0x000000010034ba64 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, bool) (/usr/local/bin/opt+0x100007a64)
#21 0x000000010039e3dc main (/usr/local/bin/opt+0x10005a3dc)
#22 0x000000018690d0e0 
/bin/sh: line 1:  3274 Abort trap: 6           opt -mtriple=amdgcn-amd-amdhsa -mcpu=gfx900 -passes=amdgpu-simplifylib,instcombine -amdgpu-prelink < llvm/test/CodeGen/AMDGPU/amdgpu-simplify-libcall-pow-codegen.ll

https://github.com/llvm/llvm-project/pull/81394


More information about the llvm-commits mailing list