From 48a91abc103d6bd80f3d30d7eaec0d03a25c43ac Mon Sep 17 00:00:00 2001 From: Jim Grosbach Date: Thu, 7 Mar 2013 05:47:54 +0000 Subject: SDAG: Handle scalarizing an extend of a <1 x iN> vector. Just scalarize the element and rebuild a vector of the result type from that. rdar://13281568 llvm-svn: 176614 --- .../2013-03-06-vector-sext-operand-scalarize.ll | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 llvm/test/CodeGen/Thumb2/2013-03-06-vector-sext-operand-scalarize.ll (limited to 'llvm/test/CodeGen') diff --git a/llvm/test/CodeGen/Thumb2/2013-03-06-vector-sext-operand-scalarize.ll b/llvm/test/CodeGen/Thumb2/2013-03-06-vector-sext-operand-scalarize.ll new file mode 100644 index 00000000000..203815fadc9 --- /dev/null +++ b/llvm/test/CodeGen/Thumb2/2013-03-06-vector-sext-operand-scalarize.ll @@ -0,0 +1,19 @@ +; RUN: llc < %s -mtriple=thumbv7-apple-darwin | FileCheck %s + +; Testing that these don't crash/assert. The loop vectorizer can end up +; with odd constructs like this. The code actually generated is incidental. +define <1 x i64> @test_zext(i32 %a) nounwind { +; CHECK: test_zext: + %Cmp = icmp uge i32 %a, 42 + %vec = insertelement <1 x i1> zeroinitializer, i1 %Cmp, i32 0 + %Se = zext <1 x i1> %vec to <1 x i64> + ret <1 x i64> %Se +} + +define <1 x i64> @test_sext(i32 %a) nounwind { +; CHECK: test_sext: + %Cmp = icmp uge i32 %a, 42 + %vec = insertelement <1 x i1> zeroinitializer, i1 %Cmp, i32 0 + %Se = sext <1 x i1> %vec to <1 x i64> + ret <1 x i64> %Se +} -- cgit v1.2.3