[clang] [llvm] [clang][RISCV] Change default abi with f extension but without d extension (PR #73489)

2023-12-07 Thread Wang Pengcheng via cfe-commits
wangpc-pp wrote: As @kito-cheng has pointed out, we should fix multilib issue before landing this. It seems we don't generate multilib for ilp32f and lp64f in riscv-gnu-toolchain? https://github.com/llvm/llvm-project/pull/73489 ___ cfe-commits mailin

[llvm] [clang] [RISCV] Add support for experimental Zimop extension (PR #74824)

2023-12-10 Thread Wang Pengcheng via cfe-commits
wangpc-pp wrote: Please reorginize the patch as @dtcxzyw suggested. :-) I didn't notice this extension before, so I may not be asking the right question here: These MOPs can be redefined, then, are we able to schedule them in compiler? Becase we don't know the cost of MOPs if we don't know how

[llvm] [clang] [RISCV] Add support for experimental Zimop extension (PR #74824)

2023-12-10 Thread Wang Pengcheng via cfe-commits
wangpc-pp wrote: > Please reorganize the patch as @dtcxzyw suggested. :-) > > I didn't notice this extension before, so I may not be asking the right > question here: These MOPs can be redefined, then, are we able to schedule > them in compiler? Becase we don't know the cost of MOPs if we don'

[clang] [llvm] [RISCV] Update the interface of sifive vqmaccqoq (PR #74284)

2023-12-11 Thread Wang Pengcheng via cfe-commits
@@ -130,18 +138,18 @@ multiclass RVVVFNRCLIPBuiltinSet; -defm sf_vqmacc_2x8x2 : RVVVQMACCBuiltinSet<[["", "v", "vv(FixedSEW:8)Sv(FixedSEW:8)v"]]>; -defm sf_vqmaccus_2x8x2 : RVVVQMACCBuiltinSet<[["", "v", "vv(FixedSEW:8)SUv(FixedSEW:8)v"]]>; -defm sf_vqmaccsu_2x8x2 :

[clang] [RISCV][NFC] Use AddTargetFeature to add fast-unaligned-access (PR #74280)

2023-12-12 Thread Wang Pengcheng via cfe-commits
wangpc-pp wrote: Ping. https://github.com/llvm/llvm-project/pull/74280 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [RISCV][NFC] Use AddTargetFeature to add fast-unaligned-access (PR #74280)

2023-12-12 Thread Wang Pengcheng via cfe-commits
https://github.com/wangpc-pp closed https://github.com/llvm/llvm-project/pull/74280 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [libcxx] [llvm] [compiler-rt] [libc] [flang] [clang] [RISCV][MC] Add support for experimental Zimop extension (PR #75182)

2023-12-14 Thread Wang Pengcheng via cfe-commits
https://github.com/wangpc-pp approved this pull request. LGTM. https://github.com/llvm/llvm-project/pull/75182 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[llvm] [clang] [RISCV] Add sifive-p450 CPU. (PR #75760)

2023-12-18 Thread Wang Pengcheng via cfe-commits
wangpc-pp wrote: Add test in `clang/test/Driver/riscv-cpus.c`? https://github.com/llvm/llvm-project/pull/75760 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[llvm] [clang] [RISCV] Add sifive-p450 CPU. (PR #75760)

2023-12-19 Thread Wang Pengcheng via cfe-commits
@@ -222,6 +222,11 @@ // MCPU-SIFIVE-X280-SAME: "-target-feature" "+zvl512b" "-target-feature" "+zvl64b" // MCPU-SIFIVE-X280-SAME: "-target-abi" "lp64d" +// RUN: %clang -target riscv64 -### -c %s 2>&1 -menable-experimental-extensions -mcpu=sifive-p450 | FileCheck -check-pref

[clang] [llvm] [RISCV] Add sifive-p450 CPU. (PR #75760)

2023-12-19 Thread Wang Pengcheng via cfe-commits
@@ -222,6 +222,11 @@ // MCPU-SIFIVE-X280-SAME: "-target-feature" "+zvl512b" "-target-feature" "+zvl64b" // MCPU-SIFIVE-X280-SAME: "-target-abi" "lp64d" +// RUN: %clang -target riscv64 -### -c %s 2>&1 -menable-experimental-extensions -mcpu=sifive-p450 | FileCheck -check-pref

[llvm] [clang] [RISCV] Add sifive-p450 CPU. (PR #75760)

2023-12-19 Thread Wang Pengcheng via cfe-commits
@@ -222,6 +222,11 @@ // MCPU-SIFIVE-X280-SAME: "-target-feature" "+zvl512b" "-target-feature" "+zvl64b" // MCPU-SIFIVE-X280-SAME: "-target-abi" "lp64d" +// RUN: %clang -target riscv64 -### -c %s 2>&1 -menable-experimental-extensions -mcpu=sifive-p450 | FileCheck -check-pref

[clang] [llvm] [RISCV] Add sifive-p450 CPU. (PR #75760)

2023-12-19 Thread Wang Pengcheng via cfe-commits
@@ -216,6 +216,25 @@ def SIFIVE_X280 : RISCVProcessorModel<"sifive-x280", SiFive7Model, [TuneSiFive7, TuneDLenFactor2]>; +def SIFIVE_P450 : RISCVProcessorModel<"sifive-p450", NoSchedModel, +

[clang] [llvm] [RISCV] Add sifive-p450 CPU. (PR #75760)

2023-12-19 Thread Wang Pengcheng via cfe-commits
https://github.com/wangpc-pp approved this pull request. LGTM. https://github.com/llvm/llvm-project/pull/75760 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[llvm] [clang] [clang][RISCV] Change default abi when only have f extension but no d extension (PR #73489)

2023-11-27 Thread Wang Pengcheng via cfe-commits
https://github.com/wangpc-pp approved this pull request. I have similar patch before: https://reviews.llvm.org/D125947, so it LGTM as GCC's default behavior has changed. :-) But please wait for others' opinions. https://github.com/llvm/llvm-project/pull/73489 ___

[clang] [llvm] [clang][RISCV] Change default abi when only have f extension but no d extension (PR #73489)

2023-11-28 Thread Wang Pengcheng via cfe-commits
wangpc-pp wrote: > short version: GCC isn't change. long version: GCC's configure script isn't > change, it's configure script in riscv-gnu-toolchain So why is there a difference between GCC and riscv-gnu-toolchain? If we set `with_abi` to lp64f, what is the behavior? > > But I don't have str

[clang] [llvm] [RISCV] Collapse fast unaligned access into a single feature [nfc-ish] (PR #73971)

2023-11-30 Thread Wang Pengcheng via cfe-commits
https://github.com/wangpc-pp approved this pull request. LGTM with nit. https://github.com/llvm/llvm-project/pull/73971 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[llvm] [clang] [RISCV] Collapse fast unaligned access into a single feature [nfc-ish] (PR #73971)

2023-11-30 Thread Wang Pengcheng via cfe-commits
https://github.com/wangpc-pp edited https://github.com/llvm/llvm-project/pull/73971 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[llvm] [clang] [RISCV] Collapse fast unaligned access into a single feature [nfc-ish] (PR #73971)

2023-11-30 Thread Wang Pengcheng via cfe-commits
@@ -171,18 +171,12 @@ void riscv::getRISCVTargetFeatures(const Driver &D, const llvm::Triple &Triple, Features.push_back("-save-restore"); // -mno-unaligned-access is default, unless -munaligned-access is specified. - bool HasV = llvm::is_contained(Features, "+zve32x")

[clang] [clang][RISCVVEmitter] Remove no-op ptr-to-ptr bitcast (NFC) (PR #74179)

2023-12-03 Thread Wang Pengcheng via cfe-commits
@@ -180,13 +180,10 @@ void emitCodeGenSwitchBody(const RVVIntrinsic *RVVI, raw_ostream &OS) { return; } - // Cast pointer operand of vector load intrinsic. for (const auto &I : enumerate(RVVI->getInputTypes())) { wangpc-pp wrote: Why not remove thi

[clang] [RISCV][NFC] Use AddTargetFeature to add fast-unaligned-access (PR #74280)

2023-12-03 Thread Wang Pengcheng via cfe-commits
https://github.com/wangpc-pp created https://github.com/llvm/llvm-project/pull/74280 We can reduce some code. >From 1a9364a8b1e0eae320774253ac98a445daf7ec9f Mon Sep 17 00:00:00 2001 From: wangpc Date: Mon, 4 Dec 2023 14:11:19 +0800 Subject: [PATCH] [RISCV][NFC] Use AddTargetFeature to add fa

[clang] [llvm] [RFC][RISCV] Support RISC-V Profiles in -march option (PR #76357)

2023-12-25 Thread Wang Pengcheng via cfe-commits
https://github.com/wangpc-pp created https://github.com/llvm/llvm-project/pull/76357 This PR implements the draft https://github.com/riscv-non-isa/riscv-toolchain-conventions/pull/36. Currently, we replace specified profile in `-march` with standard arch string. We may need to pass it to backe

[clang] [llvm] [RFC][RISCV] Support RISC-V Profiles in -march option (PR #76357)

2023-12-25 Thread Wang Pengcheng via cfe-commits
https://github.com/wangpc-pp updated https://github.com/llvm/llvm-project/pull/76357 >From 806babf92282735c364b7ac88faa5256d04f2742 Mon Sep 17 00:00:00 2001 From: wangpc Date: Mon, 25 Dec 2023 18:52:36 +0800 Subject: [PATCH] [RFC][RISCV] Support RISC-V Profiles in -march option This PR impleme

[clang] [llvm] [RISCV] Add MC layer support for Zicfiss. (PR #66043)

2023-12-25 Thread Wang Pengcheng via cfe-commits
wangpc-pp wrote: Should this be rebased on Zimop(https://github.com/llvm/llvm-project/pull/75182) commit? Though I don't know why it has been merged yet... https://github.com/llvm/llvm-project/pull/66043 ___ cfe-commits mailing list cfe-commits@lists

[llvm] [clang] [RISCV] Add MC layer support for Zicfiss. (PR #66043)

2023-12-26 Thread Wang Pengcheng via cfe-commits
wangpc-pp wrote: It seems that the author of Zimop implementation doesn't have commit access. @yetingk Would you mind to commit it and rebase your PR on that? It will make this PR simpler. https://github.com/llvm/llvm-project/pull/66043 ___ cfe-commi

[clang] [RISCV][NFC] Use RISCVISAInfo instead of string comparison (PR #76387)

2023-12-26 Thread Wang Pengcheng via cfe-commits
https://github.com/wangpc-pp created https://github.com/llvm/llvm-project/pull/76387 The arch string may not start with rv32/rv64 if we have supported profiles in `-march`. >From ed8ebdb6f2133f84d1f5a8d2cd580dba4ceed922 Mon Sep 17 00:00:00 2001 From: wangpc Date: Tue, 26 Dec 2023 15:58:10 +08

[clang] [RISCV][NFC] Use RISCVISAInfo instead of string comparison (PR #76387)

2023-12-26 Thread Wang Pengcheng via cfe-commits
https://github.com/wangpc-pp updated https://github.com/llvm/llvm-project/pull/76387 >From ed8ebdb6f2133f84d1f5a8d2cd580dba4ceed922 Mon Sep 17 00:00:00 2001 From: wangpc Date: Tue, 26 Dec 2023 15:58:10 +0800 Subject: [PATCH 1/2] [RISCV][NFC] Use RISCVISAInfo instead of string comparison The a

[llvm] [clang] [RISCV] Add MC layer support for Zicfiss. (PR #66043)

2023-12-26 Thread Wang Pengcheng via cfe-commits
@@ -0,0 +1,71 @@ +//===-- RISCVInstrInfoZicfiss.td - RISC-V Zicfiss -*- tablegen -*--===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apa

[llvm] [clang] [RISCV] Add MC layer support for Zicfiss. (PR #66043)

2023-12-26 Thread Wang Pengcheng via cfe-commits
@@ -0,0 +1,71 @@ +//===-- RISCVInstrInfoZicfiss.td - RISC-V Zicfiss -*- tablegen -*--===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apa

[llvm] [clang] [RISCV][MC] Add support for experimental Zcmop extension (PR #76395)

2023-12-26 Thread Wang Pengcheng via cfe-commits
https://github.com/wangpc-pp created https://github.com/llvm/llvm-project/pull/76395 This implements experimental support for the Zcmop extension as specified here: https://github.com/riscv/riscv-isa-manual/blob/main/src/zimop.adoc. This change adds only MC support. >From 20fd01b09bb196cf538

[llvm] [clang] [RISCV] Add MC layer support for Zicfiss. (PR #66043)

2023-12-26 Thread Wang Pengcheng via cfe-commits
@@ -0,0 +1,71 @@ +//===-- RISCVInstrInfoZicfiss.td - RISC-V Zicfiss -*- tablegen -*--===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apa

[clang] [llvm] [RISCV][MC] Add support for experimental Zcmop extension (PR #76395)

2023-12-26 Thread Wang Pengcheng via cfe-commits
https://github.com/wangpc-pp updated https://github.com/llvm/llvm-project/pull/76395 >From 20fd01b09bb196cf53807b44161482d56a43920b Mon Sep 17 00:00:00 2001 From: wangpc Date: Tue, 26 Dec 2023 20:46:13 +0800 Subject: [PATCH 1/3] [RISCV][MC] Add support for experimental Zcmop extension This imp

[clang] [RISCV][NFC] Use RISCVISAInfo instead of string comparison (PR #76387)

2023-12-26 Thread Wang Pengcheng via cfe-commits
https://github.com/wangpc-pp updated https://github.com/llvm/llvm-project/pull/76387 >From ed8ebdb6f2133f84d1f5a8d2cd580dba4ceed922 Mon Sep 17 00:00:00 2001 From: wangpc Date: Tue, 26 Dec 2023 15:58:10 +0800 Subject: [PATCH 1/3] [RISCV][NFC] Use RISCVISAInfo instead of string comparison The a

[clang] [RISCV][NFC] Use errorToBool (PR #76429)

2023-12-26 Thread Wang Pengcheng via cfe-commits
https://github.com/wangpc-pp created https://github.com/llvm/llvm-project/pull/76429 To reduce calls to `consumeError`. >From 0d8426ffb1202ceca97b25c0dd47d516c1be280e Mon Sep 17 00:00:00 2001 From: wangpc Date: Wed, 27 Dec 2023 14:41:30 +0800 Subject: [PATCH] [RISCV][NFC] Use errorToBool To

[clang] [RISCV][NFC] Use RISCVISAInfo instead of string comparison (PR #76387)

2023-12-26 Thread Wang Pengcheng via cfe-commits
https://github.com/wangpc-pp updated https://github.com/llvm/llvm-project/pull/76387 >From ed8ebdb6f2133f84d1f5a8d2cd580dba4ceed922 Mon Sep 17 00:00:00 2001 From: wangpc Date: Tue, 26 Dec 2023 15:58:10 +0800 Subject: [PATCH 1/4] [RISCV][NFC] Use RISCVISAInfo instead of string comparison The a

[llvm] [clang] [RFC][RISCV] Support RISC-V Profiles in -march option (PR #76357)

2023-12-27 Thread Wang Pengcheng via cfe-commits
https://github.com/wangpc-pp updated https://github.com/llvm/llvm-project/pull/76357 >From 965c1c682d16a3f47c563a301c89e3717bf4d1c5 Mon Sep 17 00:00:00 2001 From: wangpc Date: Mon, 25 Dec 2023 18:52:36 +0800 Subject: [PATCH] [RFC][RISCV] Support RISC-V Profiles in -march option This PR impleme

[clang] [llvm] [RFC][RISCV] Support RISC-V Profiles in -march option (PR #76357)

2023-12-27 Thread Wang Pengcheng via cfe-commits
https://github.com/wangpc-pp updated https://github.com/llvm/llvm-project/pull/76357 >From f4ca1ac0dedf5af0d9ddf05f7a67f30091b296ee Mon Sep 17 00:00:00 2001 From: wangpc Date: Mon, 25 Dec 2023 18:52:36 +0800 Subject: [PATCH] [RFC][RISCV] Support RISC-V Profiles in -march option This PR impleme

[clang] [RISCV][NFC] Use errorToBool (PR #76429)

2023-12-27 Thread Wang Pengcheng via cfe-commits
https://github.com/wangpc-pp closed https://github.com/llvm/llvm-project/pull/76429 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [RISCV][NFC] Use RISCVISAInfo instead of string comparison (PR #76387)

2023-12-27 Thread Wang Pengcheng via cfe-commits
https://github.com/wangpc-pp closed https://github.com/llvm/llvm-project/pull/76387 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [RISCV][MC] Add support for experimental Zcmop extension (PR #76395)

2023-12-27 Thread Wang Pengcheng via cfe-commits
https://github.com/wangpc-pp closed https://github.com/llvm/llvm-project/pull/76395 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[llvm] [clang] [RFC][RISCV] Support RISC-V Profiles in -march option (PR #76357)

2023-12-28 Thread Wang Pengcheng via cfe-commits
https://github.com/wangpc-pp updated https://github.com/llvm/llvm-project/pull/76357 >From fa079e4be8b1b043b635a494b8c0bcc5aa79092b Mon Sep 17 00:00:00 2001 From: wangpc Date: Mon, 25 Dec 2023 18:52:36 +0800 Subject: [PATCH] [RFC][RISCV] Support RISC-V Profiles in -march option This PR impleme

[clang] [llvm] [RFC][RISCV] Support RISC-V Profiles in -march option (PR #76357)

2023-12-28 Thread Wang Pengcheng via cfe-commits
W-angler wrote: Current implementation is based on the comment(https://github.com/riscv-non-isa/riscv-toolchain-conventions/pull/36#issuecomment-1867859642), not the RFC. @dtcxzyw https://github.com/llvm/llvm-project/pull/76357 ___ cfe-commits maili

[clang] [llvm] [RISCV] Add B extension (PR #76893)

2024-01-03 Thread Wang Pengcheng via cfe-commits
https://github.com/wangpc-pp created https://github.com/llvm/llvm-project/pull/76893 It seems that we have `B` extension again: https://github.com/riscv/riscv-b According to the spec, `B` extension represents the collection of the `Zba`, `Zbb`, `Zbs` extensions. Though it hasn't been ratified,

[llvm] [clang] [RISCV] Add B extension (PR #76893)

2024-01-03 Thread Wang Pengcheng via cfe-commits
wangpc-pp wrote: > > I would suggest set it as 0.1 rather than 1.0, and I gonna to ask Ved to > > add version info as well... > > Then also needs to move behind -menable-experimental-extensions. Yes, this is why I set version to 1.0. All implied extensions are ratified but when we want to use

[llvm] [clang] [RISCV] CodeGen of RVE and ilp32e/lp64e ABIs (PR #76777)

2024-01-04 Thread Wang Pengcheng via cfe-commits
wangpc-pp wrote: > @wangpc-pp did you have interested on helping psABI side? it would be great > if you can help since I suspect I don't have enough bandwidth to deal with > that soon. Yes, I'm glad to. I think what we need to do is to fix some Zdinx issues? :-) And, I think I have to explain

[clang] [llvm] [RISCV] Deduplicate RISCVISAInfo::toFeatures/toFeatureVector. NFC (PR #76942)

2024-01-04 Thread Wang Pengcheng via cfe-commits
@@ -42,9 +42,10 @@ static bool getArchFeatures(const Driver &D, StringRef Arch, return false; } - (*ISAInfo)->toFeatures( - Features, [&Args](const Twine &Str) { return Args.MakeArgString(Str); }, - /*AddAllExtensions=*/true); + const auto ISAInfoFeatures = (

[clang] [llvm] [RISCV] CodeGen of RVE and ilp32e/lp64e ABIs (PR #76777)

2024-01-04 Thread Wang Pengcheng via cfe-commits
wangpc-pp wrote: > Side note: shouldn't we also update `compiler-rt/lib/builtins/riscv/{save, > restore}.S`? E.g. with something like this: > [...] > (I don't remember why exactly since I did it a long time ago, but for some > reason I do have this patch in my LLVM fork, so it probably was nec

[llvm] [clang] [RISCV] CodeGen of RVE and ilp32e/lp64e ABIs (PR #76777)

2024-01-05 Thread Wang Pengcheng via cfe-commits
wangpc-pp wrote: > > As for your diffs, it seems that you only handle the > > `__riscv_save/restore_[2|1|0]`, which is incomplete. And the code is not > > different with non-rve cases? > > Yes, I mostly copy-pasted the existing code and removed all of the code > dealing with registers not ava

[llvm] [clang] [RISCV] Add experimental support of Zaamo and Zalrsc (PR #77424)

2024-01-09 Thread Wang Pengcheng via cfe-commits
https://github.com/wangpc-pp created https://github.com/llvm/llvm-project/pull/77424 `A` extension has been split into two parts: Zaamo (Atomic Memory Operations) and Zalrsc (Load-Reserved/Store-Conditional). See also https://github.com/riscv/riscv-zaamo-zalrsc. This patch adds the basic compil

[llvm] [clang] [RISCV] Add experimental support of Zaamo and Zalrsc (PR #77424)

2024-01-09 Thread Wang Pengcheng via cfe-commits
@@ -0,0 +1,11 @@ +# RUN: not llvm-mc -triple riscv32 -mattr=+experimental-zaamo < %s 2>&1 | FileCheck %s wangpc-pp wrote: This can be done in the future, I think. Current implementation refers to the `Zmmul` (which is a sub-extension of M extension). The case i

[clang] [llvm] [RISCV] CodeGen of RVE and ilp32e/lp64e ABIs (PR #76777)

2024-01-09 Thread Wang Pengcheng via cfe-commits
@@ -17,6 +17,13 @@ def HasStdExtZicsr : Predicate<"Subtarget->hasStdExtZicsr()">, AssemblerPredicate<(all_of FeatureStdExtZicsr), "'Zicsr' (CSRs)">; +def FeatureStdExtI +: SubtargetFeature<"i", "HasStdExtI",

[clang] [llvm] [RISCV] CodeGen of RVE and ilp32e/lp64e ABIs (PR #76777)

2024-01-09 Thread Wang Pengcheng via cfe-commits
@@ -83,13 +88,14 @@ RISCVRegisterInfo::getCalleeSavedRegs(const MachineFunction *MF) const { } BitVector RISCVRegisterInfo::getReservedRegs(const MachineFunction &MF) const { + const RISCVSubtarget &STI = MF.getSubtarget(); wangpc-pp wrote: This should be a

[llvm] [clang] [RISCV] CodeGen of RVE and ilp32e/lp64e ABIs (PR #76777)

2024-01-09 Thread Wang Pengcheng via cfe-commits
@@ -985,9 +1003,10 @@ void RISCVFrameLowering::determineCalleeSaves(MachineFunction &MF, }; for (auto Reg : CSRegs) - SavedRegs.set(Reg); + if (Reg < RISCV::X16 || !Subtarget.isRVE()) wangpc-pp wrote: The psABI says: > If used with an ISA t

[clang] [llvm] [RISCV] CodeGen of RVE and ilp32e/lp64e ABIs (PR #76777)

2024-01-10 Thread Wang Pengcheng via cfe-commits
@@ -386,6 +393,11 @@ bool RISCVTargetInfo::handleTargetFeatures(std::vector &Features, if (llvm::is_contained(Features, "+experimental")) HasExperimental = true; + if (ABI == "ilp32e" && ISAInfo->hasExtension("d")) { +Diags.Report(diag::err_invalid_feature_combinat

[clang] [llvm] [RISCV] CodeGen of RVE and ilp32e/lp64e ABIs (PR #76777)

2024-01-10 Thread Wang Pengcheng via cfe-commits
https://github.com/wangpc-pp edited https://github.com/llvm/llvm-project/pull/76777 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][doc] Add blank line before lists (PR #77573)

2024-01-10 Thread Wang Pengcheng via cfe-commits
https://github.com/wangpc-pp created https://github.com/llvm/llvm-project/pull/77573 The doc is not correctly rendered with missing blank lines. >From 2d249aefa1bfa91f41a3866c4203eff041415546 Mon Sep 17 00:00:00 2001 From: wangpc Date: Wed, 10 Jan 2024 17:54:27 +0800 Subject: [PATCH] [Clang][

[clang] [Clang][doc] Add blank line before lists (PR #77573)

2024-01-10 Thread Wang Pengcheng via cfe-commits
https://github.com/wangpc-pp closed https://github.com/llvm/llvm-project/pull/77573 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[llvm] [clang] [RISCV] CodeGen of RVE and ilp32e/lp64e ABIs (PR #76777)

2024-01-11 Thread Wang Pengcheng via cfe-commits
@@ -985,9 +1003,10 @@ void RISCVFrameLowering::determineCalleeSaves(MachineFunction &MF, }; for (auto Reg : CSRegs) - SavedRegs.set(Reg); + if (Reg < RISCV::X16 || !Subtarget.isRVE()) wangpc-pp wrote: Though it's nearly impossible to have s

[clang] [DRAFT][RISCV] Emit arch string macro to facilitate ASM programming (PR #85063)

2024-03-13 Thread Wang Pengcheng via cfe-commits
wangpc-pp wrote: I think we will add attributes automatically? ```shell ~/workspace# cat a.S .globl foo .p2align1 .type foo,@function foo: ret ~/workspace# clang -march=rv64gcv -c a.S ~/workspace# llvm-readobj -A a.o File: a.o Format: elf64-littleriscv Arch:

[clang] [llvm] [RISCV] Support RISC-V Profiles in -march option (PR #76357)

2024-03-14 Thread Wang Pengcheng via cfe-commits
https://github.com/wangpc-pp updated https://github.com/llvm/llvm-project/pull/76357 >From 8dc42f5c90ba369a145868f8c1a9a8cb3e988cb0 Mon Sep 17 00:00:00 2001 From: wangpc Date: Mon, 25 Dec 2023 18:52:36 +0800 Subject: [PATCH 1/2] [RISCV] Support RISC-V Profiles in -march option This PR implemen

[clang] [llvm] [RISCV] Support RISC-V Profiles in -march option (PR #76357)

2024-03-14 Thread Wang Pengcheng via cfe-commits
@@ -854,6 +895,30 @@ RISCVISAInfo::parseArchString(StringRef Arch, bool EnableExperimentalExtension, "string must be lowercase"); } + bool IsProfile = Arch.starts_with("rvi") || Arch.starts_with("rva") || + Arch.starts_with("r

[clang] [llvm] [RISCV] Support RISC-V Profiles in -march option (PR #76357)

2024-03-14 Thread Wang Pengcheng via cfe-commits
https://github.com/wangpc-pp updated https://github.com/llvm/llvm-project/pull/76357 >From 8dc42f5c90ba369a145868f8c1a9a8cb3e988cb0 Mon Sep 17 00:00:00 2001 From: wangpc Date: Mon, 25 Dec 2023 18:52:36 +0800 Subject: [PATCH 1/3] [RISCV] Support RISC-V Profiles in -march option This PR implemen

[clang] [llvm] [RISC-V] Add CSR read/write builtins (PR #85091)

2024-03-14 Thread Wang Pengcheng via cfe-commits
wangpc-pp wrote: I support adding these builtins personally, but I think we need more discussions on the design. We can achieve the same thing via inline assemblies, that's true. But, from the compiler side, inline assemblies are kind of barriers, we can't do a lot of optimizations/reorderings

[clang] [llvm] [RISC-V] Add CSR read/write builtins (PR #85091)

2024-03-14 Thread Wang Pengcheng via cfe-commits
wangpc-pp wrote: > > > I support adding these builtins personally, but I think we need more > > > discussions on the design. We can achieve the same thing via inline > > > assemblies, that's true. But, from the compiler side, inline assemblies > > > are kind of barriers, we can't do a lot of o

[clang] [llvm] [RISCV] Add generic CPUs for profiles (PR #84877)

2024-03-14 Thread Wang Pengcheng via cfe-commits
wangpc-pp wrote: > We discussed this on the sync-up call and @preames very rightly pointed out > that we should take a step back here...from a user perspective, what does > specifying a profile via `-mcpu` provide that specifying it via `-march` > doesn't? We weren't able to answer that in the

[clang] [llvm] [RISCV] Support RISC-V Profiles in -march option (PR #76357)

2024-03-14 Thread Wang Pengcheng via cfe-commits
@@ -854,6 +854,81 @@ RISCVISAInfo::parseArchString(StringRef Arch, bool EnableExperimentalExtension, "string must be lowercase"); } + bool IsProfile = Arch.starts_with("rvi") || Arch.starts_with("rva") || + Arch.starts_with("r

[clang] [llvm] [RISC-V] Add CSR read/write builtins (PR #85091)

2024-03-14 Thread Wang Pengcheng via cfe-commits
wangpc-pp wrote: GCC gained its `__arm_rsr` and `__arm_wsr` support last year (October, 2023): https://gcc.gnu.org/pipermail/gcc-patches/2023-October/631855.html. So there is no stable released GCC version that supports these builtins. Clang supported these builtins about nine years ago: https

[clang] [Driver] Don't alias -mstrict-align to -mno-unaligned-access (PR #85350)

2024-03-14 Thread Wang Pengcheng via cfe-commits
https://github.com/wangpc-pp approved this pull request. LGTM. cc @asb @topperc Some context of RISCV target: https://github.com/riscv-non-isa/riscv-c-api-doc/pull/62 https://github.com/llvm/llvm-project/pull/85350 ___ cfe-commits mailing list cfe-co

[clang] [llvm] [RISC-V] Add CSR read/write builtins (PR #85091)

2024-03-14 Thread Wang Pengcheng via cfe-commits
wangpc-pp wrote: > Should we use strings like ARM does so we can get register by name? Good point! We may provide two kinds of builtins: one by name, and another by CSR number. We should continue @lenary's proposal and discuss it in https://github.com/riscv-non-isa/riscv-toolchain-conventions

[clang] [llvm] [RISCV] Support RISC-V Profiles in -march option (PR #76357)

2024-03-17 Thread Wang Pengcheng via cfe-commits
https://github.com/wangpc-pp updated https://github.com/llvm/llvm-project/pull/76357 >From 28000eb88b54b02993107d4f222acc5d733c623f Mon Sep 17 00:00:00 2001 From: wangpc Date: Mon, 25 Dec 2023 18:52:36 +0800 Subject: [PATCH] [RISCV] Support RISC-V Profiles in -march option This PR implements t

[clang] [llvm] [RISCV] Support RISC-V Profiles in -march option (PR #76357)

2024-03-17 Thread Wang Pengcheng via cfe-commits
@@ -854,6 +854,81 @@ RISCVISAInfo::parseArchString(StringRef Arch, bool EnableExperimentalExtension, "string must be lowercase"); } + bool IsProfile = Arch.starts_with("rvi") || Arch.starts_with("rva") || + Arch.starts_with("r

[clang] [llvm] [RISCV] Support RISC-V Profiles in -march option (PR #76357)

2024-03-17 Thread Wang Pengcheng via cfe-commits
@@ -854,6 +854,81 @@ RISCVISAInfo::parseArchString(StringRef Arch, bool EnableExperimentalExtension, "string must be lowercase"); } + bool IsProfile = Arch.starts_with("rvi") || Arch.starts_with("rva") || + Arch.starts_with("r

[clang] [clang-tools-extra] [libcxx] [clang] Enable sized deallocation by default in C++14 onwards (PR #83774)

2024-03-18 Thread Wang Pengcheng via cfe-commits
wangpc-pp wrote: There is a Windows failure that I can't reproduce: https://buildkite.com/llvm-project/github-pull-requests/builds/46331 Can someone help me to figure out what is wrong? https://github.com/llvm/llvm-project/pull/83774 ___ cfe-commits m

[clang] [llvm] [RISCV] Support RISC-V Profiles in -march option (PR #76357)

2024-03-18 Thread Wang Pengcheng via cfe-commits
https://github.com/wangpc-pp updated https://github.com/llvm/llvm-project/pull/76357 >From 28000eb88b54b02993107d4f222acc5d733c623f Mon Sep 17 00:00:00 2001 From: wangpc Date: Mon, 25 Dec 2023 18:52:36 +0800 Subject: [PATCH 1/2] [RISCV] Support RISC-V Profiles in -march option This PR implemen

[clang] [llvm] [RISCV] Support RISC-V Profiles in -march option (PR #76357)

2024-03-18 Thread Wang Pengcheng via cfe-commits
https://github.com/wangpc-pp updated https://github.com/llvm/llvm-project/pull/76357 >From 28000eb88b54b02993107d4f222acc5d733c623f Mon Sep 17 00:00:00 2001 From: wangpc Date: Mon, 25 Dec 2023 18:52:36 +0800 Subject: [PATCH 1/3] [RISCV] Support RISC-V Profiles in -march option This PR implemen

[clang] [clang-tools-extra] [libcxx] [clang] Enable sized deallocation by default in C++14 onwards (PR #83774)

2024-03-19 Thread Wang Pengcheng via cfe-commits
https://github.com/wangpc-pp updated https://github.com/llvm/llvm-project/pull/83774 >From 26245679b0f40b510e628aaed091739e9931c29c Mon Sep 17 00:00:00 2001 From: wangpc Date: Fri, 14 Jul 2023 10:38:14 +0800 Subject: [PATCH 1/5] [clang] Enable sized deallocation by default in C++14 onwards Si

[clang] [clang-format] Add Options to break inside the TableGen DAGArg. (PR #83149)

2024-03-19 Thread Wang Pengcheng via cfe-commits
wangpc-pp wrote: This breaks CI `Test documentation build` like: https://github.com/llvm/llvm-project/actions/runs/8339765845/job/22822367034 https://github.com/llvm/llvm-project/pull/83149 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https

[clang] [clang-tools-extra] [libcxx] [clang] Enable sized deallocation by default in C++14 onwards (PR #83774)

2024-03-19 Thread Wang Pengcheng via cfe-commits
wangpc-pp wrote: > > > There is a Windows failure that I can't reproduce: > > > https://buildkite.com/llvm-project/github-pull-requests/builds/46331 Can > > > someone help me to figure out what is wrong? > > > > > > I'm not certain what's going on yet, but it smells a bit like the > > interp

[clang] [clang-tools-extra] [libcxx] [clang] Enable sized deallocation by default in C++14 onwards (PR #83774)

2024-03-19 Thread Wang Pengcheng via cfe-commits
wangpc-pp wrote: > > Not entirely certain what you're asking, but MSVC CRT does have a > > definition for sized delete: > > ``` > > _CRT_SECURITYCRITICAL_ATTRIBUTE > > void __CRTDECL operator delete(void* const block, size_t const) noexcept > > { > > operator delete(block); > > } > > ``` > >

[clang] [llvm] [RISCV] Support RISC-V Profiles in -march option (PR #76357)

2024-03-22 Thread Wang Pengcheng via cfe-commits
https://github.com/wangpc-pp closed https://github.com/llvm/llvm-project/pull/76357 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 6e755c5 - Revert "[RISCV] Support RISC-V Profiles in -march option (#76357)"

2024-03-22 Thread Wang Pengcheng via cfe-commits
Author: Wang Pengcheng Date: 2024-03-22T18:49:25+08:00 New Revision: 6e755c51a916dc521ffe89738bcab47a5442ad06 URL: https://github.com/llvm/llvm-project/commit/6e755c51a916dc521ffe89738bcab47a5442ad06 DIFF: https://github.com/llvm/llvm-project/commit/6e755c51a916dc521ffe89738bcab47a5442ad06.diff

[clang] b44771f - [RISCV] Support RISC-V Profiles in -march option (#76357)

2024-03-22 Thread Wang Pengcheng via cfe-commits
Author: Wang Pengcheng Date: 2024-03-22T23:21:11+08:00 New Revision: b44771f480385fa93ba7719a57e759e19747e709 URL: https://github.com/llvm/llvm-project/commit/b44771f480385fa93ba7719a57e759e19747e709 DIFF: https://github.com/llvm/llvm-project/commit/b44771f480385fa93ba7719a57e759e19747e709.diff

[clang] [clang-tools-extra] [libcxx] [clang] Enable sized deallocation by default in C++14 onwards (PR #83774)

2024-03-22 Thread Wang Pengcheng via cfe-commits
https://github.com/wangpc-pp updated https://github.com/llvm/llvm-project/pull/83774 >From f1653805def59bc6eb23052b3ade80c900b4daaa Mon Sep 17 00:00:00 2001 From: wangpc Date: Fri, 14 Jul 2023 10:38:14 +0800 Subject: [PATCH 1/2] [clang] Enable sized deallocation by default in C++14 onwards Si

[clang] [clang-tools-extra] [libcxx] [clang] Enable sized deallocation by default in C++14 onwards (PR #83774)

2024-03-23 Thread Wang Pengcheng via cfe-commits
https://github.com/wangpc-pp updated https://github.com/llvm/llvm-project/pull/83774 >From f1653805def59bc6eb23052b3ade80c900b4daaa Mon Sep 17 00:00:00 2001 From: wangpc Date: Fri, 14 Jul 2023 10:38:14 +0800 Subject: [PATCH 1/3] [clang] Enable sized deallocation by default in C++14 onwards Si

[clang] [clang-tools-extra] [libcxx] [clang] Enable sized deallocation by default in C++14 onwards (PR #83774)

2024-03-24 Thread Wang Pengcheng via cfe-commits
https://github.com/wangpc-pp updated https://github.com/llvm/llvm-project/pull/83774 >From f1653805def59bc6eb23052b3ade80c900b4daaa Mon Sep 17 00:00:00 2001 From: wangpc Date: Fri, 14 Jul 2023 10:38:14 +0800 Subject: [PATCH 1/4] [clang] Enable sized deallocation by default in C++14 onwards Si

[clang] [clang-tools-extra] [libcxx] [clang] Enable sized deallocation by default in C++14 onwards (PR #83774)

2024-03-24 Thread Wang Pengcheng via cfe-commits
https://github.com/wangpc-pp updated https://github.com/llvm/llvm-project/pull/83774 >From f1653805def59bc6eb23052b3ade80c900b4daaa Mon Sep 17 00:00:00 2001 From: wangpc Date: Fri, 14 Jul 2023 10:38:14 +0800 Subject: [PATCH 1/5] [clang] Enable sized deallocation by default in C++14 onwards Si

[clang] [llvm] [RISCV] Add generic CPUs for profiles (PR #84877)

2024-03-24 Thread Wang Pengcheng via cfe-commits
https://github.com/wangpc-pp edited https://github.com/llvm/llvm-project/pull/84877 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [RISCV] Add generic CPUs for profiles (PR #84877)

2024-03-24 Thread Wang Pengcheng via cfe-commits
https://github.com/wangpc-pp updated https://github.com/llvm/llvm-project/pull/84877 >From ec68548a470d6d9032a900a725e95b92691657b2 Mon Sep 17 00:00:00 2001 From: Wang Pengcheng Date: Tue, 12 Mar 2024 14:28:09 +0800 Subject: [PATCH 1/2] =?UTF-8?q?[=F0=9D=98=80=F0=9D=97=BD=F0=9D=97=BF]=20in?= =

[clang] [llvm] [RISCV][NFC] Pass LMUL to copyPhysRegVector (PR #84448)

2024-03-24 Thread Wang Pengcheng via cfe-commits
https://github.com/wangpc-pp edited https://github.com/llvm/llvm-project/pull/84448 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [RISCV][NFC] Pass LMUL to copyPhysRegVector (PR #84448)

2024-03-24 Thread Wang Pengcheng via cfe-commits
https://github.com/wangpc-pp closed https://github.com/llvm/llvm-project/pull/84448 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [libcxx] [clang] Enable sized deallocation by default in C++14 onwards (PR #83774)

2024-03-25 Thread Wang Pengcheng via cfe-commits
@@ -49,3 +49,62 @@ if ((MINGW OR CYGWIN) AND BUILD_SHARED_LIBS) # despite potential dllexports. target_link_options(clangInterpreter PRIVATE LINKER:--export-all-symbols) endif() + +if(MSVC) + set_target_properties(clangInterpreter PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS 1)

[clang] [clang-tools-extra] [libcxx] [clang] Enable sized deallocation by default in C++14 onwards (PR #83774)

2024-03-25 Thread Wang Pengcheng via cfe-commits
wangpc-pp wrote: Windows CI is passed now, many thanks to @AaronBallman @vgvassilev! I may land this in a few days if there is no more comment. :-) https://github.com/llvm/llvm-project/pull/83774 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [clang-tools-extra] [libcxx] [clang] Enable sized deallocation by default in C++14 onwards (PR #83774)

2024-03-25 Thread Wang Pengcheng via cfe-commits
@@ -49,3 +49,62 @@ if ((MINGW OR CYGWIN) AND BUILD_SHARED_LIBS) # despite potential dllexports. target_link_options(clangInterpreter PRIVATE LINKER:--export-all-symbols) endif() + +if(MSVC) + set_target_properties(clangInterpreter PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS 1)

[clang] [clang-tools-extra] [libcxx] [clang] Enable sized deallocation by default in C++14 onwards (PR #83774)

2024-03-26 Thread Wang Pengcheng via cfe-commits
@@ -49,3 +49,62 @@ if ((MINGW OR CYGWIN) AND BUILD_SHARED_LIBS) # despite potential dllexports. target_link_options(clangInterpreter PRIVATE LINKER:--export-all-symbols) endif() + +if(MSVC) + set_target_properties(clangInterpreter PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS 1)

[clang] [clang-tools-extra] [libcxx] [clang] Enable sized deallocation by default in C++14 onwards (PR #83774)

2024-03-29 Thread Wang Pengcheng via cfe-commits
@@ -49,3 +49,62 @@ if ((MINGW OR CYGWIN) AND BUILD_SHARED_LIBS) # despite potential dllexports. target_link_options(clangInterpreter PRIVATE LINKER:--export-all-symbols) endif() + +if(MSVC) + set_target_properties(clangInterpreter PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS 1)

[clang] [Clang][RISCV] Add assumptions to vsetvli/vsetvlimax (PR #79975)

2024-02-06 Thread Wang Pengcheng via cfe-commits
wangpc-pp wrote: Ping for comments. https://github.com/llvm/llvm-project/pull/79975 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][TableGen] Add Features to TargetBuiltin (PR #80279)

2024-02-06 Thread Wang Pengcheng via cfe-commits
wangpc-pp wrote: Ping. https://github.com/llvm/llvm-project/pull/80279 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][TableGen] Add Features to TargetBuiltin (PR #80279)

2024-02-07 Thread Wang Pengcheng via cfe-commits
wangpc-pp wrote: > The changes seem reasonable to me but I'd feel more comfortable if the > functionality was also being used (so that we'd get test coverage verifying > its correctness). Do you think it would be reasonable to include the RISCV > changes as well? Yeah, I separated RISCV chang

[clang] [Clang][TableGen] Add Features to TargetBuiltin (PR #80279)

2024-02-09 Thread Wang Pengcheng via cfe-commits
https://github.com/wangpc-pp closed https://github.com/llvm/llvm-project/pull/80279 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [RISCV][Clang] Added builtin support for experimental Zimop extension (PR #79971)

2024-03-06 Thread Wang Pengcheng via cfe-commits
https://github.com/wangpc-pp commented: The code is OK I think. One question: how will these builtins be used? Are their semantics bound to specific extensions that extend MOPs? https://github.com/llvm/llvm-project/pull/79971 ___ cfe-commits mailing l

[clang] [llvm] [RISCV] Support RISC-V Profiles in -march option (PR #76357)

2024-03-07 Thread Wang Pengcheng via cfe-commits
wangpc-pp wrote: Ping. https://github.com/llvm/llvm-project/pull/76357 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

  1   2   >