[llvm] [AMDGPU][GlobalISel] Fix i64-to-i16 clamp combine on inverted bounds (PR #216306)

Christudasan Devadasan via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 27 05:58:10 PDT 2026


================
@@ -0,0 +1,71 @@
+# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
+# RUN: llc -mtriple=amdgpu9.00-amd-amdhsa -run-pass=amdgpu-prelegalizer-combiner -verify-machineinstrs %s -o - | FileCheck %s
+
+# matchClampI64ToI16 must not fire on inverted bounds: smin(smax(x,100),0) is
+# constant 0, not a [0,100] clamp.
+
+---
----------------
cdevadas wrote:

Add the coverage for i16 extreme values (-32768 & 32767)?

https://github.com/llvm/llvm-project/pull/216306


More information about the llvm-commits mailing list