Mesa unit test lp_test_blend regressed starting at llvm-3.6.0svn r217548. $ ./build/linux-x86_64-debug/bin/lp_test_blend type=u8nx16 rgb_func=sub rgb_src_factor=zero rgb_dst_factor=inv_src_color alpha_func=rev_sub alpha_src_factor=one alpha_dst_factor=const_color ... MISMATCH Src: 0 0 0 d2 0 c0 94 0 0 0 bb 35 28 40 9e 49 Src1: 0 23 0 0 f7 51 0 8 0 cf bb 99 0 7d 3c a2 Dst: 0 0 0 b3 eb 41 d1 0 81 0 0 22 0 0 67 6b Con: 0 0 76 e1 0 0 0 0 3e 0 0 0 0 0 0 17 Res: 0 0 0 70 0 0 0 0 0 0 0 0 0 0 0 0 Ref: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 type=u8nx16 rgb_func=rev_sub rgb_src_factor=zero rgb_dst_factor=const_alpha alpha_func=rev_sub alpha_src_factor=one alpha_dst_factor=inv_dst_alpha ... MISMATCH Src: be 0 0 64 0 0 0 2 0 0 0 0 0 5f c6 0 Src1: 0 0 0 0 0 0 f0 8a 0 59 94 0 33 0 0 0 Dst: 4d 0 49 a8 7 6a 0 57 0 cb a2 0 0 cf 0 0 Con: 83 0 0 0 0 9d 97 0 a5 0 b6 1e 0 5c 0 9 Res: 0 0 0 0 0 0 0 0 0 18 13 0 0 7 0 0 Ref: 0 0 0 0 0 0 0 37 0 18 13 0 0 7 0 0 type=u8nx16 rgb_func=add rgb_src_factor=one rgb_dst_factor=const_color alpha_func=min alpha_src_factor=zero alpha_dst_factor=inv_src1_color ... MISMATCH Src: 0 0 61 0 0 bb 0 0 0 d0 4d 0 0 0 b6 14 Src1: 8a 76 0 0 0 33 0 0 0 0 0 0 f4 7 b5 24 Dst: 87 0 b5 ef 0 a0 0 ba 0 0 cf bb c0 0 0 0 Con: 0 0 ea 0 0 0 0 76 0 2b 0 70 a9 ec 77 ed Res: 0 0 ff 0 0 45 0 0 0 30 b4 0 7f 0 4a 0 Ref: 0 0 ff 0 0 bb 0 0 0 d0 4d 0 7f 0 b6 0 # first bad commit: [3b670550ad8b4e77bae1cf265f73ea814b8a9cd5] Add doInitialization/doFinalization to DataLayoutPass. commit 3b670550ad8b4e77bae1cf265f73ea814b8a9cd5 Author: Rafael Espindola <rafael.espindola@gmail.com> Date: Wed Sep 10 21:27:43 2014 +0000 Add doInitialization/doFinalization to DataLayoutPass. With this a DataLayoutPass can be reused for multiple modules. Once we have doInitialization/doFinalization, it doesn't seem necessary to pass a Module to the constructor. Overall this change seems in line with the idea of making DataLayout a required part of Module. With it the only way of having a DataLayout used is to add it to the Module. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@217548 91177308-0d34-0410-b5e6-96231b3b80d8
Are there instructions somewhere on how to build this test?
(In reply to comment #1) > Are there instructions somewhere on how to build this test? You'd need to get mesa (the released versions won't build with unreleased llvm versions, so you need to clone it from git://anongit.freedesktop.org/mesa/mesa), then if you use scons something like LLVM=path_to_llvm_dir scons lp_test_blend should do (though it will build other stuff too). You can also use automake, I guess the tests should get built by default too. A quick look at our code seems to indicate we construct the layout data from a string with LLVMCreateTargetData() and add it to the pass manager with LLVMAddTargetData() but I have no idea how this actually works...
scons worked, thanks. With configure I was getting: ../../../../mesa/src/gallium/auxiliary/draw/draw_vs.h:166:5: error: hexadecimal floating constants require an exponent #if HAVE_LLVM I think the attached patch should fix the problem. Can you give it a try?
Created attachment 13019 [details] fix it
(In reply to comment #4) > Created attachment 13019 [details] > fix it attachment 13019 [details] fixes lp_test_blend with llvm-3.6.0svn. Also tested that lp_test_blend still builds and passes with llvm-3.4. Tested-by: Vinson Lee <vlee@freedesktop.org>
Ping. This failure is still present with latest llvm and mesa.
(In reply to comment #6) > Ping. This failure is still present with latest llvm and mesa. Any reason not to use the proposed mesa patch? Long term we (llvm) want to make DataLayout an integral part of the Module. Some parts of llvm were already extracting the DataLayout from the module instead of the pass. The recent change made the pass itself reset its DataLayout using the current module one.
The patch looks good to me, I'm going to apply it. I think it is somewhat odd that now the layout is attached both to the pass manager and the module but it looks like this should work just fine. Feel free to close this bug, looks though there's no NOTOURBUG category ;-). Thanks for the patch!
This is an unfortunate pain as we move to make the DataLayout be part of the Module. Closing it as such.