spatel added a comment.

In D115804#3195002 <https://reviews.llvm.org/D115804#3195002>, @nikic wrote:

> Looks reasonable. Making float to int cast well defined is exactly why these 
> intrinsics exist. Should we also drop the "string-float-cast-overflow" 
> attribute, as UB is now prevented in a different way?

Yes, that sounds like a good enhancement. The only in-tree use of the attribute 
is in DAGCombiner. Make that a follow-up patch or two since it crosses into 
LLVM? 
If we care about perf of the generated code in those cases, then we need to add 
something to the optimizer or codegen to recognize patterns like this:

  define float @s(float %x) {
    %i = call i32 @llvm.fptosi.sat.i32.f32(float %x)
    %f = sitofp i32 %i to float
    ret float %f
  }


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D115804/new/

https://reviews.llvm.org/D115804

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to