LLVM Bugzilla is read-only and represents the historical archive of all LLVM issues filled before November 26, 2021. Use github to submit LLVM bugs

Bug 20903 - Mesa llvmpipe lp_test_blend regression
Summary: Mesa llvmpipe lp_test_blend regression
Status: RESOLVED WONTFIX
Alias: None
Product: new-bugs
Classification: Unclassified
Component: new bugs (show other bugs)
Version: trunk
Hardware: PC All
: P normal
Assignee: Unassigned LLVM Bugs
URL:
Keywords: regression
Depends on:
Blocks:
 
Reported: 2014-09-11 00:22 PDT by Vinson Lee
Modified: 2014-09-15 12:17 PDT (History)
6 users (show)

See Also:
Fixed By Commit(s):


Attachments
fix it (1018 bytes, patch)
2014-09-11 10:17 PDT, Rafael Ávila de Espíndola
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Vinson Lee 2014-09-11 00:22:39 PDT
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
Comment 1 Rafael Ávila de Espíndola 2014-09-11 08:32:28 PDT
Are there instructions somewhere on how to build this test?
Comment 2 sroland 2014-09-11 09:30:09 PDT
(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...
Comment 3 Rafael Ávila de Espíndola 2014-09-11 10:16:58 PDT
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?
Comment 4 Rafael Ávila de Espíndola 2014-09-11 10:17:16 PDT
Created attachment 13019 [details]
fix it
Comment 5 Vinson Lee 2014-09-11 18:46:43 PDT
(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>
Comment 6 Vinson Lee 2014-09-15 11:30:22 PDT
Ping. This failure is still present with latest llvm and mesa.
Comment 7 Rafael Ávila de Espíndola 2014-09-15 11:50:22 PDT
(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.
Comment 8 sroland 2014-09-15 11:59:53 PDT
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!
Comment 9 Rafael Ávila de Espíndola 2014-09-15 12:17:55 PDT
This is an unfortunate pain as we move to make the DataLayout be part of the Module. Closing it as such.