[LLVMbugs] [Bug 22322] New: [NVPTX] llc error on select with llvm.ptx.read.* TargetConstant

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sat Jan 24 06:26:49 PST 2015


http://llvm.org/bugs/show_bug.cgi?id=22322

            Bug ID: 22322
           Summary: [NVPTX] llc error on select with llvm.ptx.read.*
                    TargetConstant
           Product: libraries
           Version: trunk
          Hardware: Other
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Backend: PTX
          Assignee: justin.holewinski at gmail.com
          Reporter: florian.ziesche+llvm at gmail.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Created attachment 13728
  --> http://llvm.org/bugs/attachment.cgi?id=13728&action=edit
the error producing .ll file

when compiling the attached .ll or .cpp file to ptx, llc errors with:
LLVM ERROR: Cannot select: 0x1a61188: i1 = setcc 0x1a60d68, 0x1a60b58,
0x1a61080 [ORD=15] [ID=30]
  0x1a60d68: f32 = select 0x1a60a50, 0x1a60b58, 0x1a60c60 [ORD=13] [ID=27]
    0x1a60a50: i1 = setcc 0x1a60738, 0x1a60840, 0x1a60948 [ORD=12] [ID=25]
      0x1a60738: i32 = and 0x1a5f358, 0x1a60630 [ORD=11] [ID=23]
        0x1a5f358: i32 = NVPTXISD::IMAD 0x1a5ee30, 0x1a5ec20, 0x1a5f148 [ORD=7]
[ID=22]
          0x1a5ee30: i32 = llvm.ptx.read.ntid.x 0x1a5ed28 [ORD=4] [ID=19]
            0x1a5ed28: i64 = TargetConstant<3016> [ID=4]
          0x1a5ec20: i32 = llvm.ptx.read.ctaid.x 0x1a5eb18 [ORD=3] [ID=18]
            0x1a5eb18: i64 = TargetConstant<3000> [ID=3]
          0x1a5f148: i32 = llvm.ptx.read.tid.x 0x1a5f040 [ORD=6] [ID=20]
            0x1a5f040: i64 = TargetConstant<3026> [ID=5]
        0x1a60630: i32 = Constant<15> [ID=8]
      0x1a60840: i32 = Constant<0> [ID=9]
    0x1a60b58: f32 = ConstantFP<0.000000e+00> [ID=11]
    0x1a60c60: f32 = ConstantFP<-1.000000e+00> [ID=12]
  0x1a60b58: f32 = ConstantFP<0.000000e+00> [ID=11]
In function: some_kernel


Steps to Reproduce:
using the .ll file: cat ptx_select_error.ll | llc -mcpu=sm_30
using the .cpp file: clang++ -x cuda -std=cuda -target nvptx64-nvidia-cuda
-Xclang -fcuda-is-device -Ofast -emit-llvm -S -o - ptx_select_error.cpp | llc
-mcpu=sm_30


some notes:
* neither the sm_xx target nor the bitness matter here
* I've confirmed this bug with clang/llvm 3.5.0 on OS X, 3.5.1 on Linux and 3.6
rc1 on OS X
* compiling the .cpp file in any other -O mode than -Ofast results in an .ll
file that llc has no problems with (then again, even with -O3 it's about twice
as long and there are still branch instructions)
* the problematic select instruction is "%9 = select i1 %8, float 0.000000e+00,
float -1.000000e+00"

-- 
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/20150124/813865fd/attachment.html>


More information about the llvm-bugs mailing list