Skip to content

[NVPTX] Unhandled source type UNREACHABLE executed at NVPTXISelDAGToDAG.cpp:3808! #98033

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

Closed
d0k opened this issue Jul 8, 2024 · 2 comments
Closed

Comments

@d0k
Copy link
Member

d0k commented Jul 8, 2024

target datalayout = "e-i64:64-i128:128-v16:16-v32:32-n16:32:64"
target triple = "nvptx64"

define void @loop_slice_fusion_5(ptr noalias readonly %0) {
._crit_edge:
  %1 = load i1, ptr %0, align 1
  %2 = zext i1 %1 to i32
  %3 = add i32 %2, 1
  %4 = and i32 %3, 1
  store i32 %4, ptr null, align 2
  ret void
}

!nvvm.annotations = !{!0, !1}

!0 = !{ptr @loop_slice_fusion_5, !"kernel", i32 1}
!1 = !{ptr @loop_slice_fusion_5, !"reqntidx", i32 128}
$ llc < t.ll -mcpu=sm_80

Unhandled source type
UNREACHABLE executed at llvm/lib/Target/NVPTX/NVPTXISelDAGToDAG.cpp:3808!
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0.      Program arguments: llc -mcpu=sm_80 -debug
1.      Running pass 'Function Pass Manager' on module '<stdin>'.
2.      Running pass 'NVPTX DAG->DAG Pattern Instruction Selection' on function '@loop_slice_fusion_5'
 #0 0x00005606095885d4 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (llc+0x69e15d4)
 #1 0x000056060958617e llvm::sys::RunSignalHandlers() (llc+0x69df17e)
 #2 0x0000560609588978 SignalHandler(int) Signals.cpp:0:0
 #3 0x00007f1a26e5a510 (/lib/x86_64-linux-gnu/libc.so.6+0x3c510)
 #4 0x00007f1a26ea816c __pthread_kill_implementation ./nptl/pthread_kill.c:44:76
 #5 0x00007f1a26e5a472 raise ./signal/../sysdeps/posix/raise.c:27:6
 #6 0x00007f1a26e444b2 abort ./stdlib/abort.c:81:7
 #7 0x00005606094f2e30 llvm::install_out_of_memory_new_handler() (llc+0x694be30)
 #8 0x00005606077c221d llvm::NVPTXDAGToDAGISel::GetConvertOpcode(llvm::MVT, llvm::MVT, llvm::LoadSDNode*) NVPTXISelDAGToDAG.cpp:0:0
 #9 0x00005606077bcd05 llvm::NVPTXDAGToDAGISel::tryLDGLDU(llvm::SDNode*) NVPTXISelDAGToDAG.cpp:0:0
#10 0x00005606077b892f llvm::NVPTXDAGToDAGISel::tryLoad(llvm::SDNode*) NVPTXISelDAGToDAG.cpp:0:0
#11 0x00005606077b8747 llvm::NVPTXDAGToDAGISel::Select(llvm::SDNode*) NVPTXISelDAGToDAG.cpp:0:0
#12 0x000056060938eb9f llvm::SelectionDAGISel::DoInstructionSelection() (llc+0x67e7b9f)
#13 0x000056060938dba9 llvm::SelectionDAGISel::CodeGenAndEmitDAG() (llc+0x67e6ba9)
#14 0x000056060938b50c llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&) (llc+0x67e450c)
#15 0x00005606093887aa llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&) (llc+0x67e17aa)
#16 0x0000560609386146 llvm::SelectionDAGISelLegacy::runOnMachineFunction(llvm::MachineFunction&) (llc+0x67df146)
#17 0x000056060868bec2 llvm::MachineFunctionPass::runOnFunction(llvm::Function&) (llc+0x5ae4ec2)
#18 0x0000560608b9e5bc llvm::FPPassManager::runOnFunction(llvm::Function&) (llc+0x5ff75bc)
#19 0x0000560608ba6c22 llvm::FPPassManager::runOnModule(llvm::Module&) (llc+0x5fffc22)
#20 0x0000560608b9f137 llvm::legacy::PassManagerImpl::run(llvm::Module&) (llc+0x5ff8137)
#21 0x00005606069dccf3 main (llc+0x3e35cf3)
#22 0x00007f1a26e456ca __libc_start_call_main ./csu/../sysdeps/nptl/libc_start_call_main.h:74:3
#23 0x00007f1a26e45785 call_init ./csu/../csu/libc-start.c:128:20
#24 0x00007f1a26e45785 __libc_start_main ./csu/../csu/libc-start.c:347:5
#25 0x00005606069d6c21 _start (llc+0x3e2fc21)
copybara-service bot pushed a commit to openxla/xla that referenced this issue Jul 12, 2024
The ptx backend chokes on loads/stores of i1s, see
llvm/llvm-project#98033

PiperOrigin-RevId: 651735636
copybara-service bot pushed a commit to openxla/xla that referenced this issue Jul 12, 2024
The ptx backend chokes on loads/stores of i1s, see
llvm/llvm-project#98033

PiperOrigin-RevId: 651735636
copybara-service bot pushed a commit to tensorflow/tensorflow that referenced this issue Jul 12, 2024
The ptx backend chokes on loads/stores of i1s, see
llvm/llvm-project#98033

PiperOrigin-RevId: 651735636
Artem-B pushed a commit that referenced this issue Jul 18, 2024
Currently, an illegal 2-byte load from a 1-byte global variable is being
generated. This change instead generates a 1-byte load and zero-extends
it to i16 register. This was always the intended behavior of the
function.

In addition, an i1 ext load of any kind needs to be promoted. A missing
setLoadExtAction for ISD::EXTLOAD was causing an "Unhandled source type"
unreachable due to an illegal i1 ext load during ISelDAGtoDAG (see below
bug).

Bug #98033.
@mjulian31
Copy link
Contributor

@d0k - this issue should now be fixed by my commit #99392. Please check if you are still seeing the bug.

@d0k
Copy link
Member Author

d0k commented Jul 23, 2024

Issue is gone, thanks.

@d0k d0k closed this as completed Jul 23, 2024
yuxuanchen1997 pushed a commit that referenced this issue Jul 25, 2024
Summary:
Currently, an illegal 2-byte load from a 1-byte global variable is being
generated. This change instead generates a 1-byte load and zero-extends
it to i16 register. This was always the intended behavior of the
function.

In addition, an i1 ext load of any kind needs to be promoted. A missing
setLoadExtAction for ISD::EXTLOAD was causing an "Unhandled source type"
unreachable due to an illegal i1 ext load during ISelDAGtoDAG (see below
bug).

Bug #98033.

Test Plan: 

Reviewers: 

Subscribers: 

Tasks: 

Tags: 


Differential Revision: https://phabricator.intern.facebook.com/D60251000
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

2 participants