[clang] [Clang][LoongArch] Comply with the lp64d ABI to pass vector arguments (PR #74990)

2023-12-10 Thread Lu Weining via cfe-commits
https://github.com/SixWeining approved this pull request. https://github.com/llvm/llvm-project/pull/74990 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Driver] Support -mcmodel= for LoongArch (PR #72514)

2023-11-16 Thread Lu Weining via cfe-commits
https://github.com/SixWeining created https://github.com/llvm/llvm-project/pull/72514 7e42545 rejects unsupported mcmodel options, but small/medium/large should be supported models for LoongArch. In addition, to be compatible with gcc, mapping some of their values to clang's. The mapping is:

[clang] [Driver] Support -mcmodel= for LoongArch (PR #72514)

2023-11-16 Thread Lu Weining via cfe-commits
SixWeining wrote: cc @xen0n @xry111 https://github.com/llvm/llvm-project/pull/72514 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Driver] Support -mcmodel= for LoongArch (PR #72514)

2023-11-16 Thread Lu Weining via cfe-commits
SixWeining wrote: > > And AFAIK, gcc side doesn't plan to implement the "large" code model. > > Why did we distinguish "large" and "extreme" in the first place? If we don't > need a different "large" code model then I guess we should make it an alias > of "extreme" for GCC too. @ChenghuaXu @c

[llvm] [clang-tools-extra] [clang] [Clang][LoongArch] Support builtin functions for LSX and LASX (PR #69313)

2023-10-30 Thread Lu Weining via cfe-commits
https://github.com/SixWeining approved this pull request. LGTM. https://github.com/llvm/llvm-project/pull/69313 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [llvm] [Clang][LoongArch] Support builtin functions for LSX and LASX (PR #69313)

2023-10-31 Thread Lu Weining via cfe-commits
https://github.com/SixWeining closed https://github.com/llvm/llvm-project/pull/69313 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [clang-tools-extra] [Clang][LoongArch] Support builtin functions for LSX and LASX (PR #69313)

2023-10-31 Thread Lu Weining via cfe-commits
SixWeining wrote: To keep original 6 commits I have manually merged into trunk. Now close this PR. https://github.com/llvm/llvm-project/pull/69313 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/c

[clang] [LoongArch] Fix ABI mismatch with gcc/g++ about empty structs passing (PR #70320)

2023-10-31 Thread Lu Weining via cfe-commits
SixWeining wrote: > LGTM. I've no permission to make a formal ("GitHub style") approval. Thanks. You can request to join the llvm organization via https://llvm.org/docs/DeveloperPolicy.html#obtaining-commit-access firstly. Then you can make formal ("Github style") approval. https://github.com

[clang] [LoongArch] Fix ABI mismatch with gcc/g++ about empty structs passing (PR #70320)

2023-10-31 Thread Lu Weining via cfe-commits
https://github.com/SixWeining closed https://github.com/llvm/llvm-project/pull/70320 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [LoongArch] Fix ABI mismatch with g++ when handling empty unions (PR #71025)

2023-11-01 Thread Lu Weining via cfe-commits
https://github.com/SixWeining created https://github.com/llvm/llvm-project/pull/71025 In g++, empty unions are not ignored like empty structs when flattening structs to examine whether the structs can be passed via FARs in C++. This patch aligns clang++ with g++. Fix https://github.com/llvm/l

[clang] [LoongArch] Fix ABI mismatch with g++ when handling empty unions (PR #71025)

2023-11-01 Thread Lu Weining via cfe-commits
SixWeining wrote: Hi @xen0n @xry111, please help to review this. Thanks. https://github.com/llvm/llvm-project/pull/71025 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [LoongArch] Fix ABI mismatch with g++ when handling empty unions (PR #71025)

2023-11-03 Thread Lu Weining via cfe-commits
https://github.com/SixWeining closed https://github.com/llvm/llvm-project/pull/71025 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Driver] Support -mcmodel= for LoongArch (PR #72514)

2023-11-23 Thread Lu Weining via cfe-commits
SixWeining wrote: > [gcc.gnu.org/onlinedocs/gcc/LoongArch-Options.html](https://gcc.gnu.org/onlinedocs/gcc/LoongArch-Options.html) > says > > ‘large (Not implemented yet)’ ‘extreme’ This mode does not limit the size of > the code segment and data segment. The -mcmodel=extreme option is > inco

[clang] [Driver] Support -mcmodel= for LoongArch (PR #72514)

2023-11-23 Thread Lu Weining via cfe-commits
https://github.com/SixWeining updated https://github.com/llvm/llvm-project/pull/72514 >From 8dd5bebcd4681e5e7849743aba0ce90c2959ee23 Mon Sep 17 00:00:00 2001 From: Weining Lu Date: Thu, 16 Nov 2023 21:57:03 +0800 Subject: [PATCH 1/2] [Driver] Support -mcmodel= for LoongArch 7e42545 rejects uns

[clang] [Driver] Support -mcmodel= for LoongArch (PR #72514)

2023-11-24 Thread Lu Weining via cfe-commits
https://github.com/SixWeining edited https://github.com/llvm/llvm-project/pull/72514 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Driver] Support -mcmodel= for LoongArch (PR #72514)

2023-11-29 Thread Lu Weining via cfe-commits
https://github.com/SixWeining closed https://github.com/llvm/llvm-project/pull/72514 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][AVR] Restrict range of assembly constraint 'G' (PR #76561)

2024-01-01 Thread Lu Weining via cfe-commits
SixWeining wrote: LGTM. I have checked with https://gcc.gnu.org/onlinedocs/gccint/Machine-Constraints.html. 'G' stands for "A floating point constant 0.0". But I'd like to wait others' opinion. https://github.com/llvm/llvm-project/pull/76561 ___ cfe-

[clang] [Clang][LoongArch] Do not pass vector arguments via vector registers (PR #74990)

2024-01-01 Thread Lu Weining via cfe-commits
https://github.com/SixWeining edited https://github.com/llvm/llvm-project/pull/74990 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][LoongArch] Do not pass vector arguments via vector registers (PR #74990)

2024-01-01 Thread Lu Weining via cfe-commits
https://github.com/SixWeining edited https://github.com/llvm/llvm-project/pull/74990 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][LoongArch] Do not pass vector arguments via vector registers (PR #74990)

2024-01-01 Thread Lu Weining via cfe-commits
https://github.com/SixWeining approved this pull request. https://github.com/llvm/llvm-project/pull/74990 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][LoongArch] Do not pass vector arguments via vector registers (PR #74990)

2024-01-01 Thread Lu Weining via cfe-commits
https://github.com/SixWeining closed https://github.com/llvm/llvm-project/pull/74990 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2024-03-14 Thread Lu Weining via cfe-commits
https://github.com/SixWeining approved this pull request. LGTM from LoongArch side as GCC only have `-m[no-]strict-align`. BTW, should clang release notes be updated for this change? https://github.com/llvm/llvm-project/pull/85350 ___ cfe-commits maili

[clang] [Clang][LoongArch] Fix wrong return value type of __iocsrrd_h (PR #84100)

2024-03-05 Thread Lu Weining via cfe-commits
https://github.com/SixWeining approved this pull request. https://github.com/llvm/llvm-project/pull/84100 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][LoongArch] Fix wrong return value type of __iocsrrd_h (PR #84100)

2024-03-05 Thread Lu Weining via cfe-commits
https://github.com/SixWeining closed https://github.com/llvm/llvm-project/pull/84100 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Better bitfield access units (PR #65742)

2024-02-25 Thread Lu Weining via cfe-commits
@@ -132,6 +132,7 @@ class LLVM_LIBRARY_VISIBILITY LoongArch64TargetInfo : LoongArchTargetInfo(Triple, Opts) { LongWidth = LongAlign = PointerWidth = PointerAlign = 64; IntMaxType = Int64Type = SignedLong; +HasCheapUnalignedBitfieldAccess = true; --

[llvm] [clang] [clang-tools-extra] [LoongArch] Insert nops and emit align reloc when handle alignment directive (PR #72962)

2024-01-23 Thread Lu Weining via cfe-commits
https://github.com/SixWeining updated https://github.com/llvm/llvm-project/pull/72962 >From 4985669d2de986d595c791c04a42e84c1f080c01 Mon Sep 17 00:00:00 2001 From: Jinyang He Date: Tue, 9 Jan 2024 15:35:17 +0800 Subject: [PATCH 1/2] [LoongArch] Insert nops and emit align reloc when handle alig

[llvm] [clang] [clang-tools-extra] [LoongArch] Insert nops and emit align reloc when handle alignment directive (PR #72962)

2024-01-23 Thread Lu Weining via cfe-commits
https://github.com/SixWeining closed https://github.com/llvm/llvm-project/pull/72962 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [llvm] [LoongArch] Insert nops and emit align reloc when handle alignment directive (PR #72962)

2024-01-23 Thread Lu Weining via cfe-commits
SixWeining wrote: Should be fixed by baba7e4175b6. https://github.com/llvm/llvm-project/pull/72962 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Check lsx/lasx features when running builtin tests (PR #79250)

2024-01-23 Thread Lu Weining via cfe-commits
https://github.com/SixWeining approved this pull request. https://github.com/llvm/llvm-project/pull/79250 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [LoongArch][test] Add tests reporting error if lsx/lasx feature is missing when lsx/lasx builtins are called (PR #79250)

2024-01-23 Thread Lu Weining via cfe-commits
https://github.com/SixWeining edited https://github.com/llvm/llvm-project/pull/79250 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [LoongArch][test] Add tests reporting error if lsx/lasx feature is missing when lsx/lasx builtins are called (PR #79250)

2024-01-23 Thread Lu Weining via cfe-commits
https://github.com/SixWeining closed https://github.com/llvm/llvm-project/pull/79250 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[llvm] [clang] [docs] Add llvm and clang release notes for the global-var code model attribute (PR #78664)

2024-01-18 Thread Lu Weining via cfe-commits
https://github.com/SixWeining approved this pull request. LGTM. Thanks. https://github.com/llvm/llvm-project/pull/78664 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[llvm] [clang] [LoongArch] Add definitions and feature 'frecipe' for FP approximation intrinsics/builtins (PR #78962)

2024-01-22 Thread Lu Weining via cfe-commits
https://github.com/SixWeining approved this pull request. LGTM if the conflicting were resolved. https://github.com/llvm/llvm-project/pull/78962 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe

[llvm] [clang] [LoongArch] Add definitions and feature 'frecipe' for FP approximation intrinsics/builtins (PR #78962)

2024-01-22 Thread Lu Weining via cfe-commits
https://github.com/SixWeining approved this pull request. https://github.com/llvm/llvm-project/pull/78962 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[llvm] [clang] [LoongArch] Add definitions and feature 'frecipe' for FP approximation intrinsics/builtins (PR #78962)

2024-01-22 Thread Lu Weining via cfe-commits
https://github.com/SixWeining closed https://github.com/llvm/llvm-project/pull/78962 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [docs] Add llvm & clang release notes for LoongArch (PR #79097)

2024-01-22 Thread Lu Weining via cfe-commits
https://github.com/SixWeining closed https://github.com/llvm/llvm-project/pull/79097 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][LoongArch] Support builtin functions for LSX and LASX (PR #69313)

2023-10-22 Thread Lu Weining via cfe-commits
SixWeining wrote: > Given you've already split your changes into several smaller commits, it's > probably better to file them as separate PRs, so each one is smaller than the > current 3+-line diff, and become more reviewable that way. I'm not sure seperate PRs are appropriate since some o

[clang] [Clang][LoongArch] Support builtin functions for LSX and LASX (PR #69313)

2023-10-22 Thread Lu Weining via cfe-commits
https://github.com/SixWeining requested changes to this pull request. - For the commits `[LoongArch][CodeGen][clang] Add builtin functions test cases for LASX` and `[LoongArch][CodeGen][clang] Add builtin functions test cases for LSX`, `Change-Id`s can be removed. - Please fix the test failure.

[clang] [LoongArch] Fix ABI mismatch with gcc/g++ about empty structs passing (PR #70320)

2023-10-26 Thread Lu Weining via cfe-commits
https://github.com/SixWeining created https://github.com/llvm/llvm-project/pull/70320 How empty structs (not as fields of container struct) are passed in C++ is not explicitly documented in psABI. However, this patch fixes the mismatch with g++. Note that the unnamed bitfield case `struct { in

[clang] [LoongArch] Fix ABI mismatch with gcc/g++ about empty structs passing (PR #70320)

2023-10-26 Thread Lu Weining via cfe-commits
SixWeining wrote: Hi @xen0n @xry111, what do you think about this change? If it is ok, I'd like to checrry-pick to release/17.x (hope it's not too late...). https://github.com/llvm/llvm-project/pull/70320 ___ cfe-commits mailing list cfe-commits@lists

[clang] [Clang][LoongArch] Generate _mcount instead of mcount (PR #65657)

2023-09-07 Thread Lu Weining via cfe-commits
SixWeining wrote: > also cc @SixWeining (BTW we want to have a GitHub team set up for > notifications and assignments apparently) There is one: https://github.com/orgs/llvm/teams/pr-subscribers-loongarch I will invite you to join this team and others interested in could also request to join.

[clang] [Clang][LoongArch] Generate _mcount instead of mcount (PR #65657)

2023-09-07 Thread Lu Weining via cfe-commits
https://github.com/SixWeining approved this pull request. I have checked that glibc/sysdeps/loongarch/machine-gmon.h defines `_mcount`. https://github.com/llvm/llvm-project/pull/65657 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://list

[clang] [clang] Better bitfield access units (PR #65742)

2024-02-21 Thread Lu Weining via cfe-commits
SixWeining wrote: > For GCC, we have `-mno-unalgined-access`. We need also add this option to > clang. `-mno-unalgined-access` has been added since clang17: https://reviews.llvm.org/D149946 https://github.com/llvm/llvm-project/pull/65742 ___ cfe-com

[clang] [clang] Better bitfield access units (PR #65742)

2024-02-21 Thread Lu Weining via cfe-commits
@@ -132,6 +132,7 @@ class LLVM_LIBRARY_VISIBILITY LoongArch64TargetInfo : LoongArchTargetInfo(Triple, Opts) { LongWidth = LongAlign = PointerWidth = PointerAlign = 64; IntMaxType = Int64Type = SignedLong; +HasCheapUnalignedBitfieldAccess = true; --

[clang] [LoongArch][clang] Add support for option `-msimd=` and macro `__loongarch_simd_width`. (PR #97984)

2024-07-07 Thread Lu Weining via cfe-commits
https://github.com/SixWeining edited https://github.com/llvm/llvm-project/pull/97984 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [LoongArch][clang] Add support for option `-msimd=` and macro `__loongarch_simd_width`. (PR #97984)

2024-07-07 Thread Lu Weining via cfe-commits
https://github.com/SixWeining approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/97984 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [llvm][Triple] Add `Environment` members and parsing for glibc/musl parity. (PR #107664)

2024-09-06 Thread Lu Weining via cfe-commits
SixWeining wrote: cc @xen0n @xry111 https://github.com/llvm/llvm-project/pull/107664 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [llvm][Triple] Add `Environment` members and parsing for glibc/musl parity. (PR #107664)

2024-09-09 Thread Lu Weining via cfe-commits
https://github.com/SixWeining approved this pull request. The LoongArch bits LGTM. Thanks. https://github.com/llvm/llvm-project/pull/107664 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-comm

[clang] [llvm] [LoongArch] Adjust LA64 data layout by using n32:64 in layout string (PR #93814)

2024-06-05 Thread Lu Weining via cfe-commits
https://github.com/SixWeining edited https://github.com/llvm/llvm-project/pull/93814 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [LoongArch] Adjust LA64 data layout by using n32:64 in layout string (PR #93814)

2024-06-05 Thread Lu Weining via cfe-commits
https://github.com/SixWeining commented: @wangleiat What do you think? https://github.com/llvm/llvm-project/pull/93814 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [LoongArch] Adjust LA64 data layout by using n32:64 in layout string (PR #93814)

2024-06-05 Thread Lu Weining via cfe-commits
@@ -5368,8 +5368,8 @@ std::string llvm::UpgradeDataLayoutString(StringRef DL, StringRef TT) { return DL.empty() ? std::string("G1") : (DL + "-G1").str(); } - if (T.isRISCV64()) { -// Make i32 a native type for 64-bit RISC-V. + if (T.isRISCV64() || T.isLoongArch64(

[clang] [clang][LoongArch] Enable -fasynchronous-unwind-tables by default on Linux (PR #94711)

2024-06-06 Thread Lu Weining via cfe-commits
SixWeining wrote: We already have `loongarch-default-features.c`. https://github.com/llvm/llvm-project/pull/94711 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo

[clang] [clang][LoongArch] Enable -fasynchronous-unwind-tables by default on Linux (PR #94711)

2024-06-06 Thread Lu Weining via cfe-commits
SixWeining wrote: I just rename it in f2441b0297501610b59527f93e3174c814d63941. https://github.com/llvm/llvm-project/pull/94711 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/ma

[clang] [LoongArch] Enable 128-bits vector by default (PR #100056)

2024-07-22 Thread Lu Weining via cfe-commits
https://github.com/SixWeining closed https://github.com/llvm/llvm-project/pull/100056 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [LoongArch] Support -march=la64v1.0 and -march=la64v1.1 (PR #100057)

2024-07-22 Thread Lu Weining via cfe-commits
https://github.com/SixWeining approved this pull request. https://github.com/llvm/llvm-project/pull/100057 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [LoongArch] Support -march=la64v1.0 and -march=la64v1.1 (PR #100057)

2024-07-22 Thread Lu Weining via cfe-commits
https://github.com/SixWeining closed https://github.com/llvm/llvm-project/pull/100057 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [LoongArch] Support la664 (PR #100068)

2024-07-22 Thread Lu Weining via cfe-commits
https://github.com/SixWeining approved this pull request. https://github.com/llvm/llvm-project/pull/100068 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [LoongArch] Support la664 (PR #100068)

2024-07-23 Thread Lu Weining via cfe-commits
https://github.com/SixWeining closed https://github.com/llvm/llvm-project/pull/100068 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [LoongArch][clang] Add support for option `-msimd=` and macro `__loongarch_simd_width`. (PR #97984)

2024-07-08 Thread Lu Weining via cfe-commits
https://github.com/SixWeining closed https://github.com/llvm/llvm-project/pull/97984 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [LoongArch][clang] Modify `loongarch-msimd.c` to avoid `grep -o`. NFC (PR #98442)

2024-07-11 Thread Lu Weining via cfe-commits
https://github.com/SixWeining approved this pull request. https://github.com/llvm/llvm-project/pull/98442 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [LoongArch][clang] Modify `loongarch-msimd.c` to avoid `grep -o`. NFC (PR #98442)

2024-07-11 Thread Lu Weining via cfe-commits
https://github.com/SixWeining closed https://github.com/llvm/llvm-project/pull/98442 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [clang] Introduce target-specific `Sema` components (PR #93179)

2024-05-23 Thread Lu Weining via cfe-commits
https://github.com/SixWeining approved this pull request. LGTM from the LoongArch side. Thanks! https://github.com/llvm/llvm-project/pull/93179 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-

[clang] [llvm] [LoongArch] Add options for annotate tablejump (PR #102411)

2024-10-12 Thread Lu Weining via cfe-commits
@@ -5340,6 +5340,10 @@ def mno_lasx : Flag<["-"], "mno-lasx">, Group, def msimd_EQ : Joined<["-"], "msimd=">, Group, Flags<[TargetSpecific]>, HelpText<"Select the SIMD extension(s) to be enabled in LoongArch either 'none', 'lsx', 'lasx'.">; +def mannotate_tablejump : Flag

[clang] [llvm] [LoongArch] Add options for annotate tablejump (PR #102411)

2024-10-12 Thread Lu Weining via cfe-commits
https://github.com/SixWeining edited https://github.com/llvm/llvm-project/pull/102411 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [lld] [lld][LoongArch] Enable relaxation when --relax option is passed (PR #111488)

2024-10-13 Thread Lu Weining via cfe-commits
@@ -1462,6 +1462,8 @@ template void Writer::finalizeAddressDependentContent() { for (;;) { bool changed = ctx.target->needsThunks ? tc.createThunks(pass, ctx.outputSections) + : ctx.arg.emachine == EM_LOONGARCH && !ctx.arg.relax

[clang] [lld] [lld][LoongArch] Enable relaxation when --relax option is passed (PR #111488)

2024-10-14 Thread Lu Weining via cfe-commits
SixWeining wrote: The title should also be updated. https://github.com/llvm/llvm-project/pull/111488 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [lld] [Driver] Default enable LoongArch linker relaxation (PR #111488)

2024-10-15 Thread Lu Weining via cfe-commits
SixWeining wrote: I think that's OK. https://github.com/llvm/llvm-project/pull/111488 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [LoongArch] [CodeGen] Add options for Clang to generate LoongArch-specific frecipe & frsqrte instructions (PR #109917)

2024-10-15 Thread Lu Weining via cfe-commits
@@ -0,0 +1,30 @@ +/// Test -m[no]frecipe options. + +// RUN: %clang --target=loongarch64 -mfrecipe -fsyntax-only %s -### 2>&1 | \ +// RUN: FileCheck %s --check-prefix=CC1-FRECIPE +// RUN: %clang --target=loongarch64 -mno-frecipe -fsyntax-only %s -### 2>&1 | \ +// RUN: File

[clang] [llvm] [LoongArch] [CodeGen] Add options for Clang to generate LoongArch-specific frecipe & frsqrte instructions (PR #109917)

2024-10-15 Thread Lu Weining via cfe-commits
https://github.com/SixWeining approved this pull request. LGTM except a nit. https://github.com/llvm/llvm-project/pull/109917 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [LoongArch] [CodeGen] Add options for Clang to generate LoongArch-specific frecipe & frsqrte instructions (PR #109917)

2024-10-15 Thread Lu Weining via cfe-commits
https://github.com/SixWeining edited https://github.com/llvm/llvm-project/pull/109917 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [LoongArch] [CodeGen] Add options for Clang to generate LoongArch-specific frecipe & frsqrte instructions (PR #109917)

2024-10-10 Thread Lu Weining via cfe-commits
@@ -251,6 +251,16 @@ void loongarch::getLoongArchTargetFeatures(const Driver &D, } else /*-mno-lasx*/ Features.push_back("-lasx"); } + + // Select frecipe feature determined by -m[no-]frecipe. + if (const Arg *A = + Args.getLastArg(options::OPT_mfrecipe,

[clang] [llvm] [LoongArch] [CodeGen] Add options for Clang to generate LoongArch-specific frecipe & frsqrte instructions (PR #109917)

2024-10-10 Thread Lu Weining via cfe-commits
@@ -5902,6 +5914,92 @@ Register LoongArchTargetLowering::getExceptionSelectorRegister( return LoongArch::R5; } +//===--===// +// Target Optimization Hooks +//===-

[clang] [llvm] [LoongArch] [CodeGen] Add options for Clang to generate LoongArch-specific frecipe & frsqrte instructions (PR #109917)

2024-10-10 Thread Lu Weining via cfe-commits
@@ -141,6 +141,22 @@ enum NodeType : unsigned { VALL_NONZERO, VANY_NONZERO, + // Floating point approximate reciprocal operation + FRECIPE_S, SixWeining wrote: Can we only define two generic nodes (FRECIPE / FRSQRTE)? https://github.com/llvm/llvm-proje

[clang] [llvm] [LoongArch] [CodeGen] Add options for Clang to generate LoongArch-specific frecipe & frsqrte instructions (PR #109917)

2024-10-10 Thread Lu Weining via cfe-commits
@@ -251,6 +251,16 @@ void loongarch::getLoongArchTargetFeatures(const Driver &D, } else /*-mno-lasx*/ Features.push_back("-lasx"); } + + // Select frecipe feature determined by -m[no-]frecipe. + if (const Arg *A = + Args.getLastArg(options::OPT_mfrecipe,

[clang] [llvm] [LoongArch] [CodeGen] Add options for Clang to generate LoongArch-specific frecipe & frsqrte instructions (PR #109917)

2024-10-10 Thread Lu Weining via cfe-commits
@@ -19,12 +19,15 @@ def SDT_LoongArchMOVGR2FR_W_LA64 def SDT_LoongArchMOVFR2GR_S_LA64 : SDTypeProfile<1, 1, [SDTCisVT<0, i64>, SDTCisVT<1, f32>]>; def SDT_LoongArchFTINT : SDTypeProfile<1, 1, [SDTCisFP<0>, SDTCisFP<1>]>; +def SDT_LoongArchFRECIPE : SDTypeProfile<1, 1, [SDTC

[clang] [llvm] [LoongArch] [CodeGen] Add options for Clang to generate LoongArch-specific frecipe & frsqrte instructions (PR #109917)

2024-10-10 Thread Lu Weining via cfe-commits
@@ -5902,6 +5914,92 @@ Register LoongArchTargetLowering::getExceptionSelectorRegister( return LoongArch::R5; } +//===--===// +// Target Optimization Hooks +//===-

[clang] [llvm] [LoongArch] [CodeGen] Add options for Clang to generate LoongArch-specific frecipe & frsqrte instructions (PR #109917)

2024-10-10 Thread Lu Weining via cfe-commits
@@ -0,0 +1,396 @@ +; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py +; RUN: llc --mtriple=loongarch32 --mattr=+f,-d,-frecipe < %s | FileCheck %s --check-prefix=LA32F +; RUN: llc --mtriple=loongarch32 --mattr=+f,-d,+frecipe < %s | FileCheck %s --check

[clang] [llvm] [LoongArch] [CodeGen] Add options for Clang to generate LoongArch-specific frecipe & frsqrte instructions (PR #109917)

2024-10-11 Thread Lu Weining via cfe-commits
@@ -141,6 +141,22 @@ enum NodeType : unsigned { VALL_NONZERO, VANY_NONZERO, + // Floating point approximate reciprocal operation + FRECIPE_S, SixWeining wrote: They are not the same. The iocsrrd_* instructions have same operand type `GPR` but frecipe_*

[clang] [llvm] [LoongArch] [CodeGen] Support LoongArch-specific amswap[__db].{b/h} and amadd[__db].{b/h} instructions. (PR #113255)

2024-10-22 Thread Lu Weining via cfe-commits
@@ -205,7 +205,7 @@ void LoongArchTargetInfo::getTargetDefines(const LangOptions &Opts, // TODO: As more features of the V1.1 ISA are supported, a unified "v1.1" // arch feature set will be used to include all sub-features belonging to // the V1.1 ISA version

[clang] [llvm] [LoongArch] [CodeGen] Support LoongArch-specific amswap[__db].{b/h} and amadd[__db].{b/h} instructions. (PR #113255)

2024-10-22 Thread Lu Weining via cfe-commits
@@ -0,0 +1,1674 @@ +; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py +; RUN: llc --mtriple=loongarch32 --mattr=+d,-lam-bh < %s | FileCheck %s --check-prefix=LA32 +; RUN: llc --mtriple=loongarch32 --mattr=+d,+lam-bh < %s | FileCheck %s --check-prefix=

[clang] [llvm] [LoongArch] [CodeGen] Support LoongArch-specific amswap[__db].{b/h} and amadd[__db].{b/h} instructions. (PR #113255)

2024-10-22 Thread Lu Weining via cfe-commits
@@ -2088,8 +2088,26 @@ multiclass binary_atomic_op_wd { (!cast(inst#"__DB_D"#signed) GPR:$rk, GPR:$rj)>; } +// Atomic operation for byte and half word +multiclass binary_atomic_op_bh { + def : Pat<(!cast(op#"_i8_monotonic") GPR:$rj, GPR:$rk), +(!cast(i

[clang] [llvm] [LoongArch] [CodeGen] Support LoongArch-specific amswap[__db].{b/h} and amadd[__db].{b/h} instructions. (PR #113255)

2024-10-22 Thread Lu Weining via cfe-commits
@@ -2088,8 +2088,26 @@ multiclass binary_atomic_op_wd { (!cast(inst#"__DB_D"#signed) GPR:$rk, GPR:$rj)>; } +// Atomic operation for byte and half word +multiclass binary_atomic_op_bh { + def : Pat<(!cast(op#"_i8_monotonic") GPR:$rj, GPR:$rk), +(!cast(i

[clang] [llvm] [LoongArch] [CodeGen] Add options for Clang to generate LoongArch-specific frecipe & frsqrte instructions (PR #109917)

2024-10-17 Thread Lu Weining via cfe-commits
https://github.com/SixWeining approved this pull request. https://github.com/llvm/llvm-project/pull/109917 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [LoongArch] [CodeGen] Add options for Clang to generate LoongArch-specific frecipe & frsqrte instructions (PR #109917)

2024-10-17 Thread Lu Weining via cfe-commits
https://github.com/SixWeining closed https://github.com/llvm/llvm-project/pull/109917 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [LoongArch] [CodeGen] Support LoongArch-specific amswap[_db].{b/h} and amadd[_db].{b/h} instructions. (PR #113255)

2024-10-23 Thread Lu Weining via cfe-commits
https://github.com/SixWeining edited https://github.com/llvm/llvm-project/pull/113255 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [LoongArch] Support LoongArch-specific amswap[_db].{b/h} and amadd[_db].{b/h} instructions (PR #113255)

2024-10-23 Thread Lu Weining via cfe-commits
https://github.com/SixWeining edited https://github.com/llvm/llvm-project/pull/113255 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [LoongArch] Support LoongArch-specific amswap[_db].{b/h} and amadd[_db].{b/h} instructions (PR #113255)

2024-10-23 Thread Lu Weining via cfe-commits
https://github.com/SixWeining approved this pull request. https://github.com/llvm/llvm-project/pull/113255 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [LoongArch] Support LoongArch-specific amswap[_db].{b/h} and amadd[_db].{b/h} instructions (PR #113255)

2024-10-23 Thread Lu Weining via cfe-commits
https://github.com/SixWeining closed https://github.com/llvm/llvm-project/pull/113255 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [LoongArch] Add options for annotate tablejump (PR #102411)

2024-10-12 Thread Lu Weining via cfe-commits
@@ -1888,6 +1888,14 @@ void Clang::AddLoongArchTargetArgs(const ArgList &Args, CmdArgs.push_back("-tune-cpu"); CmdArgs.push_back(Args.MakeArgString(TuneCPU)); } + + if (Arg *A = Args.getLastArg(options::OPT_mannotate_tablejump, + options

[clang] [llvm] [LoongArch] Add options for annotate tablejump (PR #102411)

2024-10-12 Thread Lu Weining via cfe-commits
https://github.com/SixWeining commented: Better to add gcc's links to commit message to let people know the background. https://github.com/llvm/llvm-project/pull/102411 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-

[clang] [llvm] [LoongArch] Add options for annotate tablejump (PR #102411)

2024-10-12 Thread Lu Weining via cfe-commits
@@ -5340,6 +5340,10 @@ def mno_lasx : Flag<["-"], "mno-lasx">, Group, def msimd_EQ : Joined<["-"], "msimd=">, Group, Flags<[TargetSpecific]>, HelpText<"Select the SIMD extension(s) to be enabled in LoongArch either 'none', 'lsx', 'lasx'.">; +def mannotate_tablejump : Flag

[clang] [lld] [lld][LoongArch] Add the relaxation option (PR #111488)

2024-10-14 Thread Lu Weining via cfe-commits
SixWeining wrote: > How about now? The patch doesn't touch lld, so my suggestion is "[Driver] Default enable LoongArch linker relaxation". Some additional comments: - Do we need to consider the `-gsplit-dwarf` issue #56642 resolved by https://reviews.llvm.org/D130190 ? - The ``--no-relax`` op

[clang] [lld] [lld][LoongArch] Enable relaxation when --relax option is passed (PR #111488)

2024-10-13 Thread Lu Weining via cfe-commits
@@ -1462,6 +1462,8 @@ template void Writer::finalizeAddressDependentContent() { for (;;) { bool changed = ctx.target->needsThunks ? tc.createThunks(pass, ctx.outputSections) + : ctx.arg.emachine == EM_LOONGARCH && !ctx.arg.relax

[clang] [llvm] [LoongArch] Support LoongArch-specific amswap[_db].{b/h} and amadd[_db].{b/h} instructions (PR #113255)

2024-10-24 Thread Lu Weining via cfe-commits
SixWeining wrote: > Just a heads up, I think this broke documentation builds. After bisecting it > points to this commit. Thanks. Fixed by #113632. https://github.com/llvm/llvm-project/pull/113255 ___ cfe-commits mailing list cfe-commits@lists.llvm.o

[clang] [LoongArch] fix description of clang option -m[no-]lam-bh (PR #113632)

2024-10-24 Thread Lu Weining via cfe-commits
https://github.com/SixWeining closed https://github.com/llvm/llvm-project/pull/113632 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [LoongArch] fix description of clang option -m[no-]lam-bh (PR #113632)

2024-10-24 Thread Lu Weining via cfe-commits
https://github.com/SixWeining approved this pull request. https://github.com/llvm/llvm-project/pull/113632 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [LoongArch][Clang] Make the parameters and return value of {x,}vshuf.b builtins `signed char` vectors (PR #114512)

2024-11-03 Thread Lu Weining via cfe-commits
https://github.com/SixWeining closed https://github.com/llvm/llvm-project/pull/114512 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [LoongArch][Clang] Make the parameters and return value of {x,}vshuf.b builtins `signed char` vectors (PR #114512)

2024-11-03 Thread Lu Weining via cfe-commits
https://github.com/SixWeining approved this pull request. https://github.com/llvm/llvm-project/pull/114512 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [LoongArch][Clang] Make the parameters and return value of {x,}vxor.v builti ns `unsigned char` vectors (PR #114513)

2024-11-04 Thread Lu Weining via cfe-commits
https://github.com/SixWeining approved this pull request. LGTM. Thanks. https://github.com/llvm/llvm-project/pull/114513 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [LoongArch][Clang] Make the parameters and return value of {x,}vxor.v builti ns `unsigned char` vectors (PR #114513)

2024-11-04 Thread Lu Weining via cfe-commits
https://github.com/SixWeining closed https://github.com/llvm/llvm-project/pull/114513 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

  1   2   >