Bug 69897 - OpenCL kernel fails to compile with R600 LLVM backend
Summary: OpenCL kernel fails to compile with R600 LLVM backend
Status: RESOLVED MOVED
Alias: None
Product: Mesa
Classification: Unclassified
Component: Drivers/Gallium/r600 (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: Default DRI bug account
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 99553
  Show dependency treegraph
 
Reported: 2013-09-27 23:25 UTC by Grigori Goronzy
Modified: 2019-09-18 19:05 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
Kernel source code with headers (2.91 KB, application/tar+gzip)
2013-09-27 23:25 UTC, Grigori Goronzy
Details
Possible Fix (1.08 KB, patch)
2013-09-27 23:32 UTC, Tom Stellard
Details | Splinter Review
Possible Fix Part 2 (1.52 KB, patch)
2013-09-27 23:41 UTC, Tom Stellard
Details | Splinter Review
Fix part 3 (6.60 KB, patch)
2013-09-28 00:21 UTC, Tom Stellard
Details | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Grigori Goronzy 2013-09-27 23:25:28 UTC
Created attachment 86758 [details]
Kernel source code with headers

The attached kernel fails to compile with this error message:

PRT: /home/greg/build/llvm/lib/Target/R600/AMDILCFGStructurizer.cpp:1115: int <anonymous namespace>::AMDGPUCFGStructurizer::mergeLoop(llvm::MachineLoop *): Assertion `ExitBlkSet.size() == 1' failed.
Stack dump:
0.	Running pass 'Function Pass Manager' on module 'radeon'.
1.	Running pass 'AMD IL Control Flow Graph structurizer Pass' on function '@shadow_ao'
Comment 1 Tom Stellard 2013-09-27 23:32:17 UTC
Created attachment 86759 [details] [review]
Possible Fix

Does this patch help?
Comment 2 Grigori Goronzy 2013-09-27 23:39:02 UTC
It seems to fix the initial problem, but now I'm getting something else:

PRT: /home/greg/build/llvm/include/llvm/Support/Casting.h:239: typename cast_retty<X, Y *>::ret_type llvm::cast(Y *) [X = llvm::BranchInst, Y = llvm::TerminatorInst]: Assertion `isa<X>(Val) && "cast<Ty>() argument of incompatible type!"' failed.
Stack dump:
0.	Running pass 'Function Pass Manager' on module 'radeon'.
1.	Running pass 'Region Pass Manager' on function '@shadow_ao'
2.	Running pass 'Structurize control flow' on basic block '%if.end100'
Comment 3 Tom Stellard 2013-09-27 23:41:54 UTC
Created attachment 86760 [details] [review]
Possible Fix Part 2

Try applying this patch along with the first fix.
Comment 4 Grigori Goronzy 2013-09-27 23:46:04 UTC
Still fails, but it's getting even further:

LLVM ERROR: Not supported instr: <MCInst 292 <MCOperand Reg:1495> <MCOperand Reg:980> <MCOperand Imm:0> <MCOperand Imm:0>>
Comment 5 Tom Stellard 2013-09-28 00:21:16 UTC
Created attachment 86761 [details] [review]
Fix part 3

Can you try this patch with the other two?
Comment 6 Grigori Goronzy 2013-09-29 14:36:37 UTC
Now it compiles fine, but locks up the GPU. This might be an issue with this particular kernel, though.
Comment 7 Vedran Miletić 2017-02-01 16:41:18 UTC
Grigori, can you repost the kernel?
Comment 8 GitLab Migration User 2019-09-18 19:05:49 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/mesa/mesa/issues/465.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.