• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: llc -march=bpfel -mattr=+alu32 < %s | FileCheck %s
2; Source:
3;   unsigned test(unsigned long x, unsigned long y) {
4;     return x & y;
5;   }
6; Compilation flag:
7;   clang -target bpf -O2 -emit-llvm -S test.c
8
9; Function Attrs: norecurse nounwind readnone
10define dso_local i32 @test(i64 %x, i64 %y) local_unnamed_addr #0 {
11entry:
12  %and = and i64 %y, %x
13  %conv = trunc i64 %and to i32
14  ret i32 %conv
15}
16
17; CHECK: r[[REG1:[0-9]+]] = r{{[0-9]+}}
18; CHECK: w[[REG1]] &= w{{[0-9]+}}
19
20attributes #0 = { norecurse nounwind readnone "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "frame-pointer"="all" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
21
22!llvm.module.flags = !{!0}
23!llvm.ident = !{!1}
24
25!0 = !{i32 1, !"wchar_size", i32 4}
26!1 = !{!"clang version 11.0.0 (https://github.com/llvm/llvm-project.git b3ab5b2e7ffe9964ddf75a92fd7a444fe5aaa426)"}
27