[clang] [llvm] [RISCV] Implement the implications of C extension (PR #132259)

2025-04-05 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-backend-risc-v Author: Jesse Huang (jaidTw) Changes Implement the following implications according to the [Zc spec](https://github.com/riscvarchive/riscv-code-size-reduction/blob/main/Zc-specification/Zc.adoc#13-c) > As C defines the same instructions

[clang] [llvm] [RISCV] Implement the implications of C extension (PR #132259)

2025-03-27 Thread Kito Cheng via cfe-commits
@@ -25,8 +25,8 @@ addi a0, a1, 0 # CHECK: # encoding: [0xe0,0x1f] addi s0, sp, 1020 -# CHECK: .option arch, -c -.option arch, -c +# CHECK: .option arch, -c, -zca +.option arch, -c, -zca kito-cheng wrote: I guess `.opt arch, -zca` won't work because C will im

[clang] [llvm] [RISCV] Implement the implications of C extension (PR #132259)

2025-03-25 Thread Sam Elliott via cfe-commits
https://github.com/lenary commented: I commented about the predicates (before i saw the other comments). I thought they'd be ok to do in a follow-up, but you should just to the refactoring now as it won't quite be NFC as I expected. https://github.com/llvm/llvm-project/pull/132259

[clang] [llvm] [RISCV] Implement the implications of C extension (PR #132259)

2025-03-24 Thread Craig Topper via cfe-commits
https://github.com/topperc approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/132259 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [RISCV] Implement the implications of C extension (PR #132259)

2025-03-22 Thread LLVM Continuous Integration via cfe-commits
llvm-ci wrote: LLVM Buildbot has detected a new failure on builder `premerge-monolithic-linux` running on `premerge-linux-1` while building `clang,llvm` at step 7 "test-build-unified-tree-check-all". Full details are available at: https://lab.llvm.org/buildbot/#/builders/153/builds/26585 He

[clang] [llvm] [RISCV] Implement the implications of C extension (PR #132259)

2025-03-22 Thread LLVM Continuous Integration via cfe-commits
llvm-ci wrote: LLVM Buildbot has detected a new failure on builder `lld-x86_64-ubuntu-fast` running on `as-builder-4` while building `clang,llvm` at step 6 "test-build-unified-tree-check-all". Full details are available at: https://lab.llvm.org/buildbot/#/builders/33/builds/13582 Here is th

[clang] [llvm] [RISCV] Implement the implications of C extension (PR #132259)

2025-03-22 Thread LLVM Continuous Integration via cfe-commits
llvm-ci wrote: LLVM Buildbot has detected a new failure on builder `sanitizer-aarch64-linux-bootstrap-hwasan` running on `sanitizer-buildbot12` while building `clang,llvm` at step 2 "annotate". Full details are available at: https://lab.llvm.org/buildbot/#/builders/55/builds/8811 Here is th

[clang] [llvm] [RISCV] Implement the implications of C extension (PR #132259)

2025-03-22 Thread LLVM Continuous Integration via cfe-commits
llvm-ci wrote: LLVM Buildbot has detected a new failure on builder `llvm-x86_64-debian-dylib` running on `gribozavr4` while building `clang,llvm` at step 8 "test-build-unified-tree-check-lld". Full details are available at: https://lab.llvm.org/buildbot/#/builders/60/builds/22785 Here is th

[clang] [llvm] [RISCV] Implement the implications of C extension (PR #132259)

2025-03-22 Thread LLVM Continuous Integration via cfe-commits
llvm-ci wrote: LLVM Buildbot has detected a new failure on builder `llvm-clang-x86_64-gcc-ubuntu` running on `sie-linux-worker3` while building `clang,llvm` at step 6 "test-build-unified-tree-check-all". Full details are available at: https://lab.llvm.org/buildbot/#/builders/174/builds/14962

[clang] [llvm] [RISCV] Implement the implications of C extension (PR #132259)

2025-03-21 Thread Jesse Huang via cfe-commits
https://github.com/jaidTw closed https://github.com/llvm/llvm-project/pull/132259 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [RISCV] Implement the implications of C extension (PR #132259)

2025-03-21 Thread Jesse Huang via cfe-commits
@@ -378,6 +370,14 @@ def FeatureStdExtZca "part of the C extension, excluding compressed " "floating point loads/stores">; +def FeatureStdExtC +: RISCVExtension<2, 0, "Compressed Instructions", [FeatureStdExtZca]>, + RISCVExte

[clang] [llvm] [RISCV] Implement the implications of C extension (PR #132259)

2025-03-21 Thread Craig Topper via cfe-commits
@@ -25,8 +25,8 @@ addi a0, a1, 0 # CHECK: # encoding: [0xe0,0x1f] addi s0, sp, 1020 -# CHECK: .option arch, -c -.option arch, -c +# CHECK: .option arch, -c, -zca +.option arch, -c, -zca topperc wrote: The code for removing a feature doesn't even try to remov

[clang] [llvm] [RISCV] Implement the implications of C extension (PR #132259)

2025-03-21 Thread Sam Elliott via cfe-commits
@@ -378,6 +370,14 @@ def FeatureStdExtZca "part of the C extension, excluding compressed " "floating point loads/stores">; +def FeatureStdExtC +: RISCVExtension<2, 0, "Compressed Instructions", [FeatureStdExtZca]>, + RISCVExte

[clang] [llvm] [RISCV] Implement the implications of C extension (PR #132259)

2025-03-21 Thread Sam Elliott via cfe-commits
https://github.com/lenary approved this pull request. LGTM, with one comment. https://github.com/llvm/llvm-project/pull/132259 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [RISCV] Implement the implications of C extension (PR #132259)

2025-03-21 Thread Sam Elliott via cfe-commits
https://github.com/lenary edited https://github.com/llvm/llvm-project/pull/132259 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [RISCV] Implement the implications of C extension (PR #132259)

2025-03-20 Thread Pengcheng Wang via cfe-commits
https://github.com/wangpc-pp approved this pull request. I'd like to give it a LGTM. :-) https://github.com/llvm/llvm-project/pull/132259 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commit

[clang] [llvm] [RISCV] Implement the implications of C extension (PR #132259)

2025-03-20 Thread Kito Cheng via cfe-commits
kito-cheng wrote: (Disclaimer: I am not intend to ignite the flames of war about the ISA string canonicalization!) Give few more background behind the PR, the issue we want to resolve is the multilib issue: we starting using `zc*` extension, but we also have user for using `c` extension, howe

[clang] [llvm] [RISCV] Implement the implications of C extension (PR #132259)

2025-03-20 Thread Jesse Huang via cfe-commits
https://github.com/jaidTw created https://github.com/llvm/llvm-project/pull/132259 Implement the following implications according to the [Zc spec](https://github.com/riscvarchive/riscv-code-size-reduction/blob/main/Zc-specification/Zc.adoc#13-c) > As C defines the same instructions as Zca, Zcf

[clang] [llvm] [RISCV] Implement the implications of C extension (PR #132259)

2025-03-20 Thread Sam Elliott via cfe-commits
@@ -856,6 +856,19 @@ void RISCVISAInfo::updateImplication() { }); } + // Add Zcd if C and D are enabled. + if (Exts.count("c") && Exts.count("d") && !Exts.count("zcd")) { +auto Version = findDefaultVersion("zcd"); +Exts["zcd"] = *Version; + } + +

[clang] [llvm] [RISCV] Implement the implications of C extension (PR #132259)

2025-03-20 Thread Sam Elliott via cfe-commits
@@ -378,6 +370,14 @@ def FeatureStdExtZca "part of the C extension, excluding compressed " "floating point loads/stores">; +def FeatureStdExtC +: RISCVExtension<2, 0, "Compressed Instructions", [FeatureStdExtZca]>, + RISCVExte

[clang] [llvm] [RISCV] Implement the implications of C extension (PR #132259)

2025-03-20 Thread Sam Elliott via cfe-commits
https://github.com/lenary edited https://github.com/llvm/llvm-project/pull/132259 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [RISCV] Implement the implications of C extension (PR #132259)

2025-03-20 Thread Sam Elliott via cfe-commits
@@ -25,8 +25,8 @@ addi a0, a1, 0 # CHECK: # encoding: [0xe0,0x1f] addi s0, sp, 1020 -# CHECK: .option arch, -c -.option arch, -c +# CHECK: .option arch, -c, -zca +.option arch, -c, -zca lenary wrote: This is because your predicates need a little bit of work,

[clang] [llvm] [RISCV] Implement the implications of C extension (PR #132259)

2025-03-20 Thread Jesse Huang via cfe-commits
@@ -25,8 +25,8 @@ addi a0, a1, 0 # CHECK: # encoding: [0xe0,0x1f] addi s0, sp, 1020 -# CHECK: .option arch, -c -.option arch, -c +# CHECK: .option arch, -c, -zca +.option arch, -c, -zca jaidTw wrote: I tried but failed, seems like both are required https://

[clang] [llvm] [RISCV] Implement the implications of C extension (PR #132259)

2025-03-20 Thread Jesse Huang via cfe-commits
https://github.com/jaidTw updated https://github.com/llvm/llvm-project/pull/132259 >From e147dd68477b7e5ec9e6363a45fd7568fe595b04 Mon Sep 17 00:00:00 2001 From: Jesse Huang Date: Thu, 20 Mar 2025 10:34:14 -0700 Subject: [PATCH 1/2] [RISCV] Implement the implications of C extension --- .../Cod

[clang] [llvm] [RISCV] Implement the implications of C extension (PR #132259)

2025-03-20 Thread Craig Topper via cfe-commits
@@ -25,8 +25,8 @@ addi a0, a1, 0 # CHECK: # encoding: [0xe0,0x1f] addi s0, sp, 1020 -# CHECK: .option arch, -c -.option arch, -c +# CHECK: .option arch, -c, -zca +.option arch, -c, -zca topperc wrote: Does just `.opt arch, -zca` work? https://github.com/llv

[clang] [llvm] [RISCV] Implement the implications of C extension (PR #132259)

2025-03-20 Thread via cfe-commits
github-actions[bot] wrote: :warning: C/C++ code formatter, clang-format found issues in your code. :warning: You can test this locally with the following command: ``bash git-clang-format --diff d0d33d2b5ba3369d4a5586234181055935965e49 e147dd68477b7e5ec9e6363a45fd7568fe595b04 --e