[llvm-branch-commits] [SPARC] Promote i32 CTTZ when we have VIS3 (PR #135894)

2025-04-26 Thread via llvm-branch-commits
https://github.com/koachan updated https://github.com/llvm/llvm-project/pull/135894 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [SPARC] Promote i32 CTTZ when we have VIS3 (PR #135894)

2025-04-26 Thread via llvm-branch-commits
https://github.com/koachan updated https://github.com/llvm/llvm-project/pull/135894 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [SPARC] Promote i32 CTTZ when we have VIS3 (PR #135894)

2025-04-26 Thread via llvm-branch-commits
koachan wrote: Wait yeah I forgot about this, sorry sorry... Lemme merge this~ https://github.com/llvm/llvm-project/pull/135894 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm

[llvm-branch-commits] [SPARC] Promote i32 CTTZ when we have VIS3 (PR #135894)

2025-04-26 Thread Sergei Barannikov via llvm-branch-commits
s-barannikov wrote: Is something blocking this PR? https://github.com/llvm/llvm-project/pull/135894 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [SPARC] Promote i32 CTTZ when we have VIS3 (PR #135894)

2025-04-20 Thread Sergei Barannikov via llvm-branch-commits
@@ -1,70 +1,438 @@ ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py -; RUN: llc < %s -mtriple=sparc -mcpu=v9 | FileCheck %s +; RUN: llc < %s -mtriple=sparc | FileCheck %s -check-prefix=SPARC +; RUN: llc < %s -mtriple=sparc -mattr=popc | FileCheck %s

[llvm-branch-commits] [SPARC] Promote i32 CTTZ when we have VIS3 (PR #135894)

2025-04-20 Thread via llvm-branch-commits
https://github.com/koachan updated https://github.com/llvm/llvm-project/pull/135894 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [SPARC] Promote i32 CTTZ when we have VIS3 (PR #135894)

2025-04-20 Thread via llvm-branch-commits
https://github.com/koachan updated https://github.com/llvm/llvm-project/pull/135894 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [SPARC] Promote i32 CTTZ when we have VIS3 (PR #135894)

2025-04-19 Thread Sergei Barannikov via llvm-branch-commits
https://github.com/s-barannikov approved this pull request. LGTM with one note https://github.com/llvm/llvm-project/pull/135894 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm

[llvm-branch-commits] [SPARC] Promote i32 CTTZ when we have VIS3 (PR #135894)

2025-04-19 Thread Sergei Barannikov via llvm-branch-commits
@@ -1,70 +1,438 @@ ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py -; RUN: llc < %s -mtriple=sparc -mcpu=v9 | FileCheck %s +; RUN: llc < %s -mtriple=sparc | FileCheck %s -check-prefix=SPARC +; RUN: llc < %s -mtriple=sparc -mattr=popc | FileCheck %s

[llvm-branch-commits] [SPARC] Promote i32 CTTZ when we have VIS3 (PR #135894)

2025-04-19 Thread Sergei Barannikov via llvm-branch-commits
https://github.com/s-barannikov edited https://github.com/llvm/llvm-project/pull/135894 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [SPARC] Promote i32 CTTZ when we have VIS3 (PR #135894)

2025-04-17 Thread via llvm-branch-commits
@@ -3599,6 +3615,15 @@ bool SparcTargetLowering::isFPImmLegal(const APFloat &Imm, EVT VT, bool SparcTargetLowering::isCtlzFast() const { return Subtarget->isVIS3(); } +bool SparcTargetLowering::isCheapToSpeculateCttz(Type *Ty) const { + // We lack native cttz, however, + /

[llvm-branch-commits] [SPARC] Promote i32 CTTZ when we have VIS3 (PR #135894)

2025-04-17 Thread Sergei Barannikov via llvm-branch-commits
@@ -3599,6 +3615,15 @@ bool SparcTargetLowering::isFPImmLegal(const APFloat &Imm, EVT VT, bool SparcTargetLowering::isCtlzFast() const { return Subtarget->isVIS3(); } +bool SparcTargetLowering::isCheapToSpeculateCttz(Type *Ty) const { + // We lack native cttz, however, + /

[llvm-branch-commits] [SPARC] Promote i32 CTTZ when we have VIS3 (PR #135894)

2025-04-17 Thread Sergei Barannikov via llvm-branch-commits
@@ -3599,6 +3615,15 @@ bool SparcTargetLowering::isFPImmLegal(const APFloat &Imm, EVT VT, bool SparcTargetLowering::isCtlzFast() const { return Subtarget->isVIS3(); } +bool SparcTargetLowering::isCheapToSpeculateCttz(Type *Ty) const { + // We lack native cttz, however, + /

[llvm-branch-commits] [SPARC] Promote i32 CTTZ when we have VIS3 (PR #135894)

2025-04-17 Thread via llvm-branch-commits
https://github.com/koachan updated https://github.com/llvm/llvm-project/pull/135894 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [SPARC] Promote i32 CTTZ when we have VIS3 (PR #135894)

2025-04-17 Thread via llvm-branch-commits
https://github.com/koachan updated https://github.com/llvm/llvm-project/pull/135894 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [SPARC] Promote i32 CTTZ when we have VIS3 (PR #135894)

2025-04-17 Thread via llvm-branch-commits
https://github.com/koachan updated https://github.com/llvm/llvm-project/pull/135894 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [SPARC] Promote i32 CTTZ when we have VIS3 (PR #135894)

2025-04-16 Thread via llvm-branch-commits
https://github.com/koachan updated https://github.com/llvm/llvm-project/pull/135894 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [SPARC] Promote i32 CTTZ when we have VIS3 (PR #135894)

2025-04-16 Thread via llvm-branch-commits
@@ -1,70 +1,195 @@ ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py -; RUN: llc < %s -mtriple=sparc -mcpu=v9 | FileCheck %s +; RUN: llc < %s -mtriple=sparcv9 | FileCheck %s -check-prefix=V9 +; RUN: llc < %s -mtriple=sparcv9 -mattr=popc | FileCheck %s

[llvm-branch-commits] [SPARC] Promote i32 CTTZ when we have VIS3 (PR #135894)

2025-04-15 Thread Sergei Barannikov via llvm-branch-commits
@@ -1,70 +1,195 @@ ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py -; RUN: llc < %s -mtriple=sparc -mcpu=v9 | FileCheck %s +; RUN: llc < %s -mtriple=sparcv9 | FileCheck %s -check-prefix=V9 +; RUN: llc < %s -mtriple=sparcv9 -mattr=popc | FileCheck %s

[llvm-branch-commits] [SPARC] Promote i32 CTTZ when we have VIS3 (PR #135894)

2025-04-15 Thread via llvm-branch-commits
llvmbot wrote: @llvm/pr-subscribers-backend-sparc Author: Koakuma (koachan) Changes CTTZ can be implemented in terms of CTLZ, for which there's a native instruction in VIS3. Promote i32 CTTZ in that case so that the native instruction gets used. --- Full diff: https://github.com/llvm/llv

[llvm-branch-commits] [SPARC] Promote i32 CTTZ when we have VIS3 (PR #135894)

2025-04-15 Thread via llvm-branch-commits
https://github.com/koachan created https://github.com/llvm/llvm-project/pull/135894 CTTZ can be implemented in terms of CTLZ, for which there's a native instruction in VIS3. Promote i32 CTTZ in that case so that the native instruction gets used. ___