[llvm] [CGP] Despeculate ctlz/cttz with "illegal" integer types (PR #137197)

Sergei Barannikov via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 24 08:36:38 PDT 2025


================
@@ -5,12 +5,44 @@
 ; RUN: llc < %s -mtriple=x86_64-- -mattr=+lzcnt | FileCheck %s --check-prefixes=X64,X64-LZCNT
 
 define i1 @lshr_ctlz_cmpeq_one_i64(i64 %in) nounwind {
-; X86-LABEL: lshr_ctlz_cmpeq_one_i64:
-; X86:       # %bb.0:
-; X86-NEXT:    movl {{[0-9]+}}(%esp), %eax
-; X86-NEXT:    orl {{[0-9]+}}(%esp), %eax
-; X86-NEXT:    sete %al
-; X86-NEXT:    retl
+; X86-BSR-LABEL: lshr_ctlz_cmpeq_one_i64:
----------------
s-barannikov wrote:

@RKSimon This is a clear regression, but the test doesn't look like a real input to ISel. InstCombine successfully folds it into one comparison: https://godbolt.org/z/jvYeEKK6G.
Should I remove these tests?


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


More information about the llvm-commits mailing list