[llvm] 83c2d10 - [NFC][SCEV] Add tests for @llvm.abs intrinsic
Roman Lebedev via llvm-commits
llvm-commits at lists.llvm.org
Mon Sep 21 10:26:32 PDT 2020
Author: Roman Lebedev
Date: 2020-09-21T20:25:53+03:00
New Revision: 83c2d10d3cae57f71e23193d62989725b9b9f2f2
URL: https://github.com/llvm/llvm-project/commit/83c2d10d3cae57f71e23193d62989725b9b9f2f2
DIFF: https://github.com/llvm/llvm-project/commit/83c2d10d3cae57f71e23193d62989725b9b9f2f2.diff
LOG: [NFC][SCEV] Add tests for @llvm.abs intrinsic
Added:
llvm/test/Analysis/ScalarEvolution/abs-intrinsic.ll
Modified:
Removed:
################################################################################
diff --git a/llvm/test/Analysis/ScalarEvolution/abs-intrinsic.ll b/llvm/test/Analysis/ScalarEvolution/abs-intrinsic.ll
new file mode 100644
index 000000000000..daf8460ea60c
--- /dev/null
+++ b/llvm/test/Analysis/ScalarEvolution/abs-intrinsic.ll
@@ -0,0 +1,27 @@
+; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py
+; RUN: opt -analyze -enable-new-pm=0 -scalar-evolution < %s | FileCheck %s
+; RUN: opt -disable-output "-passes=print<scalar-evolution>" < %s 2>&1 | FileCheck %s
+
+declare i32 @llvm.abs.i32(i32, i1)
+
+define i32 @abs_nonsw(i32 %x) {
+; CHECK-LABEL: 'abs_nonsw'
+; CHECK-NEXT: Classifying expressions for: @abs_nonsw
+; CHECK-NEXT: %r = call i32 @llvm.abs.i32(i32 %x, i1 false)
+; CHECK-NEXT: --> %r U: full-set S: full-set
+; CHECK-NEXT: Determining loop execution counts for: @abs_nonsw
+;
+ %r = call i32 @llvm.abs.i32(i32 %x, i1 0)
+ ret i32 %r
+}
+
+define i32 @abs_nsw(i32 %x) {
+; CHECK-LABEL: 'abs_nsw'
+; CHECK-NEXT: Classifying expressions for: @abs_nsw
+; CHECK-NEXT: %r = call i32 @llvm.abs.i32(i32 %x, i1 true)
+; CHECK-NEXT: --> %r U: [0,-2147483648) S: full-set
+; CHECK-NEXT: Determining loop execution counts for: @abs_nsw
+;
+ %r = call i32 @llvm.abs.i32(i32 %x, i1 1)
+ ret i32 %r
+}
More information about the llvm-commits
mailing list