Bug 66175

Summary: R600/SI: SETCC for v2i32/v4i32 triggers LLVM assertion
Product: Mesa Reporter: Aaron Watry <awatry>
Component: Drivers/Gallium/radeonsiAssignee: mesa-dev
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: medium    
Version: git   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments: SETCC Test case

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.