[llvm] 898b406 - [ConstProp] add tests for cmp with null and constexpr; NFC
Sanjay Patel via llvm-commits
llvm-commits at lists.llvm.org
Sun Mar 7 11:56:27 PST 2021
Author: Sanjay Patel
Date: 2021-03-07T14:02:44-05:00
New Revision: 898b40645d4452ac470896783947d8c397422b02
URL: https://github.com/llvm/llvm-project/commit/898b40645d4452ac470896783947d8c397422b02
DIFF: https://github.com/llvm/llvm-project/commit/898b40645d4452ac470896783947d8c397422b02.diff
LOG: [ConstProp] add tests for cmp with null and constexpr; NFC
Added:
llvm/test/Transforms/InstSimplify/ConstProp/icmp-null.ll
Modified:
Removed:
################################################################################
diff --git a/llvm/test/Transforms/InstSimplify/ConstProp/icmp-null.ll b/llvm/test/Transforms/InstSimplify/ConstProp/icmp-null.ll
new file mode 100644
index 000000000000..5ee8e7a4983b
--- /dev/null
+++ b/llvm/test/Transforms/InstSimplify/ConstProp/icmp-null.ll
@@ -0,0 +1,34 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
+; RUN: opt < %s -instsimplify -S -verify | FileCheck %s
+
+define i1 @ule_null_constexpr(i8* %x) {
+; CHECK-LABEL: @ule_null_constexpr(
+; CHECK-NEXT: ret i1 icmp uge (i8 (...)* bitcast (i1 (i8*)* @ule_null_constexpr to i8 (...)*), i8 (...)* null)
+;
+ %cmp = icmp ule i8 (...)* null, bitcast (i1 (i8*)* @ule_null_constexpr to i8 (...)*)
+ ret i1 %cmp
+}
+
+define i1 @ugt_null_constexpr(i8* %x) {
+; CHECK-LABEL: @ugt_null_constexpr(
+; CHECK-NEXT: ret i1 icmp ult (i8 (...)* bitcast (i1 (i8*)* @ugt_null_constexpr to i8 (...)*), i8 (...)* null)
+;
+ %cmp = icmp ugt i8 (...)* null, bitcast (i1 (i8*)* @ugt_null_constexpr to i8 (...)*)
+ ret i1 %cmp
+}
+
+define i1 @uge_constexpr_null(i8* %x) {
+; CHECK-LABEL: @uge_constexpr_null(
+; CHECK-NEXT: ret i1 icmp uge (i8 (...)* bitcast (i1 (i8*)* @ugt_null_constexpr to i8 (...)*), i8 (...)* null)
+;
+ %cmp = icmp uge i8 (...)* bitcast (i1 (i8*)* @ugt_null_constexpr to i8 (...)*), null
+ ret i1 %cmp
+}
+
+define i1 @ult_constexpr_null(i8* %x) {
+; CHECK-LABEL: @ult_constexpr_null(
+; CHECK-NEXT: ret i1 icmp ult (i8 (...)* bitcast (i1 (i8*)* @ugt_null_constexpr to i8 (...)*), i8 (...)* null)
+;
+ %cmp = icmp ult i8 (...)* bitcast (i1 (i8*)* @ugt_null_constexpr to i8 (...)*), null
+ ret i1 %cmp
+}
More information about the llvm-commits
mailing list