[llvm] [InstCombine] Fold `(trunc X)` into `X & Mask` inside `decomposeBitTestICmp` (PR #171195)
Tirthankar Mazumder via llvm-commits
llvm-commits at lists.llvm.org
Sat Dec 13 20:43:05 PST 2025
================
@@ -314,15 +314,10 @@ define i1 @sgt_n1_use(i32 %x) {
}
define i1 @trunc_eq_i32_i8(i32 %x) {
-; DL64-LABEL: @trunc_eq_i32_i8(
-; DL64-NEXT: [[TMP1:%.*]] = and i32 [[X:%.*]], 255
-; DL64-NEXT: [[R:%.*]] = icmp eq i32 [[TMP1]], 42
-; DL64-NEXT: ret i1 [[R]]
-;
-; DL8-LABEL: @trunc_eq_i32_i8(
-; DL8-NEXT: [[T:%.*]] = trunc i32 [[X:%.*]] to i8
-; DL8-NEXT: [[R:%.*]] = icmp eq i8 [[T]], 42
-; DL8-NEXT: ret i1 [[R]]
+; CHECK-LABEL: @trunc_eq_i32_i8(
----------------
wermos wrote:
I took a closer look at the test case and now I understand why this guard is needed. I see the failing tests and I am working on a more refined and correct fix.
https://github.com/llvm/llvm-project/pull/171195
More information about the llvm-commits
mailing list