[llvm] [InstCombine] Combine trunc (lshr X, BW-1) to i1 --> icmp slt X, 0 (#142593) (PR #143846)
via llvm-commits
llvm-commits at lists.llvm.org
Thu Jun 12 02:04:44 PDT 2025
================
@@ -0,0 +1,23 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
+; RUN: opt -S -passes=instcombine < %s | FileCheck %s
+
+define i1 @src(i32 %0, ptr writeonly captures(none) initializes((0, 4)) %p) local_unnamed_addr #0 {
+; CHECK-LABEL: define i1 @src(
+; CHECK-SAME: i32 [[TMP0:%.*]], ptr writeonly captures(none) initializes((0, 4)) [[P:%.*]]) local_unnamed_addr #[[ATTR0:[0-9]+]] {
+; CHECK-NEXT: [[COMMON_RET1:.*:]]
+; CHECK-NEXT: [[DOTLOBIT:%.*]] = lshr i32 [[TMP0]], 31
+; CHECK-NEXT: store i32 [[DOTLOBIT]], ptr [[P]], align 1
+; CHECK-NEXT: ret i1 false
+;
+common.ret1:
+ %.lobit = lshr i32 %0, 31
+ %1 = trunc nuw i32 %.lobit to i1
----------------
mayanksolanki393 wrote:
sure
https://github.com/llvm/llvm-project/pull/143846
More information about the llvm-commits
mailing list