[clang] [llvm] [Instcombine] use zext's nneg flag for icmp folding (PR #70845)
LĂ©onard Oest O'Leary via llvm-commits
llvm-commits at lists.llvm.org
Sat Nov 11 08:58:11 PST 2023
================
@@ -0,0 +1,112 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 3
+; RUN: opt < %s -O3 -S | FileCheck %s
+; See issue #55013 and PR #70845 for more details.
+; This test comes from the following C program, compiled with clang
+;
+;; short vecreduce_smin_v2i16(int n, short* v)
+;; {
+;; short p = 0;
+;; for (int i = 0; i < n; ++i)
+;; p = p > v[i] ? v[i] : p;
+;; return p;
+;; }
+;
+;; short vecreduce_smax_v2i16(int n, short* v)
+;; {
+;; short p = 0;
+;; for (int i = 0; i < n; ++i)
+;; p = p < v[i] ? v[i] : p;
+;; return p;
+;; }
+
+define i16 @vecreduce_smin_v2i16(i32 %n, ptr %v) {
+; CHECK-LABEL: define i16 @vecreduce_smin_v2i16(
+; CHECK: @llvm.smin.v2i16
----------------
leo-ard wrote:
I didn't keep all the checks generated by `llvm/utils/update_test_checks.py` as in this tests, we only want to know if the intrinsics @llvm.smin.v2i16 has been generated or not. Let me know if you think I should leave all the checks
https://github.com/llvm/llvm-project/pull/70845
More information about the llvm-commits
mailing list