<div dir="ltr"><div class="gmail_default" style="font-family:verdana,sans-serif">Yes, I'm investigating. Thanks</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Mar 5, 2014 at 4:44 PM, Eric Christopher <span dir="ltr"><<a href="mailto:echristo@gmail.com" target="_blank">echristo@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Raul,<br>
<br>
This ended up breaking a clang codegen test: test/CodeGen/libcalls.c.<br>
Can you take a look?<br>
<span class="HOEnZb"><font color="#888888"><br>
-eric<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
On Wed, Mar 5, 2014 at 4:18 PM, Raul E. Silvera <<a href="mailto:rsilvera@google.com">rsilvera@google.com</a>> wrote:<br>
> Author: rsilvera<br>
> Date: Wed Mar  5 18:18:15 2014<br>
> New Revision: 203037<br>
><br>
> URL: <a href="http://llvm.org/viewvc/llvm-project?rev=203037&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=203037&view=rev</a><br>
> Log:<br>
> Change math intrinsic attributes from readonly to readnone. These<br>
> are operations that do not access memory but may be sensitive<br>
> to floating-point environment changes. LLVM does not attempt<br>
> to model FP environment changes, so this was unnecessarily conservative<br>
> and was getting on the way of some optimizations, in particular<br>
> SLP vectorization.<br>
><br>
> Modified:<br>
>     llvm/trunk/include/llvm/IR/Intrinsics.td<br>
>     llvm/trunk/test/Feature/intrinsics.ll<br>
>     llvm/trunk/test/Transforms/BBVectorize/simple-int.ll<br>
>     llvm/trunk/test/Transforms/InstCombine/pow-1.ll<br>
><br>
> Modified: llvm/trunk/include/llvm/IR/Intrinsics.td<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IR/Intrinsics.td?rev=203037&r1=203036&r2=203037&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IR/Intrinsics.td?rev=203037&r1=203036&r2=203037&view=diff</a><br>

> ==============================================================================<br>
> --- llvm/trunk/include/llvm/IR/Intrinsics.td (original)<br>
> +++ llvm/trunk/include/llvm/IR/Intrinsics.td Wed Mar  5 18:18:15 2014<br>
> @@ -285,10 +285,17 @@ def int_memset  : Intrinsic<[],<br>
>                               llvm_i32_ty, llvm_i1_ty],<br>
>                              [IntrReadWriteArgMem, NoCapture<0>]>;<br>
><br>
> -// These functions do not actually read memory, but they are sensitive to the<br>
> -// rounding mode.  This needs to be modelled separately; in the meantime<br>
> -// declaring them as reading memory is conservatively correct.<br>
> -let Properties = [IntrReadMem] in {<br>
> +let Properties = [IntrNoMem] in {<br>
> +  def int_fma  : Intrinsic<[llvm_anyfloat_ty],<br>
> +                           [LLVMMatchType<0>, LLVMMatchType<0>,<br>
> +                            LLVMMatchType<0>]>;<br>
> +  def int_fmuladd : Intrinsic<[llvm_anyfloat_ty],<br>
> +                              [LLVMMatchType<0>, LLVMMatchType<0>,<br>
> +                               LLVMMatchType<0>]>;<br>
> +<br>
> +  // These functions do not read memory, but are sensitive to the<br>
> +  // rounding mode. LLVM purposely does not model changes to the FP<br>
> +  // environment so they can be treated as readnone.<br>
>    def int_sqrt : Intrinsic<[llvm_anyfloat_ty], [LLVMMatchType<0>]>;<br>
>    def int_powi : Intrinsic<[llvm_anyfloat_ty], [LLVMMatchType<0>, llvm_i32_ty]>;<br>
>    def int_sin  : Intrinsic<[llvm_anyfloat_ty], [LLVMMatchType<0>]>;<br>
> @@ -311,16 +318,6 @@ let Properties = [IntrReadMem] in {<br>
>    def int_round : Intrinsic<[llvm_anyfloat_ty], [LLVMMatchType<0>]>;<br>
>  }<br>
><br>
> -let Properties = [IntrNoMem] in {<br>
> -  def int_fma  : Intrinsic<[llvm_anyfloat_ty],<br>
> -                         [LLVMMatchType<0>, LLVMMatchType<0>,<br>
> -                          LLVMMatchType<0>]>;<br>
> -<br>
> -  def int_fmuladd : Intrinsic<[llvm_anyfloat_ty],<br>
> -                              [LLVMMatchType<0>, LLVMMatchType<0>,<br>
> -                               LLVMMatchType<0>]>;<br>
> -}<br>
> -<br>
>  // NOTE: these are internal interfaces.<br>
>  def int_setjmp     : Intrinsic<[llvm_i32_ty],  [llvm_ptr_ty]>;<br>
>  def int_longjmp    : Intrinsic<[], [llvm_ptr_ty, llvm_i32_ty], [IntrNoReturn]>;<br>
><br>
> Modified: llvm/trunk/test/Feature/intrinsics.ll<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Feature/intrinsics.ll?rev=203037&r1=203036&r2=203037&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Feature/intrinsics.ll?rev=203037&r1=203036&r2=203037&view=diff</a><br>

> ==============================================================================<br>
> --- llvm/trunk/test/Feature/intrinsics.ll (original)<br>
> +++ llvm/trunk/test/Feature/intrinsics.ll Wed Mar  5 18:18:15 2014<br>
> @@ -61,7 +61,7 @@ define void @libm() {<br>
>  ; FIXME: test ALL the intrinsics in this file.<br>
><br>
>  ; rdar://11542750<br>
> -; CHECK: declare void @llvm.trap() #2<br>
> +; CHECK: declare void @llvm.trap() #1<br>
>  declare void @llvm.trap()<br>
><br>
>  define void @trap() {<br>
> @@ -70,5 +70,4 @@ define void @trap() {<br>
>  }<br>
><br>
>  ; CHECK: attributes #0 = { nounwind readnone }<br>
> -; CHECK: attributes #1 = { nounwind readonly }<br>
> -; CHECK: attributes #2 = { noreturn nounwind }<br>
> +; CHECK: attributes #1 = { noreturn nounwind }<br>
><br>
> Modified: llvm/trunk/test/Transforms/BBVectorize/simple-int.ll<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/BBVectorize/simple-int.ll?rev=203037&r1=203036&r2=203037&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/BBVectorize/simple-int.ll?rev=203037&r1=203036&r2=203037&view=diff</a><br>

> ==============================================================================<br>
> --- llvm/trunk/test/Transforms/BBVectorize/simple-int.ll (original)<br>
> +++ llvm/trunk/test/Transforms/BBVectorize/simple-int.ll Wed Mar  5 18:18:15 2014<br>
> @@ -126,8 +126,7 @@ define double @test4(double %A1, double<br>
><br>
>  ; CHECK: declare <2 x double> @llvm.fma.v2f64(<2 x double>, <2 x double>, <2 x double>) #0<br>
>  ; CHECK: declare <2 x double> @llvm.fmuladd.v2f64(<2 x double>, <2 x double>, <2 x double>) #0<br>
> -; CHECK: declare <2 x double> @llvm.cos.v2f64(<2 x double>) #1<br>
> -; CHECK: declare <2 x double> @llvm.powi.v2f64(<2 x double>, i32) #1<br>
> +; CHECK: declare <2 x double> @llvm.cos.v2f64(<2 x double>) #0<br>
> +; CHECK: declare <2 x double> @llvm.powi.v2f64(<2 x double>, i32) #0<br>
><br>
>  ; CHECK: attributes #0 = { nounwind readnone }<br>
> -; CHECK: attributes #1 = { nounwind readonly }<br>
><br>
> Modified: llvm/trunk/test/Transforms/InstCombine/pow-1.ll<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/InstCombine/pow-1.ll?rev=203037&r1=203036&r2=203037&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/InstCombine/pow-1.ll?rev=203037&r1=203036&r2=203037&view=diff</a><br>

> ==============================================================================<br>
> --- llvm/trunk/test/Transforms/InstCombine/pow-1.ll (original)<br>
> +++ llvm/trunk/test/Transforms/InstCombine/pow-1.ll Wed Mar  5 18:18:15 2014<br>
> @@ -160,8 +160,8 @@ declare double @llvm.pow.f64(double %Val<br>
>  define double @test_simplify17(double %x) {<br>
>  ; CHECK-LABEL: @test_simplify17(<br>
>    %retval = call double @llvm.pow.f64(double %x, double 0.5)<br>
> -; CHECK-NEXT: [[SQRT:%[a-z0-9]+]] = call double @sqrt(double %x) [[NUW_RO]]<br>
> -; CHECK-NEXT: [[FABS:%[a-z0-9]+]] = call double @fabs(double [[SQRT]]) [[NUW_RO]]<br>
> +; CHECK-NEXT: [[SQRT:%[a-z0-9]+]] = call double @sqrt(double %x)<br>
> +; CHECK-NEXT: [[FABS:%[a-z0-9]+]] = call double @fabs(double [[SQRT]])<br>
>  ; CHECK-NEXT: [[FCMP:%[a-z0-9]+]] = fcmp oeq double %x, 0xFFF0000000000000<br>
>  ; CHECK-NEXT: [[SELECT:%[a-z0-9]+]] = select i1 [[FCMP]], double 0x7FF0000000000000, double [[FABS]]<br>
>    ret double %retval<br>
><br>
><br>
> _______________________________________________<br>
> llvm-commits mailing list<br>
> <a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>
> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div dir="ltr"><div><font size="4" face="arial black, sans-serif" style="background-color:rgb(0,0,0)" color="#b45f06"> Raúl E. Silvera </font></div>
<div><br></div></div>
</div>