[llvm] 94c71d6 - [InstCombine] Add tests for abs intrinsic eq zero (NFC)
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Sat Sep 5 06:11:51 PDT 2020
Author: Nikita Popov
Date: 2020-09-05T15:11:38+02:00
New Revision: 94c71d6aa1632170e27c60db4aa63c86e95bd450
URL: https://github.com/llvm/llvm-project/commit/94c71d6aa1632170e27c60db4aa63c86e95bd450
DIFF: https://github.com/llvm/llvm-project/commit/94c71d6aa1632170e27c60db4aa63c86e95bd450.diff
LOG: [InstCombine] Add tests for abs intrinsic eq zero (NFC)
Added:
Modified:
llvm/test/Transforms/InstCombine/icmp.ll
Removed:
################################################################################
diff --git a/llvm/test/Transforms/InstCombine/icmp.ll b/llvm/test/Transforms/InstCombine/icmp.ll
index 3b223d71f9d4..b284c5a2c840 100644
--- a/llvm/test/Transforms/InstCombine/icmp.ll
+++ b/llvm/test/Transforms/InstCombine/icmp.ll
@@ -3,6 +3,8 @@
target datalayout = "e-p:64:64:64-p1:16:16:16-p2:32:32:32-p3:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64"
+declare i8 @llvm.abs.i8(i8, i1)
+
define i32 @test1(i32 %X) {
; CHECK-LABEL: @test1(
; CHECK-NEXT: [[X_LOBIT:%.*]] = lshr i32 [[X:%.*]], 31
@@ -1090,6 +1092,28 @@ define zeroext i1 @cmpabs2(i64 %val) {
ret i1 %tobool
}
+define i1 @abs_intrin_eq_zero(i8 %x) {
+; CHECK-LABEL: @abs_intrin_eq_zero(
+; CHECK-NEXT: [[ABS:%.*]] = call i8 @llvm.abs.i8(i8 [[X:%.*]], i1 false)
+; CHECK-NEXT: [[CMP:%.*]] = icmp eq i8 [[ABS]], 0
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %abs = call i8 @llvm.abs.i8(i8 %x, i1 false)
+ %cmp = icmp eq i8 %abs, 0
+ ret i1 %cmp
+}
+
+define i1 @abs_intrin_ne_zero(i8 %x) {
+; CHECK-LABEL: @abs_intrin_ne_zero(
+; CHECK-NEXT: [[ABS:%.*]] = call i8 @llvm.abs.i8(i8 [[X:%.*]], i1 false)
+; CHECK-NEXT: [[CMP:%.*]] = icmp ne i8 [[ABS]], 0
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %abs = call i8 @llvm.abs.i8(i8 %x, i1 false)
+ %cmp = icmp ne i8 %abs, 0
+ ret i1 %cmp
+}
+
define void @test58() {
; CHECK-LABEL: @test58(
; CHECK-NEXT: [[CALL:%.*]] = call i32 @test58_d(i64 36029346783166592)
More information about the llvm-commits
mailing list