summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support
diff options
context:
space:
mode:
authorAndrea Di Biagio <Andrea_DiBiagio@sn.scee.net>2015-06-04 19:15:01 +0000
committerAndrea Di Biagio <Andrea_DiBiagio@sn.scee.net>2015-06-04 19:15:01 +0000
commit9ac8a6b13d998968226fdefb58ebd37eb3620ceb (patch)
tree0cdafb6d15390726fda032a6c4bf84a5163c149f /llvm/lib/Support
parent999b83452dade901ba824da7c9927daec9c3a954 (diff)
downloadbcm5719-llvm-9ac8a6b13d998968226fdefb58ebd37eb3620ceb.tar.gz
bcm5719-llvm-9ac8a6b13d998968226fdefb58ebd37eb3620ceb.zip
[DAGCombiner] Fix wrong folding of a build_vector into a blend with zero.
Method 'visitBUILD_VECTOR' in the DAGCombiner knows how to combine a build_vector of a bunch of extract_vector_elt nodes and constant zero nodes into a shuffle blend with a zero vector. However, method 'visitBUILD_VECTOR' forgot that a floating point build_vector may contain negative zero as well as positive zero. Example: define <2 x double> @example(<2 x double> %A) { entry: %0 = extractelement <2 x double> %A, i32 0 %1 = insertelement <2 x double> undef, double %0, i32 0 %2 = insertelement <2 x double> %1, double -0.0, i32 1 ret <2 x double> %2 } Before this patch, llc (with -mattr=+sse4.1) wrongly generated movq %xmm0, %xmm0 # xmm0 = xmm0[0],zero So, the sign bit of the negative zero was effectively lost. This patch fixes the problem by adding explicit checks for positive zero. With this patch, llc produces the following code for the example above: movhpd .LCPI0_0(%rip), %xmm0 where .LCPI0_0 referes to a 'double -0'. llvm-svn: 239070
Diffstat (limited to 'llvm/lib/Support')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud