diff options
Diffstat (limited to 'llvm/test/Transforms')
-rw-r--r-- | llvm/test/Transforms/InstCombine/copysign.ll | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/llvm/test/Transforms/InstCombine/copysign.ll b/llvm/test/Transforms/InstCombine/copysign.ll index cc68b195a7e..79c13380d4c 100644 --- a/llvm/test/Transforms/InstCombine/copysign.ll +++ b/llvm/test/Transforms/InstCombine/copysign.ll @@ -62,3 +62,17 @@ define <3 x double> @known_positive_sign_arg_vec(<3 x double> %x, <3 x i32> %y) %r = call arcp <3 x double> @llvm.copysign.v3f64(<3 x double> %x, <3 x double> %yf) ret <3 x double> %r } + +; TODO: The magnitude operand of the 1st copysign is irrelevant. +; copysign(x, copysign(y, z)) --> copysign(x, z) + +define float @copysign_sign_arg(float %x, float %y, float %z) { +; CHECK-LABEL: @copysign_sign_arg( +; CHECK-NEXT: [[S:%.*]] = call reassoc float @llvm.copysign.f32(float [[Y:%.*]], float [[Z:%.*]]) +; CHECK-NEXT: [[R:%.*]] = call ninf float @llvm.copysign.f32(float [[X:%.*]], float [[S]]) +; CHECK-NEXT: ret float [[R]] +; + %s = call reassoc float @llvm.copysign.f32(float %y, float %z) + %r = call ninf float @llvm.copysign.f32(float %x, float %s) + ret float %r +} |