brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1018 B · a485d11 Raw
42 lines · plain
1; RUN: opt < %s "-passes=print<scalar-evolution>" -disable-output 2>&1 | FileCheck %s2 3; CHECK-LABEL: @test14; CHECK: -->  (zext5; CHECK: -->  (zext6; CHECK-NOT: -->  (zext7 8define i32 @test1(i32 %x) {9  %n = and i32 %x, 25510  %y = xor i32 %n, 25511  ret i32 %y12}13 14; ScalarEvolution shouldn't try to analyze %z into something like15;   -->  (zext i4 (-1 + (-1 * (trunc i64 (8 * %x) to i4))) to i64)16; or17;   -->  (8 * (zext i1 (trunc i64 ((8 * %x) /u 8) to i1) to i64))18 19; CHECK-LABEL: @test220; CHECK: -->  (8 * (zext i1 (trunc i64 %x to i1) to i64))21 22define i64 @test2(i64 %x) {23  %a = shl i64 %x, 324  %t = and i64 %a, 825  %z = xor i64 %t, 826  ret i64 %z27}28 29; Check that we transform the naive lowering of the sequence below,30;   (4 * (zext i5 (2 * (trunc i32 %x to i5)) to i32)),31; to32;   (8 * (zext i4 (trunc i32 %x to i4) to i32))33;34; CHECK-LABEL: @test335define i32 @test3(i32 %x) {36  %a = mul i32 %x, 837; CHECK: %b38; CHECK-NEXT: --> (8 * (zext i4 (trunc i32 %x to i4) to i32))39  %b = and i32 %a, 12440  ret i32 %b41}42