[llvm] [AMDGPU] Preserve exact flag for lshr (PR #146744)
via llvm-commits
llvm-commits at lists.llvm.org
Wed Jul 2 10:11:10 PDT 2025
================
@@ -0,0 +1,41 @@
+; NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py UTC_ARGS: --version 5
+; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx900 -stop-after=finalize-isel -o - %s | FileCheck %s
+
+;; Test that reduction of:
+;;
+;; DST = lshr i64 X, Y
+;;
+;; where Y is in the range [63-32] to:
+;;
+;; DST = [srl i32 X, (Y & 0x1F), 0]
+;;
+;; preserves flags
+
+define i64 @srl_exact(i64 %arg0, i64 %shift_amt) {
----------------
LU-JOHN wrote:
Test pre-committed in https://github.com/llvm/llvm-project/pull/146747
https://github.com/llvm/llvm-project/pull/146744
More information about the llvm-commits
mailing list