<html>
    <head>
      <base href="https://llvm.org/bugs/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW " title="NEW --- - [powerpc-ubuntu] code generation failure for OpenCL with some builtins with double3" href="https://urldefense.proofpoint.com/v2/url?u=https-3A__llvm.org_bugs_show-5Fbug.cgi-3Fid-3D24225&d=AwMBaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=pF93YEPyB-J_PERP4DUZOJDzFVX5ZQ57vQk33wu0vio&m=_0fo-4jwf71_U-_YuHiKy3WKh0KYx4vTdoMrOtucHzU&s=y-Zn2xjyDVsZFi2zDeKeS7UPQWlENKygNAV4TzEVQJg&e=">24225</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>[powerpc-ubuntu] code generation failure for OpenCL with some builtins with double3
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>new-bugs
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>3.6
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Windows NT
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>new bugs
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>kanagak86@yahoo.ca
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvmbugs@cs.uiuc.edu
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=14633" name="attach_14633" title="bugpoint simplified version of the coge gen bug">attachment 14633</a> <a href="attachment.cgi?id=14633&action=edit" title="bugpoint simplified version of the coge gen bug">[details]</a></span>
bugpoint simplified version of the coge gen bug

Code generator bug from PPC64

The attached file causes a crash on PPC64 (Power 8) - Ubuntu 3.16.0-23-generic. 

The workload is from OpenCL built-ins. The bug was reproducible for built-ins
such as fmax, fmin, fract with data type of double & vec size of 3 (=double3).
The bug is found in high optimization (-O3). 

The last revision that it worked on was 3.6 r222776.  

The problem seem to be there for all 3.6.1 and 3.6.2. Last tested on 3.6.2
r242926. 

I have attached simplified version of the code generator bug created from bug
point.  

Thanks!

Here's the snap shot of the Error Info:

llc: SelectionDAG.cpp:5911: void
llvm::SelectionDAG::ReplaceAllUsesWith(llvm::SDNode *, llvm::SDNode *):
Assertion `(!From->hasAnyUseOfValue(i) || From->getValueType(i) ==
To->getValueType(i)) && "Cannot use this version of ReplaceAllUsesWith!"'
failed.
#0 0x10a442a8 llvm::sys::PrintStackTrace(_IO_FILE*)
(/home/kajank/compiler/llvm_362_r242926/Release+Asserts/bin/llc+0x10a442a8)
#1 0x10a45090 PrintStackTraceSignalHandler(void*)
(/home/kajank/compiler/llvm_362_r242926/Release+Asserts/bin/llc+0x10a45090)
#2 0x10a45a3c SignalHandler(int)
(/home/kajank/compiler/llvm_362_r242926/Release+Asserts/bin/llc+0x10a45a3c)
0  llc       0x0000000010a442a8 llvm::sys::PrintStackTrace(_IO_FILE*) + 120
1  llc       0x0000000010a45090
2  llc       0x0000000010a45a3c
3            0x00003fff910f0478 __kernel_sigtramp_rt64 + 0
4  libc.so.6 0x00003fff90c106b8 gsignal + 72
5  libc.so.6 0x00003fff90c1295c abort + 636
6  libc.so.6 0x00003fff90c06274
7  libc.so.6 0x00003fff90c06364 __assert_fail + 100
8  llc       0x0000000010278fac
llvm::SelectionDAG::ReplaceAllUsesWith(llvm::SDNode*, llvm::SDNode*) + 952
9  llc       0x00000000102f972c
llvm::SelectionDAGISel::DoInstructionSelection() + 948
10 llc       0x00000000102f8298 llvm::SelectionDAGISel::CodeGenAndEmitDAG() +
5316
11 llc       0x00000000102f6d58
llvm::SelectionDAGISel::SelectBasicBlock(llvm::ilist_iterator<llvm::Instruction
const>, llvm::ilist_iterator<llvm::Instruction const>, bool&) + 252
12 llc       0x00000000102f5e80
llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&) + 7976
13 llc       0x00000000102f2ba4
llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&) + 1712
14 llc       0x0000000010152c40
15 llc       0x00000000104a08e0
llvm::MachineFunctionPass::runOnFunction(llvm::Function&) + 216
16 llc       0x0000000010947440
llvm::FPPassManager::runOnFunction(llvm::Function&) + 424
17 llc       0x00000000109477a8 llvm::FPPassManager::runOnModule(llvm::Module&)
+ 72
18 llc       0x0000000010947e58
llvm::legacy::PassManagerImpl::run(llvm::Module&) + 1088
19 llc       0x00000000109484cc llvm::legacy::PassManager::run(llvm::Module&) +
28
20 llc       0x00000000100f8b60 main + 7524
21 libc.so.6 0x00003fff90bf4e80
22 libc.so.6 0x00003fff90bf5074 __libc_start_main + 196
Stack dump:
0.      Program arguments: llc bugpoint-reduced-simplified.bc
1.      Running pass 'Function Pass Manager' on module
'bugpoint-reduced-simplified.bc'.
2.      Running pass 'PowerPC DAG->DAG Pattern Instruction Selection' on
function '@__fmax_double3_3D_exec'
Aborted</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>