xen0n wrote:
> > Also a `[Clang]` tag could be prepended to the PR title to make it clearer
> > what part gets changed.
>
> Not only clang, all of FreeBSD on LoongArch
It's not about *what can get built after the change*, but *what part of LLVM
project this change applies to*, which is Clang.
xen0n wrote:
Also a `[Clang]` tag could be prepended to the PR title to make it clearer what
part gets changed.
https://github.com/llvm/llvm-project/pull/119191
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mai
https://github.com/xen0n approved this pull request.
https://github.com/llvm/llvm-project/pull/119191
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -223,6 +231,12 @@ void freebsd::Linker::ConstructJob(Compilation &C, const
JobAction &JA,
CmdArgs.push_back("--no-relax");
}
+ if (Triple.isLoongArch64()) {
+CmdArgs.push_back("-X");
+if (Args.hasArg(options::OPT_mno_relax))
+ CmdArgs.push_back("--no-
@@ -5743,6 +5747,14 @@
LoongArchTargetLowering::shouldExpandAtomicRMWInIR(AtomicRMWInst *AI) const {
}
unsigned Size = AI->getType()->getPrimitiveSizeInBits();
+ if (Subtarget.hasLAMCAS()) {
+if (AI->getOperation() == AtomicRMWInst::Nand ||
+(Size < 32 /*&& (
xen0n wrote:
Also please split the LLVM and Clang changes.
https://github.com/llvm/llvm-project/pull/114189
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/xen0n commented:
I think this is getting more convoluted than necessary? For example, I didn't
see a `setOperationAction(ISD::ATOMIC_CMP_SWAP, Legal)` call gated on presence
of the `lamcas` feature, which I think would render a lot (if not most) of the
changes here made to t
@@ -363,6 +363,10 @@ LoongArchTargetLowering::LoongArchTargetLowering(const
TargetMachine &TM,
setPrefFunctionAlignment(Subtarget.getPrefFunctionAlignment());
setPrefLoopAlignment(Subtarget.getPrefLoopAlignment());
setMaxBytesForAlignment(Subtarget.getMaxBytesForAlignmen
@@ -1562,7 +1562,9 @@ unsigned
LoongArchAsmParser::checkTargetMatchPredicate(MCInst &Inst) {
unsigned Opc = Inst.getOpcode();
switch (Opc) {
default:
-if (Opc >= LoongArch::AMADD_D && Opc <= LoongArch::AMXOR_W) {
+// amcas[_db].{b/h/w/d} didn't need this judgemen
@@ -0,0 +1,30 @@
+/// Test -m[no]lamcas options.
+
+// RUN: %clang --target=loongarch64 -mlamcas -fsyntax-only %s -### 2>&1 | \
+// RUN: FileCheck %s --check-prefix=CC1-LAMCAS
+// RUN: %clang --target=loongarch64 -mno-lamcas -fsyntax-only %s -### 2>&1 | \
+// RUN: FileChec
https://github.com/xen0n edited https://github.com/llvm/llvm-project/pull/114189
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -70,6 +70,8 @@ Changes to the LLVM IR
* Added `llvm.exp10` intrinsic.
+* Added a code model attribute for the `global variable
`_.
xen0n wrote:
Refer to the IR construct verbatim, i.e. `code_model`, for better readability?
https://github.com/llvm/llvm-p
@@ -1119,6 +1119,14 @@ Windows Support
LoongArch Support
^
+- Added a code model attribute for the global variable. The following values
xen0n wrote:
"The `model` attribute is now supported for overriding the default code model
used to access
@@ -130,6 +132,8 @@ Changes to the Hexagon Backend
Changes to the LoongArch Backend
+* Respect the code model attribute of global variables when different from
+ their default values.
xen0n wrote:
"Code model of global variab
https://github.com/xen0n edited https://github.com/llvm/llvm-project/pull/72078
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -3408,6 +3408,8 @@ def warn_objc_redundant_literal_use : Warning<
def err_attr_tlsmodel_arg : Error<"tls_model must be \"global-dynamic\", "
"\"local-dynamic\", \"initial-exec\" or \"local-exec\"">;
+def err_attr_codemodel_arg : Error<"code_model '%0' is not supported on
https://github.com/xen0n commented:
Overall this seems fine, thanks!
But I'm not sure if reporting a more generic "the model attribute is not
supported on this target" for non-LoongArch would be better: it doesn't give
the false impression that the target doesn't support the specified code mod
https://github.com/xen0n edited https://github.com/llvm/llvm-project/pull/72078
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,37 @@
+// RUN: %clang_cc1 -emit-llvm -triple loongarch64 %s -o - | FileCheck %s
+
+// CHECK: @_ZL2v1 ={{.*}} global i32 0, code_model "small"
+static int v1 __attribute__((model("normal")));
+
+void use1() {
+ v1 = 1;
+}
+
+// CHECK: @v2 ={{.*}} global i32 0, code_mode
@@ -57,6 +57,15 @@ global variable or function should be in after translation.
let Heading = "section, __declspec(allocate)";
}
+def CodeModelDocs : Documentation {
+ let Category = DocCatVariable;
+ let Content = [{
+The ``model`` attribute allows you to specify a specifi
@@ -3369,6 +3369,33 @@ static void handleSectionAttr(Sema &S, Decl *D, const
ParsedAttr &AL) {
}
}
+static void handleCodeModelAttr(Sema &S, Decl *D, const ParsedAttr &AL) {
+ StringRef CM;
+ StringRef Str;
+ SourceLocation LiteralLoc;
+ bool Ok = false;
+ // Check tha
https://github.com/xen0n edited https://github.com/llvm/llvm-project/pull/72078
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/xen0n commented:
There should also be a test case that shows the attribute is not supported on a
non-LoongArch target. Otherwise this mostly looks fine to me, thanks for
pushing this forward!
https://github.com/llvm/llvm-project/pull/72078
___
xen0n wrote:
I think we should initially only support the attribute on LoongArch. GCC's
`model` attribute is only ever supported on ia64 and loongarch, yet the patch
currently seems to allow other architectures to use this attribute, with LLVM
code model names accepted -- this may or may not b
https://github.com/xen0n commented:
Looks okay, although I may be missing some places. For now I don't know if
recording this fact (no copy reloc support) with a helper function somewhere
would help de-duplicating the logic -- it should be the case normally but I
don't know where to best put t
xen0n wrote:
According to [the *LLVM GitHub user
guide*](https://llvm.org/docs/GitHub.html#creating-pull-requests):
> If you have multiple changes you want to introduce, it’s recommended to
> create separate pull requests for each change.
Given you've already split your changes into several s
@@ -214,6 +214,13 @@ LoongArchTargetLowering::LoongArchTargetLowering(const
TargetMachine &TM,
setOperationAction(ISD::FRINT, MVT::f64, Legal);
}
+ setOperationAction(ISD::FP16_TO_FP,MVT::f32, Expand);
+ setOperationAction(ISD::FP_TO_FP16,MVT::f32,
https://github.com/xen0n commented:
Thanks for the contribution and welcome!
As for the commit message, please take a look at the existing commits for the
general feel. (For example, people typically prefix the commit title with the
involved topic(s) in brackets, and use a verb phrase for the
https://github.com/xen0n edited https://github.com/llvm/llvm-project/pull/68851
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
xen0n wrote:
also cc @SixWeining (BTW we want to have a GitHub team set up for notifications
and assignments apparently)
It's 4 am here and I'd take a look after getting some sleep, to ensure review
quality ;-)
https://github.com/llvm/llvm-project/pull/65657
__
30 matches
Mail list logo