[clang] [llvm] [NFC][clang][FMV][TargetInfo] Refactor API for FMV feature priority. (PR #116257)

2024-11-27 Thread Piyou Chen via cfe-commits
https://github.com/BeMg approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/116257 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][RISCV] Support `norelax` attribute for RISCV (PR #115981)

2024-11-27 Thread Piyou Chen via cfe-commits
https://github.com/BeMg closed https://github.com/llvm/llvm-project/pull/115981 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][RISCV] Support `norelax` attribute for RISCV (PR #115981)

2024-11-27 Thread Piyou Chen via cfe-commits
BeMg wrote: Seem we don't support this attribute. https://github.com/llvm/llvm-project/pull/115981 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [NFC][clang][FMV][TargetInfo] Refactor API for FMV feature priority. (PR #116257)

2024-11-26 Thread Piyou Chen via cfe-commits
@@ -2938,36 +2914,17 @@ void CodeGenFunction::EmitRISCVMultiVersionResolver( bool HasDefault = false; unsigned DefaultIndex = 0; - SmallVector CurrOptions( - Options); - - llvm::stable_sort( - CurrOptions, [](const CodeGenFunction::MultiVersionResolverOption &L

[clang] Recommit "[TargetVersion] Only enable on RISC-V and AArch64" (#117110)" (PR #117128)

2024-11-25 Thread Piyou Chen via cfe-commits
https://github.com/BeMg closed https://github.com/llvm/llvm-project/pull/117128 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Recommit "[TargetVersion] Only enable on RISC-V and AArch64" (#117110)" (PR #117128)

2024-11-21 Thread Piyou Chen via cfe-commits
https://github.com/BeMg created https://github.com/llvm/llvm-project/pull/117128 Remain InheritableAttr to avoid the warning `TypePrinter.cpp:1953:10: warning: enumeration value ‘TargetVersion’ not handled in switch` origin messenge [TargetVersion] Only enable on RISC-V and AArch64 (#115991) A

[clang] Revert "[TargetVersion] Only enable on RISC-V and AArch64" (PR #117110)

2024-11-20 Thread Piyou Chen via cfe-commits
https://github.com/BeMg closed https://github.com/llvm/llvm-project/pull/117110 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Revert "[TargetVersion] Only enable on RISC-V and AArch64" (PR #117110)

2024-11-20 Thread Piyou Chen via cfe-commits
https://github.com/BeMg created https://github.com/llvm/llvm-project/pull/117110 Reverts llvm/llvm-project#115991 Due to build fail https://lab.llvm.org/buildbot/#/builders/66/builds/6511 >From e7efa82cb1362e8a2eae63fa66954327de50b88a Mon Sep 17 00:00:00 2001 From: Piyou Chen Date: Thu, 21 Nov

[clang] [TargetVersion] Only enable on RISC-V and AArch64 (PR #115991)

2024-11-20 Thread Piyou Chen via cfe-commits
https://github.com/BeMg closed https://github.com/llvm/llvm-project/pull/115991 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [TargetVersion] Only enable on RISC-V and AArch64 (PR #115991)

2024-11-19 Thread Piyou Chen via cfe-commits
https://github.com/BeMg updated https://github.com/llvm/llvm-project/pull/115991 >From 28f7a2adc055ec6f30790e1e9535c71241a08e29 Mon Sep 17 00:00:00 2001 From: Piyou Chen Date: Tue, 12 Nov 2024 20:56:47 -0800 Subject: [PATCH 1/7] [TargetVersion] Only enable on RISC-V and AArch64 --- clang/inclu

[clang] [TargetVersion] Only enable on RISC-V and AArch64 (PR #115991)

2024-11-18 Thread Piyou Chen via cfe-commits
BeMg wrote: Fix the merge conflict https://github.com/llvm/llvm-project/pull/115991 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [NFC][clang][FMV][TargetInfo] Refactor API for FMV feature priority. (PR #116257)

2024-11-17 Thread Piyou Chen via cfe-commits
@@ -4216,22 +4216,11 @@ static void ReplaceUsesOfNonProtoTypeWithRealFunction(llvm::GlobalValue *Old, llvm::Function *NewFn); static unsigned -TargetMVPriority(const TargetInfo &TI, - const CodeGenFunction:

[clang] [TargetVersion] Only enable on RISC-V and AArch64 (PR #115991)

2024-11-17 Thread Piyou Chen via cfe-commits
https://github.com/BeMg updated https://github.com/llvm/llvm-project/pull/115991 >From 28f7a2adc055ec6f30790e1e9535c71241a08e29 Mon Sep 17 00:00:00 2001 From: Piyou Chen Date: Tue, 12 Nov 2024 20:56:47 -0800 Subject: [PATCH 1/7] [TargetVersion] Only enable on RISC-V and AArch64 --- clang/inclu

[clang] [TargetVersion] Only enable on RISC-V and AArch64 (PR #115991)

2024-11-17 Thread Piyou Chen via cfe-commits
https://github.com/BeMg updated https://github.com/llvm/llvm-project/pull/115991 >From 28f7a2adc055ec6f30790e1e9535c71241a08e29 Mon Sep 17 00:00:00 2001 From: Piyou Chen Date: Tue, 12 Nov 2024 20:56:47 -0800 Subject: [PATCH 1/6] [TargetVersion] Only enable on RISC-V and AArch64 --- clang/inclu

[clang] [TargetVersion] Only enable on RISC-V and AArch64 (PR #115991)

2024-11-15 Thread Piyou Chen via cfe-commits
https://github.com/BeMg updated https://github.com/llvm/llvm-project/pull/115991 >From 28f7a2adc055ec6f30790e1e9535c71241a08e29 Mon Sep 17 00:00:00 2001 From: Piyou Chen Date: Tue, 12 Nov 2024 20:56:47 -0800 Subject: [PATCH 1/5] [TargetVersion] Only enable on RISC-V and AArch64 --- clang/inclu

[clang] [TargetVersion] Only enable on RISC-V and AArch64 (PR #115991)

2024-11-14 Thread Piyou Chen via cfe-commits
@@ -3040,6 +3040,7 @@ bool Sema::checkTargetVersionAttr(SourceLocation LiteralLoc, Decl *D, enum FirstParam { Unsupported }; enum SecondParam { None }; enum ThirdParam { Target, TargetClones, TargetVersion }; + BeMg wrote: Nice catch. Dropped. https://

[clang] [llvm] [NFC][clang][FMV][TargetInfo] Refactor API for FMV feature priority. (PR #116257)

2024-11-14 Thread Piyou Chen via cfe-commits
@@ -4216,22 +4216,11 @@ static void ReplaceUsesOfNonProtoTypeWithRealFunction(llvm::GlobalValue *Old, llvm::Function *NewFn); static unsigned -TargetMVPriority(const TargetInfo &TI, - const CodeGenFunction:

[clang] [TargetVersion] Only enable on RISC-V and AArch64 (PR #115991)

2024-11-14 Thread Piyou Chen via cfe-commits
https://github.com/BeMg updated https://github.com/llvm/llvm-project/pull/115991 >From 28f7a2adc055ec6f30790e1e9535c71241a08e29 Mon Sep 17 00:00:00 2001 From: Piyou Chen Date: Tue, 12 Nov 2024 20:56:47 -0800 Subject: [PATCH 1/4] [TargetVersion] Only enable on RISC-V and AArch64 --- clang/inclu

[clang] [TargetVersion] Only enable on RISC-V and AArch64 (PR #115991)

2024-11-14 Thread Piyou Chen via cfe-commits
@@ -3040,6 +3040,11 @@ bool Sema::checkTargetVersionAttr(SourceLocation LiteralLoc, Decl *D, enum FirstParam { Unsupported }; enum SecondParam { None }; enum ThirdParam { Target, TargetClones, TargetVersion }; + + if (!Context.getTargetInfo().getTriple().isRISCV() && +

[clang] [TargetVersion] Only enable on RISC-V and AArch64 (PR #115991)

2024-11-13 Thread Piyou Chen via cfe-commits
https://github.com/BeMg updated https://github.com/llvm/llvm-project/pull/115991 >From 28f7a2adc055ec6f30790e1e9535c71241a08e29 Mon Sep 17 00:00:00 2001 From: Piyou Chen Date: Tue, 12 Nov 2024 20:56:47 -0800 Subject: [PATCH 1/3] [TargetVersion] Only enable on RISC-V and AArch64 --- clang/inclu

[clang] [TargetVersion] Only enable on RISC-V and AArch64 (PR #115991)

2024-11-13 Thread Piyou Chen via cfe-commits
BeMg wrote: Update: 1. Add the testcase 2. in this target -> on this target https://github.com/llvm/llvm-project/pull/115991 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [TargetVersion] Only enable on RISC-V and AArch64 (PR #115991)

2024-11-12 Thread Piyou Chen via cfe-commits
https://github.com/BeMg created https://github.com/llvm/llvm-project/pull/115991 Address https://github.com/llvm/llvm-project/issues/115000. This patch constrains the target_version feature to work only on RISC-V and AArch64 to prevent crashes in Clang. >From 28f7a2adc055ec6f30790e1e9535c7124

[clang] [clang][RISCV] Support `norelax` attribute for RISCV (PR #115981)

2024-11-12 Thread Piyou Chen via cfe-commits
https://github.com/BeMg created https://github.com/llvm/llvm-project/pull/115981 Base on https://github.com/riscv-non-isa/riscv-c-api-doc/pull/94. This patch support the `norelax` attribute for RISC-V target in clang. >From 9dc14ca1e5d026c05390c728c9512994e05d8be7 Mon Sep 17 00:00:00 2001 From:

[clang] [RISCV][FMV] Remove support for negative priority (PR #112161)

2024-10-21 Thread Piyou Chen via cfe-commits
https://github.com/BeMg closed https://github.com/llvm/llvm-project/pull/112161 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [RISCV] Check if v extension is enabled by the function features for the builtins not in Zve64*. (PR #112827)

2024-10-17 Thread Piyou Chen via cfe-commits
https://github.com/BeMg approved this pull request. LGTM. Thanks for fix this issue! https://github.com/llvm/llvm-project/pull/112827 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [RISCV][FMV] Remove support for negative priority (PR #112161)

2024-10-17 Thread Piyou Chen via cfe-commits
https://github.com/BeMg updated https://github.com/llvm/llvm-project/pull/112161 >From d7a00a878b472e1ba7abad1b915cb57c4b0a5ca3 Mon Sep 17 00:00:00 2001 From: Piyou Chen Date: Sun, 6 Oct 2024 22:19:07 -0700 Subject: [PATCH 1/5] [RISCV][FMV] Remove support for negative priority --- clang/lib/Co

[clang] [RISCV][FMV] Remove support for negative priority (PR #112161)

2024-10-17 Thread Piyou Chen via cfe-commits
https://github.com/BeMg updated https://github.com/llvm/llvm-project/pull/112161 >From d7a00a878b472e1ba7abad1b915cb57c4b0a5ca3 Mon Sep 17 00:00:00 2001 From: Piyou Chen Date: Sun, 6 Oct 2024 22:19:07 -0700 Subject: [PATCH 1/4] [RISCV][FMV] Remove support for negative priority --- clang/lib/Co

[clang] [RISCV][FMV] Remove support for negative priority (PR #112161)

2024-10-17 Thread Piyou Chen via cfe-commits
@@ -2909,18 +2909,16 @@ static int getPriorityFromAttrString(StringRef AttrStr) { AttrStr.split(Attrs, ';'); BeMg wrote: Sure. https://github.com/llvm/llvm-project/pull/112161 ___ cfe-commits mailing list cfe-commi

[clang] [RISCV][FMV] Remove support for negative priority (PR #112161)

2024-10-15 Thread Piyou Chen via cfe-commits
https://github.com/BeMg updated https://github.com/llvm/llvm-project/pull/112161 >From d7a00a878b472e1ba7abad1b915cb57c4b0a5ca3 Mon Sep 17 00:00:00 2001 From: Piyou Chen Date: Sun, 6 Oct 2024 22:19:07 -0700 Subject: [PATCH 1/2] [RISCV][FMV] Remove support for negative priority --- clang/lib/Co

[clang] [RISCV][FMV] Remove support for negative priority (PR #112161)

2024-10-13 Thread Piyou Chen via cfe-commits
https://github.com/BeMg edited https://github.com/llvm/llvm-project/pull/112161 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [RISCV][FMV] Remove support for negative priority (PR #112161)

2024-10-13 Thread Piyou Chen via cfe-commits
@@ -111,3 +111,9 @@ __attribute__((target_version("default"))) int invalidVerson4(void) { return 2; __attribute__((target_version("priority=1"))) int prioriyWithoutArch(void) { return 2; } // expected-error@+1 {{redefinition of 'prioriyWithoutArch'}} __attribute__((target_ver

[clang] [RISCV][FMV] Remove support for negative priority (PR #112161)

2024-10-13 Thread Piyou Chen via cfe-commits
https://github.com/BeMg created https://github.com/llvm/llvm-project/pull/112161 Ensure that target_version and target_clones do not accept negative numbers for the priority feature. Base on discussion on https://github.com/riscv-non-isa/riscv-c-api-doc/pull/85. >From d7a00a878b472e1ba7abad1b

[clang] Recommit "[RISCV][FMV] Support target_version" (#111096)" (PR #111333)

2024-10-08 Thread Piyou Chen via cfe-commits
https://github.com/BeMg closed https://github.com/llvm/llvm-project/pull/111333 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Recommit "[RISCV][FMV] Support target_version" (#111096)" (PR #111333)

2024-10-06 Thread Piyou Chen via cfe-commits
https://github.com/BeMg created https://github.com/llvm/llvm-project/pull/111333 Fix the buildbot failure caused by heap use-after-free error. Origin message: This patch enable `target_version` attribute for RISC-V target. The proposal of `target_version` syntax can be found at the

[clang] Revert "[RISCV][FMV] Support target_version" (PR #111096)

2024-10-03 Thread Piyou Chen via cfe-commits
https://github.com/BeMg closed https://github.com/llvm/llvm-project/pull/111096 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Revert "[RISCV][FMV] Support target_version" (PR #111096)

2024-10-03 Thread Piyou Chen via cfe-commits
https://github.com/BeMg created https://github.com/llvm/llvm-project/pull/111096 Reverts llvm/llvm-project#99040 to fix https://lab.llvm.org/buildbot/#/builders/190/builds/7052 >From 32174720649068de7c4ef97a484d777dba72e65c Mon Sep 17 00:00:00 2001 From: Piyou Chen Date: Fri, 4 Oct 2024 11:55:

[clang] [RISCV][FMV] Support target_version (PR #99040)

2024-10-03 Thread Piyou Chen via cfe-commits
https://github.com/BeMg closed https://github.com/llvm/llvm-project/pull/99040 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [FMV][RISCV] Add __riscv_feature_bits.length check (PR #110098)

2024-09-26 Thread Piyou Chen via cfe-commits
BeMg wrote: There is misunderstand here. Close it now and reopen when it ready. https://github.com/llvm/llvm-project/pull/110098 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [FMV][RISCV] Add __riscv_feature_bits.length check (PR #110098)

2024-09-26 Thread Piyou Chen via cfe-commits
https://github.com/BeMg closed https://github.com/llvm/llvm-project/pull/110098 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [FMV][RISCV] Add __riscv_feature_bits.length check (PR #110098)

2024-09-26 Thread Piyou Chen via cfe-commits
https://github.com/BeMg updated https://github.com/llvm/llvm-project/pull/110098 >From 838c6669d2f4464b9b528b0d633ad363b92e3b57 Mon Sep 17 00:00:00 2001 From: Piyou Chen Date: Thu, 26 Sep 2024 02:16:56 -0700 Subject: [PATCH 1/2] [FMV][RISCV] Check FeatureBits.length before test all version ---

[clang] [FMV][RISCV] Add __riscv_feature_bits.length check (PR #110098)

2024-09-26 Thread Piyou Chen via cfe-commits
https://github.com/BeMg created https://github.com/llvm/llvm-project/pull/110098 This patch add a condition that check the `__riscv_feature_bits.length` before access `__riscv_feature_bits.features`. It updates the resolver function as the following structure. ``` if (__riscv_feature_bits.fe

[clang] [RISCV][FMV] Support target_version (PR #99040)

2024-09-25 Thread Piyou Chen via cfe-commits
@@ -3056,6 +3056,47 @@ bool Sema::checkTargetVersionAttr(SourceLocation LiteralLoc, Decl *D, enum SecondParam { None }; enum ThirdParam { Target, TargetClones, TargetVersion }; llvm::SmallVector Features; + if (Context.getTargetInfo().getTriple().isRISCV()) { +

[clang] [RISCV][FMV] Support target_version (PR #99040)

2024-09-23 Thread Piyou Chen via cfe-commits
@@ -3056,6 +3056,45 @@ bool Sema::checkTargetVersionAttr(SourceLocation LiteralLoc, Decl *D, enum SecondParam { None }; enum ThirdParam { Target, TargetClones, TargetVersion }; llvm::SmallVector Features; + if (Context.getTargetInfo().getTriple().isRISCV()) { + +llv

[clang] [RISCV][FMV] Support target_version (PR #99040)

2024-09-23 Thread Piyou Chen via cfe-commits
https://github.com/BeMg edited https://github.com/llvm/llvm-project/pull/99040 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [RISCV][FMV] Support target_version (PR #99040)

2024-09-22 Thread Piyou Chen via cfe-commits
@@ -3056,6 +3056,45 @@ bool Sema::checkTargetVersionAttr(SourceLocation LiteralLoc, Decl *D, enum SecondParam { None }; enum ThirdParam { Target, TargetClones, TargetVersion }; llvm::SmallVector Features; + if (Context.getTargetInfo().getTriple().isRISCV()) { + +llv

[clang] [RISCV][FMV] Support target_version (PR #99040)

2024-09-22 Thread Piyou Chen via cfe-commits
@@ -3056,6 +3056,45 @@ bool Sema::checkTargetVersionAttr(SourceLocation LiteralLoc, Decl *D, enum SecondParam { None }; enum ThirdParam { Target, TargetClones, TargetVersion }; llvm::SmallVector Features; + if (Context.getTargetInfo().getTriple().isRISCV()) { + +llv

[clang] [RISCV][FMV] Support target_version (PR #99040)

2024-09-22 Thread Piyou Chen via cfe-commits
@@ -15501,8 +15511,10 @@ Decl *Sema::ActOnStartOfFunctionDef(Scope *FnBodyScope, Decl *D, FD->setInvalidDecl(); } if (const auto *Attr = FD->getAttr()) { -if (!Context.getTargetInfo().hasFeature("fmv") && -!Attr->isDefaultVersion()) { +if (Context.getTa

[clang] [RISCV][FMV] Support target_version (PR #99040)

2024-09-22 Thread Piyou Chen via cfe-commits
@@ -4268,8 +4268,12 @@ void CodeGenModule::emitMultiVersionFunctions() { } else if (const auto *TVA = CurFD->getAttr()) { if (TVA->isDefaultVersion() && IsDefined) ShouldEmitResolver = true; -TVA->getFeatures(Feats);

[clang] [RISCV][FMV] Support target_version (PR #99040)

2024-09-22 Thread Piyou Chen via cfe-commits
@@ -14270,9 +14270,16 @@ void ASTContext::getFunctionFeatureMap(llvm::StringMap &FeatureMap, Target->initFeatureMap(FeatureMap, getDiagnostics(), TargetCPU, Features); } } else if (const auto *TV = FD->getAttr()) { -llvm::SmallVector Feats; -TV->getFeature

[clang] [RISCV][FMV] Support target_version (PR #99040)

2024-09-22 Thread Piyou Chen via cfe-commits
https://github.com/BeMg updated https://github.com/llvm/llvm-project/pull/99040 >From 54b5d6833a52271dfd1ca3912d5d9e886b1970c2 Mon Sep 17 00:00:00 2001 From: Piyou Chen Date: Tue, 19 Mar 2024 02:02:35 -0700 Subject: [PATCH 1/9] [RISCV][FMV] Support target_version --- clang/lib/AST/ASTContext.c

[clang] [RISCV][FMV] Support target_version (PR #99040)

2024-09-17 Thread Piyou Chen via cfe-commits
@@ -11027,13 +11029,27 @@ static bool CheckMultiVersionValue(Sema &S, const FunctionDecl *FD) { } if (TVA) { -llvm::SmallVector Feats; -TVA->getFeatures(Feats); -for (const auto &Feat : Feats) { - if (!TargetInfo.validateCpuSupports(Feat)) { -S.Di

[clang] [RISCV][FMV] Support target_version (PR #99040)

2024-09-17 Thread Piyou Chen via cfe-commits
https://github.com/BeMg updated https://github.com/llvm/llvm-project/pull/99040 >From 54b5d6833a52271dfd1ca3912d5d9e886b1970c2 Mon Sep 17 00:00:00 2001 From: Piyou Chen Date: Tue, 19 Mar 2024 02:02:35 -0700 Subject: [PATCH 1/5] [RISCV][FMV] Support target_version --- clang/lib/AST/ASTContext.c

[clang] [RISCV][FMV] Support target_version (PR #99040)

2024-09-17 Thread Piyou Chen via cfe-commits
https://github.com/BeMg updated https://github.com/llvm/llvm-project/pull/99040 >From 54b5d6833a52271dfd1ca3912d5d9e886b1970c2 Mon Sep 17 00:00:00 2001 From: Piyou Chen Date: Tue, 19 Mar 2024 02:02:35 -0700 Subject: [PATCH 1/4] [RISCV][FMV] Support target_version --- clang/lib/AST/ASTContext.c

[clang] [RISCV][FMV] Support target_version (PR #99040)

2024-09-13 Thread Piyou Chen via cfe-commits
@@ -10319,8 +10319,10 @@ Sema::ActOnFunctionDeclarator(Scope *S, Declarator &D, DeclContext *DC, // Handle attributes. ProcessDeclAttributes(S, NewFD, D); const auto *NewTVA = NewFD->getAttr(); - if (NewTVA && !NewTVA->isDefaultVersion() && - !Context.getTargetInfo

[clang] [RISCV][FMV] Support target_version (PR #99040)

2024-09-13 Thread Piyou Chen via cfe-commits
https://github.com/BeMg updated https://github.com/llvm/llvm-project/pull/99040 >From 54b5d6833a52271dfd1ca3912d5d9e886b1970c2 Mon Sep 17 00:00:00 2001 From: Piyou Chen Date: Tue, 19 Mar 2024 02:02:35 -0700 Subject: [PATCH 1/3] [RISCV][FMV] Support target_version --- clang/lib/AST/ASTContext.c

[clang] [RISCV][FMV] Support target_version (PR #99040)

2024-09-13 Thread Piyou Chen via cfe-commits
https://github.com/BeMg updated https://github.com/llvm/llvm-project/pull/99040 >From 54b5d6833a52271dfd1ca3912d5d9e886b1970c2 Mon Sep 17 00:00:00 2001 From: Piyou Chen Date: Tue, 19 Mar 2024 02:02:35 -0700 Subject: [PATCH 1/2] [RISCV][FMV] Support target_version --- clang/lib/AST/ASTContext.c

[clang] [RISCV][FMV] Support target_version (PR #99040)

2024-09-13 Thread Piyou Chen via cfe-commits
BeMg wrote: Rebase to main https://github.com/llvm/llvm-project/pull/99040 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [RISCV][FMV] Support target_version (PR #99040)

2024-09-13 Thread Piyou Chen via cfe-commits
https://github.com/BeMg updated https://github.com/llvm/llvm-project/pull/99040 >From 54b5d6833a52271dfd1ca3912d5d9e886b1970c2 Mon Sep 17 00:00:00 2001 From: Piyou Chen Date: Tue, 19 Mar 2024 02:02:35 -0700 Subject: [PATCH] [RISCV][FMV] Support target_version --- clang/lib/AST/ASTContext.cpp

[clang] [RISCV][FMV] Support target_clones (PR #85786)

2024-09-13 Thread Piyou Chen via cfe-commits
https://github.com/BeMg closed https://github.com/llvm/llvm-project/pull/85786 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [RISCV][FMV] Support target_clones (PR #85786)

2024-09-12 Thread Piyou Chen via cfe-commits
https://github.com/BeMg updated https://github.com/llvm/llvm-project/pull/85786 >From 395ce72afbf9e4b12fcbfaf9cdbda8921c9ff72a Mon Sep 17 00:00:00 2001 From: Piyou Chen Date: Tue, 23 Jul 2024 19:59:06 -0700 Subject: [PATCH 01/18] [RISCV][FMV] Support target_clones --- .../clang/Basic/Diagnosti

[clang] [Clang][RISCV] Recognize unsupport target feature by supporting isValidFeatureName (PR #106495)

2024-09-09 Thread Piyou Chen via cfe-commits
https://github.com/BeMg closed https://github.com/llvm/llvm-project/pull/106495 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [RISCV][FMV] Support target_clones (PR #85786)

2024-09-06 Thread Piyou Chen via cfe-commits
BeMg wrote: Rename and update the description of err_os_unsupport_riscv_target_clones because not only target clones trigger FMV. https://github.com/llvm/llvm-project/pull/85786 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.ll

[clang] [RISCV][FMV] Support target_clones (PR #85786)

2024-09-06 Thread Piyou Chen via cfe-commits
BeMg wrote: > A test case will crash, missing `+` before `zbc`: > > ``` > __attribute__((target_clones("default", "arch=+zbb,zbc;priority=-1", > "priority=-2;arch=+zba", "priority=3;arch=+zbb,+zba"))) int foo1(void) { > return 2; } > > > int bar() { return foo1(); } > ``` > > ``` > $ clang

[clang] [Clang][RISCV] Recognize unsupport target feature by supporting isValidFeatureName (PR #106495)

2024-09-05 Thread Piyou Chen via cfe-commits
@@ -4,3 +4,12 @@ int __attribute__((target("arch=rv64g"))) foo(void) { return 0; } //expected-error@+1 {{redefinition of 'foo'}} int __attribute__((target("arch=rv64gc"))) foo(void) { return 0; } + +//expected-warning@+1 {{unsupported 'notafeature' in the 'target' attribute st

[clang] [Clang][RISCV] Recognize unsupport target feature by supporting isValidFeatureName (PR #106495)

2024-09-05 Thread Piyou Chen via cfe-commits
@@ -4,3 +4,12 @@ int __attribute__((target("arch=rv64g"))) foo(void) { return 0; } //expected-error@+1 {{redefinition of 'foo'}} int __attribute__((target("arch=rv64gc"))) foo(void) { return 0; } + +//expected-warning@+1 {{unsupported 'notafeature' in the 'target' attribute st

[clang] [Clang][RISCV] Recognize unsupport target feature by supporting isValidFeatureName (PR #106495)

2024-09-05 Thread Piyou Chen via cfe-commits
@@ -2993,10 +2993,17 @@ bool Sema::checkTargetAttr(SourceLocation LiteralLoc, StringRef AttrStr) { return Diag(LiteralLoc, diag::warn_unsupported_target_attribute) << Unknown << Tune << ParsedAttrs.Tune << Target; - if (Context.getTargetInfo().getTriple().isRI

[clang] [Clang][RISCV] Recognize unsupport target feature by supporting isValidFeatureName (PR #106495)

2024-09-05 Thread Piyou Chen via cfe-commits
@@ -4,3 +4,12 @@ int __attribute__((target("arch=rv64g"))) foo(void) { return 0; } //expected-error@+1 {{redefinition of 'foo'}} int __attribute__((target("arch=rv64gc"))) foo(void) { return 0; } + +//expected-warning@+1 {{unsupported 'notafeature' in the 'target' attribute st

[clang] [Clang][RISCV] Recognize unsupport target feature by supporting isValidFeatureName (PR #106495)

2024-09-05 Thread Piyou Chen via cfe-commits
https://github.com/BeMg updated https://github.com/llvm/llvm-project/pull/106495 >From e8f472674e0d1e70adcd1d29b8c902f4cd80f188 Mon Sep 17 00:00:00 2001 From: Piyou Chen Date: Wed, 28 Aug 2024 21:15:57 -0700 Subject: [PATCH 1/7] [Clang][RISCV] Recognize unsupport feature by supporting isValidFe

[clang] [Clang][RISCV] Recognize unsupport target feature by supporting isValidFeatureName (PR #106495)

2024-09-04 Thread Piyou Chen via cfe-commits
BeMg wrote: ping https://github.com/llvm/llvm-project/pull/106495 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [RISCV][FMV] Support target_clones (PR #85786)

2024-09-04 Thread Piyou Chen via cfe-commits
https://github.com/BeMg updated https://github.com/llvm/llvm-project/pull/85786 >From 395ce72afbf9e4b12fcbfaf9cdbda8921c9ff72a Mon Sep 17 00:00:00 2001 From: Piyou Chen Date: Tue, 23 Jul 2024 19:59:06 -0700 Subject: [PATCH 01/16] [RISCV][FMV] Support target_clones --- .../clang/Basic/Diagnosti

[clang] [RISCV][FMV] Support target_clones (PR #85786)

2024-09-04 Thread Piyou Chen via cfe-commits
https://github.com/BeMg edited https://github.com/llvm/llvm-project/pull/85786 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [RISCV][FMV] Support target_version (PR #99040)

2024-09-04 Thread Piyou Chen via cfe-commits
BeMg wrote: stack on https://github.com/llvm/llvm-project/pull/85786 https://github.com/llvm/llvm-project/pull/99040 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [RISCV][FMV] Support target_version (PR #99040)

2024-09-04 Thread Piyou Chen via cfe-commits
BeMg wrote: Support `priority` syntax for target_version https://github.com/llvm/llvm-project/pull/99040 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][RISCV] Recognize unsupport target feature by supporting isValidFeatureName (PR #106495)

2024-08-31 Thread Piyou Chen via cfe-commits
BeMg wrote: Rebase with https://github.com/llvm/llvm-project/pull/106680 and drop the `__RISCV_TargetAttrNeedOverride` relate code section. https://github.com/llvm/llvm-project/pull/106495 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https:

[clang] [Clang][RISCV] Recognize unsupport target feature by supporting isValidFeatureName (PR #106495)

2024-08-31 Thread Piyou Chen via cfe-commits
https://github.com/BeMg edited https://github.com/llvm/llvm-project/pull/106495 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][RISCV] Recognize unsupport target feature by supporting isValidFeatureName (PR #106495)

2024-08-31 Thread Piyou Chen via cfe-commits
https://github.com/BeMg edited https://github.com/llvm/llvm-project/pull/106495 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][RISCV] Recognize unsupport target feature by supporting isValidFeatureName (PR #106495)

2024-08-31 Thread Piyou Chen via cfe-commits
https://github.com/BeMg updated https://github.com/llvm/llvm-project/pull/106495 >From e8f472674e0d1e70adcd1d29b8c902f4cd80f188 Mon Sep 17 00:00:00 2001 From: Piyou Chen Date: Wed, 28 Aug 2024 21:15:57 -0700 Subject: [PATCH 1/4] [Clang][RISCV] Recognize unsupport feature by supporting isValidFe

[clang] [Clang][RISCV] Recognize unsupport target feature by supporting isValidFeatureName (PR #106495)

2024-08-31 Thread Piyou Chen via cfe-commits
https://github.com/BeMg updated https://github.com/llvm/llvm-project/pull/106495 >From e8f472674e0d1e70adcd1d29b8c902f4cd80f188 Mon Sep 17 00:00:00 2001 From: Piyou Chen Date: Wed, 28 Aug 2024 21:15:57 -0700 Subject: [PATCH 1/3] [Clang][RISCV] Recognize unsupport feature by supporting isValidFe

[clang] [RISCV][NFC] Reimplementation of target attribute override mechanism (PR #106680)

2024-08-31 Thread Piyou Chen via cfe-commits
https://github.com/BeMg closed https://github.com/llvm/llvm-project/pull/106680 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][RISCV] Recognize unsupport target feature by supporting isValidFeatureName (PR #106495)

2024-08-30 Thread Piyou Chen via cfe-commits
@@ -2993,10 +2993,17 @@ bool Sema::checkTargetAttr(SourceLocation LiteralLoc, StringRef AttrStr) { return Diag(LiteralLoc, diag::warn_unsupported_target_attribute) << Unknown << Tune << ParsedAttrs.Tune << Target; - if (Context.getTargetInfo().getTriple().isRI

[clang] [Clang][RISCV] Recognize unsupport target feature by supporting isValidFeatureName (PR #106495)

2024-08-30 Thread Piyou Chen via cfe-commits
https://github.com/BeMg updated https://github.com/llvm/llvm-project/pull/106495 >From 64557cf6950c17a92b6d85980530abe1e193e111 Mon Sep 17 00:00:00 2001 From: Piyou Chen Date: Wed, 28 Aug 2024 21:15:57 -0700 Subject: [PATCH 1/3] [Clang][RISCV] Recognize unsupport feature by supporting isValidFe

[clang] [Clang][RISCV] Recognize unsupport target feature by supporting isValidFeatureName (PR #106495)

2024-08-30 Thread Piyou Chen via cfe-commits
@@ -257,7 +257,7 @@ bool RISCVTargetInfo::initFeatureMap( // If a target attribute specified a full arch string, override all the ISA // extension target features. - const auto I = llvm::find(FeaturesVec, "__RISCV_TargetAttrNeedOverride"); + const auto I = llvm::find(Fea

[clang] [RISCV][NFC] Reimplementation of target attribute override mechanism (PR #106680)

2024-08-30 Thread Piyou Chen via cfe-commits
https://github.com/BeMg created https://github.com/llvm/llvm-project/pull/106680 This patch aims to replace the target attribute override mechanism based on `__RISCV_TargetAttrNeedOverride` with the insertion of several negative target features When the target attribute uses the full architect

[clang] [Clang][RISCV] Recognize unsupport target feature by supporting isValidFeatureName (PR #106495)

2024-08-29 Thread Piyou Chen via cfe-commits
@@ -391,7 +391,14 @@ void RISCVTargetInfo::fillValidTuneCPUList( static void handleFullArchString(StringRef FullArchStr, std::vector &Features) { - Features.push_back("__RISCV_TargetAttrNeedOverride"); + + // Should be full arch string. + if

[clang] [Clang][RISCV] Recognize unsupport target feature by supporting isValidFeatureName (PR #106495)

2024-08-29 Thread Piyou Chen via cfe-commits
https://github.com/BeMg updated https://github.com/llvm/llvm-project/pull/106495 >From 64557cf6950c17a92b6d85980530abe1e193e111 Mon Sep 17 00:00:00 2001 From: Piyou Chen Date: Wed, 28 Aug 2024 21:15:57 -0700 Subject: [PATCH 1/2] [Clang][RISCV] Recognize unsupport feature by supporting isValidFe

[clang] [Clang][RISCV] Recognize unsupport target feature by supporting... (PR #106495)

2024-08-29 Thread Piyou Chen via cfe-commits
@@ -391,7 +391,14 @@ void RISCVTargetInfo::fillValidTuneCPUList( static void handleFullArchString(StringRef FullArchStr, std::vector &Features) { - Features.push_back("__RISCV_TargetAttrNeedOverride"); + + // Should be full arch string. + if

[clang] [Clang][RISCV] Recognize unsupport target feature by supporting... (PR #106495)

2024-08-28 Thread Piyou Chen via cfe-commits
https://github.com/BeMg created https://github.com/llvm/llvm-project/pull/106495 …isValidFeatureName This patch makes unsupported target attributes emit a warning and ignore the target attribute during semantic checks. The changes include: 1. Adding the RISCVTargetInfo::isValidFeatureName func

[clang] [RISCV][FMV] Support target_clones (PR #85786)

2024-08-28 Thread Piyou Chen via cfe-commits
https://github.com/BeMg updated https://github.com/llvm/llvm-project/pull/85786 >From 395ce72afbf9e4b12fcbfaf9cdbda8921c9ff72a Mon Sep 17 00:00:00 2001 From: Piyou Chen Date: Tue, 23 Jul 2024 19:59:06 -0700 Subject: [PATCH 01/15] [RISCV][FMV] Support target_clones --- .../clang/Basic/Diagnosti

[clang] [RISCV][FMV] Support target_clones (PR #85786)

2024-08-26 Thread Piyou Chen via cfe-commits
https://github.com/BeMg updated https://github.com/llvm/llvm-project/pull/85786 >From 395ce72afbf9e4b12fcbfaf9cdbda8921c9ff72a Mon Sep 17 00:00:00 2001 From: Piyou Chen Date: Tue, 23 Jul 2024 19:59:06 -0700 Subject: [PATCH 01/14] [RISCV][FMV] Support target_clones --- .../clang/Basic/Diagnosti

[clang] [RISCV][FMV] Support target_clones (PR #85786)

2024-08-26 Thread Piyou Chen via cfe-commits
BeMg wrote: ping https://github.com/llvm/llvm-project/pull/85786 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [RISCV][FMV] Support target_clones (PR #85786)

2024-08-24 Thread Piyou Chen via cfe-commits
https://github.com/BeMg updated https://github.com/llvm/llvm-project/pull/85786 >From 395ce72afbf9e4b12fcbfaf9cdbda8921c9ff72a Mon Sep 17 00:00:00 2001 From: Piyou Chen Date: Tue, 23 Jul 2024 19:59:06 -0700 Subject: [PATCH 01/13] [RISCV][FMV] Support target_clones --- .../clang/Basic/Diagnosti

[clang] [RISCV][FMV] Support target_clones (PR #85786)

2024-08-23 Thread Piyou Chen via cfe-commits
@@ -2877,10 +2877,144 @@ void CodeGenFunction::EmitMultiVersionResolver( case llvm::Triple::aarch64: EmitAArch64MultiVersionResolver(Resolver, Options); return; + case llvm::Triple::riscv32: + case llvm::Triple::riscv64: +EmitRISCVMultiVersionResolver(Resolver,

[clang] [RISCV][FMV] Support target_clones (PR #85786)

2024-08-23 Thread Piyou Chen via cfe-commits
https://github.com/BeMg updated https://github.com/llvm/llvm-project/pull/85786 >From 395ce72afbf9e4b12fcbfaf9cdbda8921c9ff72a Mon Sep 17 00:00:00 2001 From: Piyou Chen Date: Tue, 23 Jul 2024 19:59:06 -0700 Subject: [PATCH 01/12] [RISCV][FMV] Support target_clones --- .../clang/Basic/Diagnosti

[clang] [RISCV][FMV] Support target_clones (PR #85786)

2024-08-22 Thread Piyou Chen via cfe-commits
@@ -63,9 +63,55 @@ class RISCVABIInfo : public DefaultABIInfo { CharUnits Field2Off) const; ABIArgInfo coerceVLSVector(QualType Ty) const; + + using ABIInfo::appendAttributeMangling; + void appendAttributeMangling(TargetClones

[clang] [RISCV][FMV] Support target_clones (PR #85786)

2024-08-22 Thread Piyou Chen via cfe-commits
@@ -2877,10 +2877,144 @@ void CodeGenFunction::EmitMultiVersionResolver( case llvm::Triple::aarch64: EmitAArch64MultiVersionResolver(Resolver, Options); return; + case llvm::Triple::riscv32: + case llvm::Triple::riscv64: +EmitRISCVMultiVersionResolver(Resolver,

[clang] [RISCV][FMV] Support target_clones (PR #85786)

2024-08-22 Thread Piyou Chen via cfe-commits
@@ -2877,10 +2877,144 @@ void CodeGenFunction::EmitMultiVersionResolver( case llvm::Triple::aarch64: EmitAArch64MultiVersionResolver(Resolver, Options); return; + case llvm::Triple::riscv32: + case llvm::Triple::riscv64: +EmitRISCVMultiVersionResolver(Resolver,

[clang] [RISCV][FMV] Support target_clones (PR #85786)

2024-08-22 Thread Piyou Chen via cfe-commits
@@ -2877,10 +2877,144 @@ void CodeGenFunction::EmitMultiVersionResolver( case llvm::Triple::aarch64: EmitAArch64MultiVersionResolver(Resolver, Options); return; + case llvm::Triple::riscv32: + case llvm::Triple::riscv64: +EmitRISCVMultiVersionResolver(Resolver,

[clang] [RISCV][FMV] Support target_clones (PR #85786)

2024-08-22 Thread Piyou Chen via cfe-commits
@@ -63,9 +63,55 @@ class RISCVABIInfo : public DefaultABIInfo { CharUnits Field2Off) const; ABIArgInfo coerceVLSVector(QualType Ty) const; + + using ABIInfo::appendAttributeMangling; + void appendAttributeMangling(TargetClones

[clang] [RISCV][FMV] Support target_clones (PR #85786)

2024-08-22 Thread Piyou Chen via cfe-commits
https://github.com/BeMg updated https://github.com/llvm/llvm-project/pull/85786 >From 395ce72afbf9e4b12fcbfaf9cdbda8921c9ff72a Mon Sep 17 00:00:00 2001 From: Piyou Chen Date: Tue, 23 Jul 2024 19:59:06 -0700 Subject: [PATCH 01/11] [RISCV][FMV] Support target_clones --- .../clang/Basic/Diagnosti

[clang] [RISCV][FMV] Support target_clones (PR #85786)

2024-08-22 Thread Piyou Chen via cfe-commits
@@ -2877,10 +2877,144 @@ void CodeGenFunction::EmitMultiVersionResolver( case llvm::Triple::aarch64: EmitAArch64MultiVersionResolver(Resolver, Options); return; + case llvm::Triple::riscv32: + case llvm::Triple::riscv64: +EmitRISCVMultiVersionResolver(Resolver,

  1   2   3   >