Bug 66175 - R600/SI: SETCC for v2i32/v4i32 triggers LLVM assertion
Summary: R600/SI: SETCC for v2i32/v4i32 triggers LLVM assertion
Status: RESOLVED FIXED
Alias: None
Product: Mesa
Classification: Unclassified
Component: Drivers/Gallium/radeonsi (show other bugs)
Version: git
Hardware: Other All
: medium normal
Assignee: mesa-dev
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-06-25 22:01 UTC by Aaron Watry
Modified: 2014-08-21 15:55 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
SETCC Test case (1.45 KB, text/plain)
2013-06-25 22:01 UTC, Aaron Watry
Details

Description Aaron Watry 2013-06-25 22:01:13 UTC
Created attachment 81429 [details]
SETCC Test case

When performing vector comparisons, the R600/SI back-end is tripping over an LLVM assertion due to what appears to be an incorrectly lowered SETCC operation:

llc: /home/awatry/src/llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp:522: llvm::SDValue llvm::DAGTypeLegalizer::PromoteIntRes_SETCC(llvm::SDNode*): Assertion `SVT.isVector() == N->getOperand(0).getValueType().isVector() && "Vector compare must return a vector result!"' failed.

Test case is attached.

Note that this test case just verifies that the assembly compiles and doesn't presume any specific expected output.

SETCC will need to be fixed in order for a number of OpenCL comparisons and piglit tests to pass.
Comment 1 Tom Stellard 2013-06-27 16:47:43 UTC
This patch should fix the crash:
http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20130624/179336.html
Comment 2 Aaron Watry 2013-07-05 19:07:54 UTC
The patch fixes the crash in that LLVM (llc specifically) now goes into an infinite loop.

Note: I tested this with your 10-patch KCache/cleanup/mul24/mad24 series applied (the same revised patches I sent to llvm-commits earlier this week).

I haven't had any time yet to look into where it's getting stuck... Feel free to try to track it down if I don't respond in the next few days.
Comment 3 Aaron Watry 2013-07-17 01:07:32 UTC
Looks like it's infinitely looping in and out of getSetCCResultType in SIISelLowering.cpp.

I'll have to read up a bit and try to figure out the next move.
Comment 4 Tom Stellard 2014-08-21 15:55:42 UTC
This is working now.


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.