From e18d302ef4d6423dd82d624eb2da15b14219c979 Mon Sep 17 00:00:00 2001 From: David Majnemer Date: Wed, 2 Jul 2014 06:14:13 +0000 Subject: [PATCH] InstCombine: Add a vector variant test for PR20186 No functional change, just adding more test coverage that was meant to go in with r212164. llvm-svn: 212165 --- llvm/test/Transforms/InstCombine/sub.ll | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/llvm/test/Transforms/InstCombine/sub.ll b/llvm/test/Transforms/InstCombine/sub.ll index a9dffe7..5ff0ed5 100644 --- a/llvm/test/Transforms/InstCombine/sub.ll +++ b/llvm/test/Transforms/InstCombine/sub.ll @@ -445,13 +445,14 @@ define <2 x i64> @test36(<2 x i64> %A) { ; CHECK-NEXT: ret <2 x i64> %sub } -define <2 x i64> @test37(<2 x i64> %A) { - %shl = shl <2 x i64> %A, - %sub = sub <2 x i64> %shl, %A - ret <2 x i64> %sub +define <2 x i32> @test37(<2 x i32> %A) { + %div = sdiv <2 x i32> %A, + %sub = sub nsw <2 x i32> zeroinitializer, %div + ret <2 x i32> %sub ; CHECK-LABEL: @test37( -; CHECK-NEXT: %sub = mul <2 x i64> %A, -; CHECK-NEXT: ret <2 x i64> %sub +; CHECK-NEXT: [[DIV:%.*]] = sdiv <2 x i32> %A, +; CHECK-NEXT: [[SUB:%.*]] = sub nsw <2 x i32> zeroinitializer, %div +; CHECK-NEXT: ret <2 x i32> [[SUB]] } define i32 @test38(i32 %A) { -- 2.7.4