Skip to content

Instantly share code, notes, and snippets.

@Artem-B
Created June 16, 2021 22:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Artem-B/44d8fa3f1bf0a3c992f4fe5bcf678c3f to your computer and use it in GitHub Desktop.
Save Artem-B/44d8fa3f1bf0a3c992f4fe5bcf678c3f to your computer and use it in GitHub Desktop.
; ModuleID = 'repro.ll'
source_filename = "blaze-out/k8-opt/genfiles/third_party/amdgpu/rocFFT/kernels/kernels_273.cpp"
target datalayout = "e-p:64:64-p1:64:64-p2:32:32-p3:32:32-p4:64:64-p5:32:32-p6:32:32-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024-v2048:2048-n32:64-S32-A5-G1-ni:7"
target triple = "amdgcn-amd-amdhsa"
%struct.ham = type { %struct.zot }
%struct.zot = type { %struct.quux }
%struct.quux = type { <2 x double> }
$_ZZ22fft_fwd_ip_len100_sbccI15HIP_vector_typeIdLj2EEL9StrideBin0ELb1EEvPKT_S5_mPKmS7_mPS3_E3lds = comdat any
@global = linkonce_odr hidden addrspace(3) global [505 x %struct.ham] undef, comdat($_ZZ22fft_fwd_ip_len100_sbccI15HIP_vector_typeIdLj2EEL9StrideBin0ELb1EEvPKT_S5_mPKmS7_mPS3_E3lds), align 16
define protected amdgpu_kernel void @wombat() local_unnamed_addr align 32 {
bb42:
tail call fastcc void undef(%struct.ham* undef, %struct.ham* undef, i32 undef, i32 undef, i32 undef, %struct.ham* getelementptr inbounds ([505 x %struct.ham], [505 x %struct.ham]* addrspacecast ([505 x %struct.ham] addrspace(3)* @global to [505 x %struct.ham]*), i64 0, i64 0), %struct.ham* getelementptr inbounds ([505 x %struct.ham], [505 x %struct.ham]* addrspacecast ([505 x %struct.ham] addrspace(3)* @global to [505 x %struct.ham]*), i64 0, i64 0), %struct.ham* getelementptr inbounds ([505 x %struct.ham], [505 x %struct.ham]* addrspacecast ([505 x %struct.ham] addrspace(3)* @global to [505 x %struct.ham]*), i64 0, i64 0))
ret void
}
; Function Attrs: convergent nounwind willreturn
declare void @llvm.amdgcn.s.barrier() #0
; Function Attrs: nounwind readnone speculatable willreturn
declare align 4 i8 addrspace(4)* @llvm.amdgcn.dispatch.ptr() #1
; Function Attrs: nounwind readnone speculatable willreturn
declare i32 @llvm.amdgcn.workitem.id.x() #1
; Function Attrs: nounwind readnone speculatable willreturn
declare i32 @llvm.amdgcn.workgroup.id.x() #1
attributes #0 = { convergent nounwind willreturn }
attributes #1 = { nounwind readnone speculatable willreturn }
!llvm.module.flags = !{!0, !1, !2}
!opencl.ocl.version = !{!3}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 7, !"PIC Level", i32 1}
!2 = !{i32 7, !"frame-pointer", i32 1}
!3 = !{i32 2, i32 0}
@Artem-B
Copy link
Author

Artem-B commented Jun 16, 2021

../bin/opt -amdgpu-lower-module-lds -disable-output reduced.ll
opt: /usr/local/google/home/tra/work/llvm/repo/llvm/include/llvm/Support/Casting.h:269: typename cast_retty<X, Y *>::ret_type llvm::cast(Y *) [X = llvm::PointerType, Y = llvm::Type]: Assertion `isa<X>(Val) && "cast<Ty>() argument of incompatible type!"' failed.
...
#10 0x00007fffecf208c7 llvm::cast_retty<llvm::PointerType, llvm::Type*>::ret_type llvm::cast<llvm::PointerType, llvm::Type>(llvm::Type*) /usr/local/google/home/tra/work/llvm/repo/llvm/include/llvm/Support/Casting.h:270:10
#11 0x00007fffecffe772 llvm::GetElementPtrInst::Create(llvm::Type*, llvm::Value*, llvm::ArrayRef<llvm::Value*>, llvm::Twine const&, llvm::Instruction*) /usr/local/google/home/tra/work/llvm/repo/llvm/include/llvm/IR/Instructions.h:966:7
#12 0x00007fffecffe66d llvm::GetElementPtrInst::CreateInBounds(llvm::Type*, llvm::Value*, llvm::ArrayRef<llvm::Value*>, llvm::Twine const&, llvm::Instruction*) /usr/local/google/home/tra/work/llvm/repo/llvm/include/llvm/IR/Instructions.h:1002:24
#13 0x00007fffecff650f llvm::ConstantExpr::getAsInstruction() const /usr/local/google/home/tra/work/llvm/repo/llvm/lib/IR/Constants.cpp:3518:7
#14 0x00007fffed2c0c66 llvm::convertConstantExprsToInstructions(llvm::Instruction*, std::map<llvm::Use*, std::vector<std::vector<llvm::ConstantExpr*, std::allocator<llvm::ConstantExpr*> >, std::allocator<std::vector<llvm::ConstantExpr*, std::allocator<llvm::ConstantExpr*> > > >, std::less<llvm::Use*>, std::allocator<std::pair<llvm::Use* const, std::vector<std::vector<llvm::ConstantExpr*, std::allocator<llvm::ConstantExpr*> >, std::allocator<std::vector<llvm::ConstantExpr*, std::allocator<llvm::ConstantExpr*> > > > > > >&, llvm::SmallPtrSetImpl<llvm::Instruction*>*) /usr/local/google/home/tra/work/llvm/repo/llvm/lib/IR/ReplaceConstant.cpp:110:15
#15 0x00007fffed2c05ef llvm::convertConstantExprsToInstructions(llvm::Instruction*, llvm::ConstantExpr*, llvm::SmallPtrSetImpl<llvm::Instruction*>*) /usr/local/google/home/tra/work/llvm/repo/llvm/lib/IR/ReplaceConstant.cpp:81:1
#16 0x00007fffebeb1c25 llvm::AMDGPU::replaceConstantUsesInFunction(llvm::ConstantExpr*, llvm::Function const*) /usr/local/google/home/tra/work/llvm/repo/llvm/lib/Target/AMDGPU/Utils/AMDGPULDSUtils.cpp:58:23
#17 0x00007ffff6ca5b2f (anonymous namespace)::AMDGPULowerModuleLDS::processUsedLDS(llvm::Module&, llvm::Function*) /usr/local/google/home/tra/work/llvm/repo/llvm/lib/Target/AMDGPU/AMDGPULowerModuleLDSPass.cpp:297:9
#18 0x00007ffff6ca4ec9 (anonymous namespace)::AMDGPULowerModuleLDS::runOnModule(llvm::Module&) /usr/local/google/home/tra/work/llvm/repo/llvm/lib/Target/AMDGPU/AMDGPULowerModuleLDSPass.cpp:160:18
#19 0x00007fffed1ee488 (anonymous namespace)::MPPassManager::runOnModule(llvm::Module&) /usr/local/google/home/tra/work/llvm/repo/llvm/lib/IR/LegacyPassManager.cpp:1554:23
#20 0x00007fffed1edfb5 llvm::legacy::PassManagerImpl::run(llvm::Module&) /usr/local/google/home/tra/work/llvm/repo/llvm/lib/IR/LegacyPassManager.cpp:542:16
#21 0x00007fffed1f32a1 llvm::legacy::PassManager::run(llvm::Module&) /usr/local/google/home/tra/work/llvm/repo/llvm/lib/IR/LegacyPassManager.cpp:1681:3
#22 0x00000000002c372d main /usr/local/google/home/tra/work/llvm/repo/llvm/tools/opt/opt.cpp:1070:3
#23 0x00007fffec065d0a __libc_start_main ./csu/../csu/libc-start.c:308:16
#24 0x000000000028002a _start (../bin/opt+0x28002a)

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