[LLVMbugs] [Bug 23312] New: [Backend: R600] UNREACHABLE executed at lib/Target/R600/AMDGPUInstrInfo.cpp:97!

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Apr 22 05:38:47 PDT 2015


https://llvm.org/bugs/show_bug.cgi?id=23312

            Bug ID: 23312
           Summary: [Backend: R600] UNREACHABLE executed at
                    lib/Target/R600/AMDGPUInstrInfo.cpp:97!
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Common Code Generator Code
          Assignee: unassignedbugs at nondot.org
          Reporter: rwindz0 at gmail.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Created attachment 14239
  --> https://llvm.org/bugs/attachment.cgi?id=14239&action=edit
getelementptr.ll

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_iterator<llvm::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_iterator<llvm::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 '<stdin>'.
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.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20150422/34827462/attachment.html>


More information about the llvm-bugs mailing list