Bug 107653

Summary: lp_test_blend fails with llvm-8.0svn
Product: Mesa Reporter: Vinson Lee <vlee>
Component: Mesa coreAssignee: mesa-dev
Status: RESOLVED DUPLICATE QA Contact: mesa-dev
Severity: normal    
Priority: medium CC: sroland
Version: gitKeywords: bisected, regression
Hardware: x86-64 (AMD64)   
OS: All   
Whiteboard:
i915 platform: i915 features:

Description Vinson Lee 2018-08-22 00:18:44 UTC
$ ./build/darwin-x86_64-debug/gallium/drivers/llvmpipe/lp_test_blend -v
 type=f32x4 rgb_func=rev_sub rgb_src_factor=src1_color rgb_dst_factor=src1_alpha alpha_func=max alpha_src_factor=inv_src1_color alpha_dst_factor=inv_dst_color ...
 type=f32x4 rgb_func=add rgb_src_factor=inv_src_color rgb_dst_factor=src1_alpha alpha_func=add alpha_src_factor=src_color alpha_dst_factor=one ...
 type=u8nx16 rgb_func=sub rgb_src_factor=src_alpha rgb_dst_factor=inv_src_alpha alpha_func=add alpha_src_factor=inv_src1_alpha alpha_dst_factor=const_color ...
Segmentation fault: 11


* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x0)
    frame #0: 0x0000000000000000
error: memory read failed for 0x0
Target 0: (lp_test_blend) stopped.
(lldb) bt
* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x0)
  * frame #0: 0x0000000000000000
    frame #1: 0x0000000105f25131
    frame #2: 0x0000000100003211 lp_test_blend`test_one(verbose=1, fp=0x0000000000000000, blend=0x00007ffeefbff6c0, type=(floating = 0, fixed = 0, sign = 0, norm = 1, width = 8, length = 16)) at lp_test_blend.c:504
    frame #3: 0x00000001000039f5 lp_test_blend`test_some(verbose=1, fp=0x0000000000000000, n=1000) at lp_test_blend.c:727
    frame #4: 0x00000001000069c3 lp_test_blend`main(argc=2, argv=0x00007ffeefbff7a8) at lp_test_main.c:419
    frame #5: 0x00007fff5358c015 libdyld.dylib`start + 1
    frame #6: 0x00007fff5358c015 libdyld.dylib`start + 1


8ec69ac247cc05840e304c12e731e82e85cd11b6 is the first bad commit
commit 8ec69ac247cc05840e304c12e731e82e85cd11b6
Author: Tomasz Krupa <tomasz.krupa@intel.com>
Date:   Tue Aug 14 08:00:56 2018 +0000

    [X86] Lowering addus/subus intrinsics to native IR
    
    Summary: This revision improves previous version (rL330322) which has been reverted due to crashes.
    
    This is the patch that lowers x86 intrinsics to native IR
    in order to enable optimizations. The patch also includes folding
    of previously missing saturation patterns so that IR emits the same
    machine instructions as the intrinsics.
    
    Reviewers: craig.topper, spatel, RKSimon
    
    Reviewed By: craig.topper
    
    Subscribers: mike.dvoretsky, DavidKreitzer, sroland, llvm-commits
    
    Differential Revision: https://reviews.llvm.org/D46179
    
    
    
    git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339650 91177308-0d34-0410-b5e6-96231b3b80d8

:040000 040000 a951aecdb722ebcb132fe6ca65b4fc73cbea202e 9e864e0043ea849d73d5ec63851f4e95bde3cb38 M      include
:040000 040000 213bb9d010af3f542b1dd09a92d1de02337e1523 bf7723df9f3a12cf6a9a3ca7b9e233858cc3ef28 M      lib
:040000 040000 fa62daeba81c1fc0c17f81732455143f3c498b37 3a2daa46a43deb5b355716dff54f36c4bf16f14a M      test
bisect run success
Comment 1 Roland Scheidegger 2018-08-22 01:33:18 UTC
Ah yes, the change to nuke (some) of the saturated intrinsics was finally committed (for real this time I guess, there were lengthy discussions and changes). gallivm code needs to be changed to use fallback code (and the fallback code needs to be changed so it matches what llvm expects to recognize the pattern and produce the simple assembly).
I think though we can use the existing bug for this, even though the llvm code isn't exactly the same anymore.

*** This bug has been marked as a duplicate of bug 106231 ***

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.