From fc21f8ff1404f26ceeee3202714cbc307d579997 Mon Sep 17 00:00:00 2001 From: Eli Friedman Date: Sat, 18 Jul 2009 09:07:47 +0000 Subject: Canonicalize insert/extractelement from single-element vectors into bitcasts. It would also be possible to canonicalize the other way; does anyone have a preference? git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76300 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/Transforms/InstCombine/vec-single-elt.ll | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 test/Transforms/InstCombine/vec-single-elt.ll (limited to 'test') diff --git a/test/Transforms/InstCombine/vec-single-elt.ll b/test/Transforms/InstCombine/vec-single-elt.ll new file mode 100644 index 0000000..45bca42 --- /dev/null +++ b/test/Transforms/InstCombine/vec-single-elt.ll @@ -0,0 +1,12 @@ +; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep element +; insert/extractelement should canonicalize to bitcast + +define i64 @a(<1 x i64> %x) { + %r = extractelement <1 x i64> %x, i32 0 + ret i64 %r +} + +define <1 x i64> @b(i64 %x) { + %r = insertelement <1 x i64> undef, i64 %x, i32 0 + ret <1 x i64> %r +} -- cgit v1.1