brintos

brintos / llvm-project-archived public Read only

0
0
Text · 915 B · 7327630 Raw
33 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py2; RUN: opt < %s -passes=instcombine -S | FileCheck %s3 4; This test makes sure that mul instructions are properly eliminated.5; This test is for Integer BitWidth < 64 && BitWidth % 2 != 0.6 7define i17 @test1(i17 %X) {8; CHECK-LABEL: @test1(9; CHECK-NEXT:    [[Y:%.*]] = shl i17 [[X:%.*]], 1010; CHECK-NEXT:    ret i17 [[Y]]11;12  %Y = mul i17 %X, 102413  ret i17 %Y14}15 16define <2 x i17> @test2(<2 x i17> %X) {17; CHECK-LABEL: @test2(18; CHECK-NEXT:    [[Y:%.*]] = shl <2 x i17> [[X:%.*]], splat (i17 10)19; CHECK-NEXT:    ret <2 x i17> [[Y]]20;21  %Y = mul <2 x i17> %X, <i17 1024, i17 1024>22  ret <2 x i17> %Y23}24 25define <2 x i17> @test3(<2 x i17> %X) {26; CHECK-LABEL: @test3(27; CHECK-NEXT:    [[Y:%.*]] = shl <2 x i17> [[X:%.*]], <i17 10, i17 8>28; CHECK-NEXT:    ret <2 x i17> [[Y]]29;30  %Y = mul <2 x i17> %X, <i17 1024, i17 256>31  ret <2 x i17> %Y32}33