diff options
author | Nadav Rotem <nadav.rotem@intel.com> | 2011-02-17 21:22:27 +0000 |
---|---|---|
committer | Nadav Rotem <nadav.rotem@intel.com> | 2011-02-17 21:22:27 +0000 |
commit | 093399cbf3bcdb31d04b3bf5c5691fc88c25da48 (patch) | |
tree | 641cbddb6bce94eb0f60c344297bee850ab6d18e /test | |
parent | bd9f6bf5cd5499715e216415989c29f820a7561c (diff) | |
download | llvm-093399cbf3bcdb31d04b3bf5c5691fc88c25da48.tar.gz llvm-093399cbf3bcdb31d04b3bf5c5691fc88c25da48.tar.bz2 llvm-093399cbf3bcdb31d04b3bf5c5691fc88c25da48.tar.xz |
Enhance constant folding of bitcast operations on vectors of floats.
Add getAllOnesValue of FP numbers to Constants and APFloat.
Add more tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125776 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r-- | test/Transforms/InstCombine/bitcast-vec-uniform.ll | 42 |
1 files changed, 41 insertions, 1 deletions
diff --git a/test/Transforms/InstCombine/bitcast-vec-uniform.ll b/test/Transforms/InstCombine/bitcast-vec-uniform.ll index a0d4678b0a..5975f1ec39 100644 --- a/test/Transforms/InstCombine/bitcast-vec-uniform.ll +++ b/test/Transforms/InstCombine/bitcast-vec-uniform.ll @@ -18,7 +18,8 @@ define <4 x i32> @b(<1 x i64> %y) { } ; CHECK: @foo -; CHECK: bitcast +; CHECK-NOT: bitcast +; CHECK: ret ; from MultiSource/Benchmarks/Bullet define <2 x float> @foo() { @@ -27,4 +28,43 @@ define <2 x float> @foo() { } +; CHECK: @foo2 +; CHECK-NOT: bitcast +; CHECK: ret +define <2 x double> @foo2() { + %cast = bitcast i128 -1 to <2 x double> + ret <2 x double> %cast +} +; CHECK: @foo3 +; CHECK-NOT: bitcast +; CHECK: ret +define <1 x float> @foo3() { + %cast = bitcast i32 -1 to <1 x float> + ret <1 x float> %cast +} + +; CHECK: @foo4 +; CHECK-NOT: bitcast +; CHECK: ret +define float @foo4() { + %cast = bitcast <1 x i32 ><i32 -1> to float + ret float %cast +} + +; CHECK: @foo5 +; CHECK-NOT: bitcast +; CHECK: ret +define double @foo5() { + %cast = bitcast <2 x i32 ><i32 -1, i32 -1> to double + ret double %cast +} + + +; CHECK: @foo6 +; CHECK-NOT: bitcast +; CHECK: ret +define <2 x double> @foo6() { + %cast = bitcast <4 x i32><i32 -1, i32 -1, i32 -1, i32 -1> to <2 x double> + ret <2 x double> %cast +} |