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

[Backend: R600] UNREACHABLE executed at lib/Target/R600/AMDGPUInstrInfo.cpp:97! #23686

Closed
llvmbot opened this issue Apr 22, 2015 · 1 comment
Closed
Labels
bugzilla Issues migrated from bugzilla llvm:codegen wontfix Issue is real, but we can't or won't fix it. Not invalid

Comments

@llvmbot
Copy link
Collaborator

llvmbot commented Apr 22, 2015

Bugzilla Link 23312
Resolution WONTFIX
Resolved on Mar 07, 2016 10:18
Version trunk
OS Linux
Attachments getelementptr.ll
Reporter LLVM Bugzilla Contributor
CC @chfast,@arsenm

Extended Description

The testcase in platform-independent fix rL231984 reveals possible issues with R600 backend.

The below lines are identical to test/CodeGen/X86/getelementptr.ll

; RUN: llc < %s -O0 -march=r600
; RUN: llc < %s -O2 -march=r600

define i8* @​test_trunc65(i8* %ptr) nounwind {
; CHECK-LABEL: test_trunc65
; CHECK: 3
%d = getelementptr i8, i8* %ptr, i65 18446744073709551619 ; 2^64 + 3
ret i8* %d
}

define i8* @​test_trunc128(i8* %ptr) nounwind {
; CHECK-LABEL: test_trunc128
; CHECK: 5
%d = getelementptr i8, i8* %ptr, i128 18446744073709551621 ; 2^64 + 5
ret i8* %d
}

define i8* @​test_trunc160(i8* %ptr) nounwind {
; CHECK-LABEL: test_trunc160
; CHECK: 8
%d = getelementptr i8, i8* %ptr, i160 18446744073709551624 ; 2^64 + 8
ret i8* %d
}

define i8* @​test_trunc256(i8* %ptr) nounwind {
; CHECK-LABEL: test_trunc256
; CHECK: 13
%d = getelementptr i8, i8* %ptr, i256 18446744073709551629 ; 2^64 + 13
ret i8* %d
}

define i8* @​test_trunc2048(i8* %ptr) nounwind {
; CHECK-LABEL: test_trunc2048
; CHECK: 21
%d = getelementptr i8, i8* %ptr, i2048 18446744073709551637 ; 2^64 + 21
ret i8* %d
}

; Test small index sext to pointer size

define i8* @​test_sext3(i8* %ptr) nounwind {
; CHECK-LABEL: test_sext3
; CHECK: -3
%d = getelementptr i8, i8* %ptr, i3 -3
ret i8* %d
}

define i8* @​test_sext5(i8* %ptr) nounwind {
; CHECK-LABEL: test_sext5
; CHECK: -5
%d = getelementptr i8, i8* %ptr, i5 -5
ret i8* %d
}

define i8* @​test_sext8(i8* %ptr) nounwind {
; CHECK-LABEL: test_sext8
; CHECK: -8
%d = getelementptr i8, i8* %ptr, i8 -8
ret i8* %d
}

define i8* @​test_sext13(i8* %ptr) nounwind {
; CHECK-LABEL: test_sext13
; CHECK: -13
%d = getelementptr i8, i8* %ptr, i8 -13
ret i8* %d
}

define i8* @​test_sext16(i8* %ptr) nounwind {
; CHECK-LABEL: test_sext16
; CHECK: -21
%d = getelementptr i8, i8* %ptr, i8 -21
ret i8* %d
}

backtrace:
$llc -O0 -march=r600

Not Implemented
UNREACHABLE executed at /home/ch/sources-llvm/llvm/lib/Target/R600/AMDGPUInstrInfo.cpp:97!
#​0 0x1e6902e llvm::sys::PrintStackTrace(llvm::raw_ostream&) /home/ch/sources-llvm/llvm/lib/Support/Unix/Signals.inc:424:15
#​1 0x1e69fa9 PrintStackTraceSignalHandler(void*) /home/ch/sources-llvm/llvm/lib/Support/Unix/Signals.inc:483:1
#​2 0x1e6a483 SignalHandler(int) /home/ch/sources-llvm/llvm/lib/Support/Unix/Signals.inc:199:60
#​3 0x7f6b0c99a8d0 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0xf8d0)
#​4 0x7f6b0bbda107 gsignal /build/glibc-Ir_s5K/glibc-2.19/signal/../nptl/sysdeps/unix/sysv/linux/raise.c:56:0
#​5 0x7f6b0bbdb4e8 abort /build/glibc-Ir_s5K/glibc-2.19/stdlib/abort.c:91:0
#​6 0x1e1b356 (/home/ch/build-debug/bin/llc+0x1e1b356)
#​7 0xf081e8 /home/ch/sources-llvm/llvm/lib/Target/R600/AMDGPUInstrInfo.cpp:97:3
#​8 0x168d423 (anonymous namespace)::RAFast::spillVirtReg(llvm::MachineBasicBlock::bundle_iterator<llvm::MachineInstr, llvm::ilist_iteratorllvm::MachineInstr >, (anonymous namespace)::RAFast::LiveReg*) /home/ch/sources-llvm/llvm/lib/CodeGen/RegAllocFast.cpp:290:5
#​9 0x168b63b (anonymous namespace)::RAFast::spillAll(llvm::MachineBasicBlock::bundle_iterator<llvm::MachineInstr, llvm::ilist_iteratorllvm::MachineInstr >) /home/ch/sources-llvm/llvm/lib/CodeGen/RegAllocFast.cpp:334:16
#​10 0x1689914 (anonymous namespace)::RAFast::AllocateBasicBlock() /home/ch/sources-llvm/llvm/lib/CodeGen/RegAllocFast.cpp:1067:3
#​11 0x1687e50 (anonymous namespace)::RAFast::runOnMachineFunction(llvm::MachineFunction&) /home/ch/sources-llvm/llvm/lib/CodeGen/RegAllocFast.cpp:1103:5
#​12 0x15e142e llvm::MachineFunctionPass::runOnFunction(llvm::Function&) /home/ch/sources-llvm/llvm/lib/CodeGen/MachineFunctionPass.cpp:40:3
#​13 0x19bd31d llvm::FPPassManager::runOnFunction(llvm::Function&) /home/ch/sources-llvm/llvm/lib/IR/LegacyPassManager.cpp:1538:23
#​14 0x19bd628 llvm::FPPassManager::runOnModule(llvm::Module&) /home/ch/sources-llvm/llvm/lib/IR/LegacyPassManager.cpp:1558:16
#​15 0x19bdce9 (anonymous namespace)::MPPassManager::runOnModule(llvm::Module&) /home/ch/sources-llvm/llvm/lib/IR/LegacyPassManager.cpp:1616:23
#​16 0x19bd8de llvm::legacy::PassManagerImpl::run(llvm::Module&) /home/ch/sources-llvm/llvm/lib/IR/LegacyPassManager.cpp:1723:16
#​17 0x19be191 llvm::legacy::PassManager::run(llvm::Module&) /home/ch/sources-llvm/llvm/lib/IR/LegacyPassManager.cpp:1756:3
#​18 0x784481 compileModule(char**, llvm::LLVMContext&) /home/ch/sources-llvm/llvm/tools/llc/llc.cpp:378:3
#​19 0x7832f6 main /home/ch/sources-llvm/llvm/tools/llc/llc.cpp:201:13
#​20 0x7f6b0bbc6b45 __libc_start_main /build/glibc-Ir_s5K/glibc-2.19/csu/libc-start.c:321:0
#​21 0x783014 _start (/home/ch/build-debug/bin/llc+0x783014)
Stack dump:
0. Program arguments: /home/ch/build-debug/bin/llc -O0 -march=r600

  1. Running pass 'Function Pass Manager' on module ''.
  2. Running pass 'Fast Register Allocator' on function '@test_trunc65'

$llc -O2 -march=r600 seems fine

I used a llvm trunk/235497 built on Linux.

@arsenm
Copy link
Contributor

arsenm commented Mar 7, 2016

This is from r600 not implementing register spilling. It works on amdgcn. This will be fixed if anyone ever comes and implements it, but there aren't any plans to add new features for r600. It's surprising that any of these tests get that far, since return values don't work for kernel functions, so functions like this end up empty.

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 10, 2021
@Quuxplusone Quuxplusone added the wontfix Issue is real, but we can't or won't fix it. Not invalid label Jan 20, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla Issues migrated from bugzilla llvm:codegen wontfix Issue is real, but we can't or won't fix it. Not invalid
Projects
None yet
Development

No branches or pull requests

3 participants