brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.0 KiB · 6e79602 Raw
35 lines · plain
1; RUN: llc -O2 -mtriple=bpfel -mcpu=v2 -mattr=+alu32 < %s | FileCheck %s2;3; For the below test case, both 'ret' and 'b' at 'ret == b'4; need SLL/SLR. For 'ret', 'ret = a' may receive the value5; from argument with high 32-bit invalid data.6;7; extern int helper(int);8; int test(int a, int b, int c, int d) {9;   int ret;10;   if (a < b)11;     ret = (c < d) ? a : 0;12;   else13;     ret = (c < a) ? 1 : 2;14;   return helper(ret == b);15; }16 17define dso_local i32 @test(i32 %a, i32 %b, i32 %c, i32 %d) local_unnamed_addr {18entry:19  %cmp = icmp slt i32 %a, %b20  %cmp1 = icmp slt i32 %c, %d21  %cond = select i1 %cmp1, i32 %a, i32 022  %cmp2 = icmp slt i32 %c, %a23  %cond3 = select i1 %cmp2, i32 1, i32 224  %ret.0 = select i1 %cmp, i32 %cond, i32 %cond325  %cmp4 = icmp eq i32 %ret.0, %b26  %conv = zext i1 %cmp4 to i3227  %call = tail call i32 @helper(i32 %conv)28  ret i32 %call29}30; CHECK: r{{[0-9]+}} = w{{[0-9]+}}31; CHECK: r{{[0-9]+}} = w{{[0-9]+}}32; CHECK: if r{{[0-9]+}} == r{{[0-9]+}} goto33 34declare dso_local i32 @helper(i32) local_unnamed_addr35