<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/beignet.git/backend, branch stable</title>
<subtitle>gitlab.freedesktop.org: beignet/beignet.git
</subtitle>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/beignet.git/'/>
<entry>
<title>Generate NAN for UNDEF value in printf parser.</title>
<updated>2015-03-18T08:22:13+00:00</updated>
<author>
<name>Junyan He</name>
<email>junyan.he@linux.intel.com</email>
</author>
<published>2015-03-17T10:08:40+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/beignet.git/commit/?id=af0266b904973eddbacd3462bad78dab13fb7e4e'/>
<id>af0266b904973eddbacd3462bad78dab13fb7e4e</id>
<content type='text'>
llvm 3.6 will give a UNDEF value for NAN. The will cause
the store instruction for UNDEF to be ignored. We need
to modify it to NAN here.

Comments from Zhigang:
"
The related commit of why LLVM won't just simply return NaN for such
case is at:

    Make the sqrt intrinsic return undef for a negative input.

    As discussed here:
    http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20140609/220598.html

    And again here:
    http://lists.cs.uiuc.edu/pipermail/llvmdev/2014-September/077168.html

    The sqrt of a negative number when using the llvm intrinsic is undefined.
    We should return undef rather than 0.0 to match the definition in the LLVM IR lang ref.

    This change should not affect any code that isn't using "no-nans-fp-math";
    ie, no-nans is a requirement for generating the llvm intrinsic in place of a sqrt function call.

    Unfortunately, the behavior introduced by this patch will not match current gcc, xlc, icc, and
    possibly other compilers. The current clang/llvm behavior of returning 0.0 doesn't either.
    We knowingly approve of this difference with the other compilers in an attempt to flag code
    that is invoking undefined behavior.

    A front-end warning should also try to convince the user that the program will fail:
    http://llvm.org/bugs/show_bug.cgi?id=21093

    Differential Revision: http://reviews.llvm.org/D5527

This patch is a workaround for the following scenario:
printf("%f \n", sqrt(-1.0f));
"

Signed-off-by: Junyan He &lt;junyan.he@linux.intel.com&gt;
Reviewed-by: Zhigang Gong &lt;zhigang.gong@linux.intel.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
llvm 3.6 will give a UNDEF value for NAN. The will cause
the store instruction for UNDEF to be ignored. We need
to modify it to NAN here.

Comments from Zhigang:
"
The related commit of why LLVM won't just simply return NaN for such
case is at:

    Make the sqrt intrinsic return undef for a negative input.

    As discussed here:
    http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20140609/220598.html

    And again here:
    http://lists.cs.uiuc.edu/pipermail/llvmdev/2014-September/077168.html

    The sqrt of a negative number when using the llvm intrinsic is undefined.
    We should return undef rather than 0.0 to match the definition in the LLVM IR lang ref.

    This change should not affect any code that isn't using "no-nans-fp-math";
    ie, no-nans is a requirement for generating the llvm intrinsic in place of a sqrt function call.

    Unfortunately, the behavior introduced by this patch will not match current gcc, xlc, icc, and
    possibly other compilers. The current clang/llvm behavior of returning 0.0 doesn't either.
    We knowingly approve of this difference with the other compilers in an attempt to flag code
    that is invoking undefined behavior.

    A front-end warning should also try to convince the user that the program will fail:
    http://llvm.org/bugs/show_bug.cgi?id=21093

    Differential Revision: http://reviews.llvm.org/D5527

This patch is a workaround for the following scenario:
printf("%f \n", sqrt(-1.0f));
"

Signed-off-by: Junyan He &lt;junyan.he@linux.intel.com&gt;
Reviewed-by: Zhigang Gong &lt;zhigang.gong@linux.intel.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>GBE: Only emit multiply when immediate is not one.</title>
<updated>2015-03-12T07:57:23+00:00</updated>
<author>
<name>Ruiling Song</name>
<email>ruiling.song@intel.com</email>
</author>
<published>2015-03-11T06:39:24+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/beignet.git/commit/?id=eb40b6a752897c1e8aef76d5630a997859a978c7'/>
<id>eb40b6a752897c1e8aef76d5630a997859a978c7</id>
<content type='text'>
As constant propagation will introduce constantExpr and gep instruction,
I choose not to run constant propagation pass after RemoveGep pass.
So, here only generate Multiply as needed.
We may do such kind of optimization in Gen IR level in the future.

This could fix the performance regression introduced by:
"GBE: Import constantexpr lower pass from pNaCl"
to the opencv case:
opencv_perf_imgproc/OCL_BilateralFixture_Bilateral

Signed-off-by: Ruiling Song &lt;ruiling.song@intel.com&gt;
Reviewed-by: Zhigang Gong &lt;zhigang.gong@linux.intel.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
As constant propagation will introduce constantExpr and gep instruction,
I choose not to run constant propagation pass after RemoveGep pass.
So, here only generate Multiply as needed.
We may do such kind of optimization in Gen IR level in the future.

This could fix the performance regression introduced by:
"GBE: Import constantexpr lower pass from pNaCl"
to the opencv case:
opencv_perf_imgproc/OCL_BilateralFixture_Bilateral

Signed-off-by: Ruiling Song &lt;ruiling.song@intel.com&gt;
Reviewed-by: Zhigang Gong &lt;zhigang.gong@linux.intel.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>GBE: Only add non-zero offset in gep lowering pass.</title>
<updated>2015-03-10T07:51:07+00:00</updated>
<author>
<name>Ruiling Song</name>
<email>ruiling.song@intel.com</email>
</author>
<published>2015-01-29T02:36:40+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/beignet.git/commit/?id=ee89a55555cc02f192172c950ef5605d651356e4'/>
<id>ee89a55555cc02f192172c950ef5605d651356e4</id>
<content type='text'>
Signed-off-by: Ruiling Song &lt;ruiling.song@intel.com&gt;
Reviewed-by: Zhigang Gong &lt;zhigang.gong@linux.intel.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Ruiling Song &lt;ruiling.song@intel.com&gt;
Reviewed-by: Zhigang Gong &lt;zhigang.gong@linux.intel.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>GBE: add a new incompatible compile option -cl-finite-math-only.</title>
<updated>2015-03-09T08:12:02+00:00</updated>
<author>
<name>Zhigang Gong</name>
<email>zhigang.gong@intel.com</email>
</author>
<published>2015-03-09T00:57:26+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/beignet.git/commit/?id=49eb83dbe20fbcec105d662134553efe7ba8f979'/>
<id>49eb83dbe20fbcec105d662134553efe7ba8f979</id>
<content type='text'>
Signed-off-by: Zhigang Gong &lt;zhigang.gong@intel.com&gt;
Tested-by: Meng Mengmeng &lt;mengmeng.meng@intel.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Zhigang Gong &lt;zhigang.gong@intel.com&gt;
Tested-by: Meng Mengmeng &lt;mengmeng.meng@intel.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix llvm3.6 build error.</title>
<updated>2015-03-05T05:02:48+00:00</updated>
<author>
<name>Yang Rong</name>
<email>rong.r.yang@intel.com</email>
</author>
<published>2015-03-03T04:53:43+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/beignet.git/commit/?id=05da0d9157a1ef7dd735ab1e53b3e676e6591d8a'/>
<id>05da0d9157a1ef7dd735ab1e53b3e676e6591d8a</id>
<content type='text'>
LLVM3.6 revert the c api LLVMLinkModules to LLVM3.5 last-minute. Consist with it.

Reviewed-by: "Song, Ruiling" &lt;ruiling.song@intel.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
LLVM3.6 revert the c api LLVMLinkModules to LLVM3.5 last-minute. Consist with it.

Reviewed-by: "Song, Ruiling" &lt;ruiling.song@intel.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>GBE: add fastcall support.</title>
<updated>2015-03-02T07:57:05+00:00</updated>
<author>
<name>Zhigang Gong</name>
<email>zhigang.gong@intel.com</email>
</author>
<published>2015-03-02T07:20:25+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/beignet.git/commit/?id=04510a867f2866ed8e3238deadc6aca193960f52'/>
<id>04510a867f2866ed8e3238deadc6aca193960f52</id>
<content type='text'>
I found some optimization pass may add fastcall attribute to some
builtin functions. We need to add the corresponding support.

Signed-off-by: Zhigang Gong &lt;zhigang.gong@intel.com&gt;
Reviewed-by: "Yang, Rong R" &lt;rong.r.yang@intel.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
I found some optimization pass may add fastcall attribute to some
builtin functions. We need to add the corresponding support.

Signed-off-by: Zhigang Gong &lt;zhigang.gong@intel.com&gt;
Reviewed-by: "Yang, Rong R" &lt;rong.r.yang@intel.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>GBE: support compare two bool variables.</title>
<updated>2015-03-02T07:57:05+00:00</updated>
<author>
<name>Zhigang Gong</name>
<email>zhigang.gong@intel.com</email>
</author>
<published>2015-03-02T04:23:21+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/beignet.git/commit/?id=ec7b27cc18be4704ba25562a41e2f01ac12e9621'/>
<id>ec7b27cc18be4704ba25562a41e2f01ac12e9621</id>
<content type='text'>
LLVM 3.6 may generate the following instructions:

%Pivot = icmp slt i1 %trunc49, false

when do siwth lowering pass.
To support it we must use GEN_TYPE_W to represent B rather
than GEN_TYPE_UW and we also need to remove the corresponding
assertions.

Signed-off-by: Zhigang Gong &lt;zhigang.gong@intel.com&gt;
Reviewed-by: "Yang, Rong R" &lt;rong.r.yang@intel.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
LLVM 3.6 may generate the following instructions:

%Pivot = icmp slt i1 %trunc49, false

when do siwth lowering pass.
To support it we must use GEN_TYPE_W to represent B rather
than GEN_TYPE_UW and we also need to remove the corresponding
assertions.

Signed-off-by: Zhigang Gong &lt;zhigang.gong@intel.com&gt;
Reviewed-by: "Yang, Rong R" &lt;rong.r.yang@intel.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>GBE: remove the unecessary type check for SEL instructio.</title>
<updated>2015-03-02T07:57:04+00:00</updated>
<author>
<name>Zhigang Gong</name>
<email>zhigang.gong@intel.com</email>
</author>
<published>2015-03-02T01:16:47+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/beignet.git/commit/?id=43e98c59917995917f6d719d5285ebc139760086'/>
<id>43e98c59917995917f6d719d5285ebc139760086</id>
<content type='text'>
The backend SEL instruction could support bool type
since we change the bool representation to normal
S16 data type. Now let us remove this assertion
check.

Signed-off-by: Zhigang Gong &lt;zhigang.gong@intel.com&gt;
Reviewed-by: "Song, Ruiling" &lt;ruiling.song@intel.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The backend SEL instruction could support bool type
since we change the bool representation to normal
S16 data type. Now let us remove this assertion
check.

Signed-off-by: Zhigang Gong &lt;zhigang.gong@intel.com&gt;
Reviewed-by: "Song, Ruiling" &lt;ruiling.song@intel.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>GBE: Fix fast-math issue under llvm 3.6.</title>
<updated>2015-02-28T05:41:24+00:00</updated>
<author>
<name>Ruiling Song</name>
<email>ruiling.song@intel.com</email>
</author>
<published>2015-02-28T05:44:05+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/beignet.git/commit/?id=65780d81c786def2f44c11b8d6f5e4895c5061bb'/>
<id>65780d81c786def2f44c11b8d6f5e4895c5061bb</id>
<content type='text'>
"__ocl_math_fastpath_flag" was directly optimized out when compiling libocl under llvm 3.6
And set its initialization value after loading libocl.

Signed-off-by: Ruiling Song &lt;ruiling.song@intel.com&gt;
Reviewed-by: Zhigang Gong &lt;zhigang.gong@linux.intel.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
"__ocl_math_fastpath_flag" was directly optimized out when compiling libocl under llvm 3.6
And set its initialization value after loading libocl.

Signed-off-by: Ruiling Song &lt;ruiling.song@intel.com&gt;
Reviewed-by: Zhigang Gong &lt;zhigang.gong@linux.intel.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>GBE: Support unaligned load/store of dword/qword in GenIR.</title>
<updated>2015-02-27T06:50:34+00:00</updated>
<author>
<name>Ruiling Song</name>
<email>ruiling.song@intel.com</email>
</author>
<published>2015-02-27T06:33:08+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/beignet.git/commit/?id=0b207a3765b49eb0e7a4c98b322c178e2e567275'/>
<id>0b207a3765b49eb0e7a4c98b322c178e2e567275</id>
<content type='text'>
Although opencl does not allow unaligned load/store of dword/qword,
LLVM still may generate such kind of instructions, especially
large integer load/store is legalized into load/store of qword with
possible unaligned address. The implementation is simple:
for store, bitcast d/q word to vector of bytes before writing out,
for load, load vector of bytes and then bitcast them to d/q word.

Signed-off-by: Ruiling Song &lt;ruiling.song@intel.com&gt;
Reviewed-by: Zhigang Gong &lt;zhigang.gong@linux.intel.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Although opencl does not allow unaligned load/store of dword/qword,
LLVM still may generate such kind of instructions, especially
large integer load/store is legalized into load/store of qword with
possible unaligned address. The implementation is simple:
for store, bitcast d/q word to vector of bytes before writing out,
for load, load vector of bytes and then bitcast them to d/q word.

Signed-off-by: Ruiling Song &lt;ruiling.song@intel.com&gt;
Reviewed-by: Zhigang Gong &lt;zhigang.gong@linux.intel.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
