[clang] [Driver] Test ignored target-specific options for AMDGPU/NVPTX (PR #79222)

2024-01-23 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay created https://github.com/llvm/llvm-project/pull/79222 Fix missing test coverage after #70740 #70760 >From 3a2b2a1110e7b3348a12a6476ab014a469891062 Mon Sep 17 00:00:00 2001 From: Fangrui Song Date: Tue, 23 Jan 2024 15:13:49 -0800 Subject: [PATCH]

[lldb] [libclc] [libc] [clang] [compiler-rt] [mlir] [flang] [clang-tools-extra] [libcxx] [lld] [llvm] [libcxxabi] [ELF] Add internal InputFile (PR #78944)

2024-01-23 Thread Fangrui Song via cfe-commits
MaskRay wrote: Hi, do you have more information (like a reproduce tarball) about a `file` that references a file of `InternalKind`? Could it be a patch in your downstream? If `file` references a file of `InternalKind`, we probably should make it `nullptr`

[flang] [clang] [compiler-rt] [llvm] [libcxx] [openmp] [mlir] [libc] [clang-tools-extra] [lld] [ELF] --save-temps --lto-emit-asm: derive ELF/asm file names from bitcode file names (PR #78835)

2024-01-23 Thread Fangrui Song via cfe-commits
MaskRay wrote: > We're seeing a test failure on our buildbot after this patch landed. Could > you take a look? > > [lab.llvm.org/buildbot/#/builders/216/builds/33382/steps/7/logs/FAIL__lld__defsym_ll](https://lab.llvm.org/buildbot/#/builders/216/builds/33382/steps/7/logs/FAIL__lld__defsym_ll)

[compiler-rt] [openmp] [libc] [libcxx] [flang] [mlir] [llvm] [clang] [clang-tools-extra] [lld] [ELF] --save-temps --lto-emit-asm: derive ELF/asm file names from bitcode file names (PR #78835)

2024-01-23 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay closed https://github.com/llvm/llvm-project/pull/78835 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libcxx] [flang] [lld] [clang-tools-extra] [mlir] [openmp] [compiler-rt] [llvm] [libc] [ELF] --save-temps --lto-emit-asm: derive ELF/asm file names from bitcode file names (PR #78835)

2024-01-23 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay updated https://github.com/llvm/llvm-project/pull/78835 >From 37b3ff263f2b46bd4541157bee5b5e1bf2639604 Mon Sep 17 00:00:00 2001 From: Fangrui Song Date: Sat, 20 Jan 2024 00:40:53 -0800 Subject: [PATCH] =?UTF-8?q?[=F0=9D=98=80=F0=9D=97=BD=F0=9D=97=BF]=20initia?=

[clang-tools-extra] [libcxx] [llvm] [openmp] [mlir] [compiler-rt] [flang] [clang] [libc] [lld] [ELF] --save-temps --lto-emit-asm: derive ELF/asm file names from bitcode file names (PR #78835)

2024-01-23 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay edited https://github.com/llvm/llvm-project/pull/78835 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[libcxx] [libc] [clang] [lld] [clang-tools-extra] [flang] [compiler-rt] [llvm] [ELF] --save-temps --lto-emit-asm: derive ELF/asm file names from bitcode file names (PR #78835)

2024-01-23 Thread Fangrui Song via cfe-commits
@@ -46,8 +46,9 @@ class BitcodeCompiler { private: std::unique_ptr ltoObj; - std::vector> buf; + SmallVector>, 0> buf; MaskRay wrote: Added a comment https://github.com/llvm/llvm-project/pull/78835 ___

[compiler-rt] [clang] [libc] [libcxx] [lld] [clang-tools-extra] [llvm] [flang] [ELF] --save-temps --lto-emit-asm: derive ELF/asm file names from bitcode file names (PR #78835)

2024-01-23 Thread Fangrui Song via cfe-commits
@@ -352,32 +357,49 @@ std::vector BitcodeCompiler::compile() { pruneCache(config->thinLTOCacheDir, config->thinLTOCachePolicy, files); if (!config->ltoObjPath.empty()) { -saveBuffer(buf[0], config->ltoObjPath); +saveBuffer(buf[0].second, config->ltoObjPath);

[compiler-rt] [clang] [libc] [libcxx] [lld] [clang-tools-extra] [llvm] [flang] [ELF] --save-temps --lto-emit-asm: derive ELF/asm file names from bitcode file names (PR #78835)

2024-01-23 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay updated https://github.com/llvm/llvm-project/pull/78835 >From 37b3ff263f2b46bd4541157bee5b5e1bf2639604 Mon Sep 17 00:00:00 2001 From: Fangrui Song Date: Sat, 20 Jan 2024 00:40:53 -0800 Subject: [PATCH] =?UTF-8?q?[=F0=9D=98=80=F0=9D=97=BD=F0=9D=97=BF]=20initia?=

[lld] [clang-tools-extra] [llvm] [clang] [ELF] --save-temps --lto-emit-asm: derive ELF/asm file names from bitcode file names (PR #78835)

2024-01-23 Thread Fangrui Song via cfe-commits
@@ -53,10 +53,10 @@ ; RUN: rm -fr cache && mkdir cache ; RUN: ld.lld --thinlto-cache-dir=cache --save-temps -o out b.bc a.bc -M | FileCheck %s --check-prefix=MAP -; RUN: ls out1.lto.o a.bc.0.preopt.bc b.bc.0.preopt.bc +; RUN: ls out.lto.a.o a.bc.0.preopt.bc b.bc.0.preopt.bc

[clang] [llvm] [lld] [clang-tools-extra] [ELF] --save-temps --lto-emit-asm: derive ELF/asm file names from bitcode file names (PR #78835)

2024-01-22 Thread Fangrui Song via cfe-commits
@@ -352,32 +357,49 @@ std::vector BitcodeCompiler::compile() { pruneCache(config->thinLTOCacheDir, config->thinLTOCachePolicy, files); if (!config->ltoObjPath.empty()) { -saveBuffer(buf[0], config->ltoObjPath); +saveBuffer(buf[0].second, config->ltoObjPath);

[clang-tools-extra] [llvm] [lld] [clang] [ELF] --save-temps --lto-emit-asm: derive ELF/asm file names from bitcode file names (PR #78835)

2024-01-22 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay updated https://github.com/llvm/llvm-project/pull/78835 >From 37b3ff263f2b46bd4541157bee5b5e1bf2639604 Mon Sep 17 00:00:00 2001 From: Fangrui Song Date: Sat, 20 Jan 2024 00:40:53 -0800 Subject: [PATCH] =?UTF-8?q?[=F0=9D=98=80=F0=9D=97=BD=F0=9D=97=BF]=20initia?=

[clang] [clang-tools-extra] [llvm] [lld] [ELF] --save-temps --lto-emit-asm: derive ELF/asm file names from bitcode file names (PR #78835)

2024-01-22 Thread Fangrui Song via cfe-commits
@@ -61,10 +61,11 @@ # RUN: ld.lld --no-fortran-common -o 11 main.o --start-lib 1.o strong_data_only.o --end-lib # RUN: llvm-readobj --syms 11 | FileCheck --check-prefix=NFC %s -# RUN: ld.lld -o - main.o 4.a --fortran-common --lto-emit-asm | FileCheck --check-prefix=ASM %s

[clang] [llvm] [libunwind] [compiler-rt] [libc] [flang] [lld] [libcxx] [lldb] [libclc] [clang-tools-extra] [libcxxabi] [RISCV] Support Global Dynamic TLSDESC in the RISC-V backend (PR #66915)

2024-01-22 Thread Fangrui Song via cfe-commits
MaskRay wrote: This PR needs a rebase.. There are quite a few merge commits. Hmm, I don't know how to squash the changes to rebase them to latest main branch. `git rebase --keep-base -i main` has quite a few merge conflicts. (My lld change

[clang-tools-extra] [libclc] [compiler-rt] [lldb] [libcxxabi] [libunwind] [llvm] [libcxx] [lld] [flang] [libc] [clang] [RISCV] Support Global Dynamic TLSDESC in the RISC-V backend (PR #66915)

2024-01-22 Thread Fangrui Song via cfe-commits
@@ -89,8 +89,8 @@ RISCVTargetLowering::RISCVTargetLowering(const TargetMachine , if ((ABI == RISCVABI::ABI_ILP32F || ABI == RISCVABI::ABI_LP64F) && !Subtarget.hasStdExtF()) { errs() << "Hard-float 'f' ABI can't be used for a target that " -"doesn't

[clang] [libunwind] [libc] [libcxx] [clang-tools-extra] [lld] [lldb] [libclc] [flang] [llvm] [libcxxabi] [compiler-rt] [RISCV] Support Global Dynamic TLSDESC in the RISC-V backend (PR #66915)

2024-01-22 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay edited https://github.com/llvm/llvm-project/pull/66915 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [FatLTO] output of -ffat-lto-objects -S should be assembly. (PR #79041)

2024-01-22 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay approved this pull request. https://github.com/llvm/llvm-project/pull/79041 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[flang] [clang-tools-extra] [libc] [compiler-rt] [lldb] [libcxx] [libcxxabi] [lld] [clang] [libclc] [llvm] [Thumb,ELF] Fix access to dso_preemptable __stack_chk_guard with static relocation model (PR

2024-01-22 Thread Fangrui Song via cfe-commits
MaskRay wrote: > (the commit message seems odd; intentional?) Hopefully clarified:) https://github.com/llvm/llvm-project/pull/78950 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[flang] [clang-tools-extra] [libc] [compiler-rt] [lldb] [libcxx] [libcxxabi] [lld] [clang] [libclc] [llvm] [Thumb,ELF] Fix access to dso_preemptable __stack_chk_guard with static relocation model (PR

2024-01-22 Thread Fangrui Song via cfe-commits
@@ -135,14 +135,15 @@ void Thumb1InstrInfo::loadRegFromStackSlot(MachineBasicBlock , void Thumb1InstrInfo::expandLoadStackGuard( MachineBasicBlock::iterator MI) const { MachineFunction = *MI->getParent()->getParent(); - const TargetMachine = MF.getTarget(); const

[flang] [clang-tools-extra] [libc] [compiler-rt] [lldb] [libcxx] [libcxxabi] [lld] [clang] [libclc] [llvm] [Thumb,ELF] Fix access to dso_preemptable __stack_chk_guard with static relocation model (PR

2024-01-22 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay updated https://github.com/llvm/llvm-project/pull/78950 >From 2ce57488682873d2dc005144db57fbb555f29d8a Mon Sep 17 00:00:00 2001 From: Fangrui Song Date: Mon, 22 Jan 2024 00:29:09 -0800 Subject: [PATCH] =?UTF-8?q?[=F0=9D=98=80=F0=9D=97=BD=F0=9D=97=BF]=20initia?=

[libc] [libcxxabi] [libcxx] [lld] [flang] [libclc] [clang] [compiler-rt] [clang-tools-extra] [lldb] [llvm] [Thumb,ELF] Fix access to dso_preemptable __stack_chk_guard with static relocation model (PR

2024-01-22 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay edited https://github.com/llvm/llvm-project/pull/78950 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][driver] Add -mtls-dialect option (PR #79031)

2024-01-22 Thread Fangrui Song via cfe-commits
@@ -401,6 +401,8 @@ static bool initTargetOptions(DiagnosticsEngine , Options.UniqueBasicBlockSectionNames = CodeGenOpts.UniqueBasicBlockSectionNames; Options.TLSSize = CodeGenOpts.TLSSize; + // TODO: Add correct codegen options in LLVM + // Options.TLSDesc =

[clang] [clang][driver] Add -mtls-dialect option (PR #79031)

2024-01-22 Thread Fangrui Song via cfe-commits
@@ -72,6 +72,11 @@ class CodeGenOptions : public CodeGenOptionsBase { LocalExecTLSModel }; + enum TLSDialect { MaskRay wrote: Prefer enum class (I think it has been more popular in other parts of Clang, perhaps CodeGen/Sema).

[compiler-rt] [lldb] [libc] [libcxx] [flang] [libcxxabi] [clang] [libclc] [lld] [mlir] [clang-tools-extra] [llvm] [ELF] Add internal InputFile (PR #78944)

2024-01-22 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay closed https://github.com/llvm/llvm-project/pull/78944 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[compiler-rt] [lldb] [libc] [libcxx] [flang] [libcxxabi] [clang] [libclc] [lld] [mlir] [clang-tools-extra] [llvm] [ELF] Add internal InputFile (PR #78944)

2024-01-22 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay updated https://github.com/llvm/llvm-project/pull/78944 >From a72bbb3ae04c7be90af36d2cd025329d4ef2ab16 Mon Sep 17 00:00:00 2001 From: Fangrui Song Date: Sun, 21 Jan 2024 22:18:48 -0800 Subject: [PATCH] =?UTF-8?q?[=F0=9D=98=80=F0=9D=97=BD=F0=9D=97=BF]=20initia?=

[llvm] [libc] [clang] [libcxx] [libclc] [compiler-rt] [clang-tools-extra] [flang] [asan,test] Make alloca_loop_unpoisoning.cpp robust and fix s390x failure (PR #78774)

2024-01-22 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay closed https://github.com/llvm/llvm-project/pull/78774 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[compiler-rt] [libc] [libcxx] [flang] [clang] [libclc] [clang-tools-extra] [llvm] [asan,test] Make alloca_loop_unpoisoning.cpp robust and fix s390x failure (PR #78774)

2024-01-22 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay updated https://github.com/llvm/llvm-project/pull/78774 >From 3833b05746922726eb5a8b512a8a9f5caf7a96c5 Mon Sep 17 00:00:00 2001 From: Fangrui Song Date: Fri, 19 Jan 2024 12:11:20 -0800 Subject: [PATCH] =?UTF-8?q?[=F0=9D=98=80=F0=9D=97=BD=F0=9D=97=BF]=20initia?=

[clang] [clang][modules] Print library module manifest path. (PR #76451)

2024-01-21 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay approved this pull request. LGTM with a few nits. Can you double check modules.json is inside `lib/` (`usr/lib/x86_64-linux-gnu{{/|\\}}modules.json`) instead of some directory under `include`? https://github.com/llvm/llvm-project/pull/76451

[clang] [clang][modules] Print library module manifest path. (PR #76451)

2024-01-21 Thread Fangrui Song via cfe-commits
@@ -6135,6 +6141,45 @@ std::string Driver::GetProgramPath(StringRef Name, const ToolChain ) const { return std::string(Name); } +std::string Driver::GetStdModuleManifestPath(const Compilation , + const ToolChain ) const { +

[clang] [clang][modules] Print library module manifest path. (PR #76451)

2024-01-21 Thread Fangrui Song via cfe-commits
@@ -602,6 +602,16 @@ class Driver { // FIXME: This should be in CompilationInfo. std::string GetProgramPath(StringRef Name, const ToolChain ) const; + /// GetModuleManifestPath - Lookup the name of the Standard library manifest. + /// + /// \param C - The compilation.

[llvm] [clang] [MTE] Disable all MTE protection of globals in sections (PR #78443)

2024-01-21 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay approved this pull request. https://github.com/llvm/llvm-project/pull/78443 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Sema] Add `-fvisibility-global-new-delete=` option (PR #75364)

2024-01-21 Thread Fangrui Song via cfe-commits
MaskRay wrote: > I rebased the changes onto the latest main to resolve the merge conflicts - > these were just textual not semantic. You may like getcord/spr :) https://maskray.me/blog/2023-09-09-reflections-on-llvm-switch-to-github-pull-requests#my-workflow

[clang] [Sema] Add `-fvisibility-global-new-delete=` option (PR #75364)

2024-01-21 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay approved this pull request. https://github.com/llvm/llvm-project/pull/75364 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [clang-tools-extra] [msan] Unpoison indirect outputs for userspace when -msan-handle-asm-conservative is specified (PR #77393)

2024-01-19 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay closed https://github.com/llvm/llvm-project/pull/77393 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [clang-tools-extra] [msan] Unpoison indirect outputs for userspace when -msan-handle-asm-conservative is specified (PR #77393)

2024-01-19 Thread Fangrui Song via cfe-commits
@@ -4557,7 +4561,13 @@ struct MemorySanitizerVisitor : public InstVisitor { return; Value *SizeVal = IRB.CreateTypeSize(MS.IntptrTy, DL.getTypeStoreSize(ElemTy)); -IRB.CreateCall(MS.MsanInstrumentAsmStoreFn, {Operand, SizeVal}); +if (MS.CompileKernel)

[clang-tools-extra] [clang] [llvm] [msan] Unpoison indirect outputs for userspace when -msan-handle-asm-conservative is specified (PR #77393)

2024-01-19 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay updated https://github.com/llvm/llvm-project/pull/77393 >From 93ab63157297553fa678752995773db8b14642fe Mon Sep 17 00:00:00 2001 From: Fangrui Song Date: Mon, 8 Jan 2024 15:22:21 -0800 Subject: [PATCH] =?UTF-8?q?[=F0=9D=98=80=F0=9D=97=BD=F0=9D=97=BF]=20initia?=

[clang] [Sema] Provide `-fvisibility-global-new-delete=` option (PR #75364)

2024-01-19 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay approved this pull request. Consider adding a note to clang/docs/ReleaseNotes.rst. With a few nits this LGTM. https://github.com/llvm/llvm-project/pull/75364 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [Sema] Provide `-fvisibility-global-new-delete=` option (PR #75364)

2024-01-19 Thread Fangrui Song via cfe-commits
@@ -3864,9 +3864,16 @@ def fvisibility_ms_compat : Flag<["-"], "fvisibility-ms-compat">, Group HelpText<"Give global types 'default' visibility and global functions and " "variables 'hidden' visibility by default">; def fvisibility_global_new_delete_hidden :

[clang] [Sema] Provide `-fvisibility-global-new-delete=` option (PR #75364)

2024-01-19 Thread Fangrui Song via cfe-commits
@@ -0,0 +1,14 @@ +// RUN: %clang_cc1 %s -std=c++11 -triple x86_64-unknown-unknown -fvisibility=hidden -emit-llvm -o - | FileCheck %s -DLINKAGE=dso_local +// RUN: %clang_cc1 %s -std=c++11 -triple x86_64-unknown-unknown -fvisibility=default

[clang] [Sema] Provide `-fvisibility-global-new-delete=` option (PR #75364)

2024-01-19 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay edited https://github.com/llvm/llvm-project/pull/75364 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Sema] Provide `-fvisibility-global-new-delete=` option (PR #75364)

2024-01-19 Thread Fangrui Song via cfe-commits
@@ -0,0 +1,52 @@ +/// Check driver handling for "-fvisibility-global-new-delete-hidden" and "-fvisibility-global-new-delete=". + +/// These options are not added by default. +// RUN: %clang -### -target x86_64-unknown-unknown -x cl -c -emit-llvm %s 2>&1 | \

[clang] [llvm] [RISCV] Relax march string order constraint (PR #78120)

2024-01-19 Thread Fangrui Song via cfe-commits
@@ -337,10 +319,79 @@ TEST(ParseArchString, AcceptsUnderscoreSplittingExtensions) { } } +TEST(ParseArchString, AcceptsRelaxSingleLetterExtensions) { + for (StringRef Input : + {"rv32imfad", "rv32im_fa_d", "rv32im2p0fad", "rv32i2p1m2p0fad"}) { +auto MaybeISAInfo

[clang] [llvm] [RISCV] Relax march string order constraint (PR #78120)

2024-01-19 Thread Fangrui Song via cfe-commits
MaskRay wrote: > Address the > https://github.com/riscv-non-isa/riscv-toolchain-conventions/pull/14 > > This patch relax the -march string for accept any order. Perhaps: Follow https://github.com/riscv-non-isa/riscv-toolchain-conventions/pull/14 by dropping the order requirement of `-march`.

[clang] [llvm] [RISCV] Relax march string order constraint (PR #78120)

2024-01-19 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay approved this pull request. GCC patch has just landed: https://gcc.gnu.org/pipermail/gcc-patches/2024-January/643411.html https://github.com/llvm/llvm-project/pull/78120 ___ cfe-commits mailing list

[llvm] [clang] [RISCV] Relax march string order constraint (PR #78120)

2024-01-19 Thread Fangrui Song via cfe-commits
@@ -785,153 +878,61 @@ RISCVISAInfo::parseArchString(StringRef Arch, bool EnableExperimentalExtension, Minor = Version->Minor; } -ISAInfo->addExtension(StringRef(, 1), {Major, Minor}); +// Postpone AddExtension until end of this function +

[clang] [llvm] [RISCV] Relax march string order constraint (PR #78120)

2024-01-19 Thread Fangrui Song via cfe-commits
@@ -156,9 +156,8 @@ // RUN: -fsyntax-only 2>&1 | FileCheck -check-prefix=RV32L %s // RV32L: error: invalid arch name 'rv32l' -// RUN: not %clang --target=riscv32-unknown-elf -march=rv32imadf -### %s \ -// RUN: -fsyntax-only 2>&1 | FileCheck -check-prefix=RV32IMADF %s -//

[compiler-rt] [mlir] [libcxx] [llvm] [clang] [asan] Enable StackSafetyAnalysis by default (PR #77210)

2024-01-19 Thread Fangrui Song via cfe-commits
MaskRay wrote: @uweigand Thanks for the analysis. `bot = alloca(i);` is a dynamic alloca that cannot be optimized out. It triggers `FunctionStackPoisoner::createDynamicAllocasInitStorage`, which creates an alloca of 32-byte alignment. In x86-64, aarch64, riscv, and others, the alloca

[compiler-rt] [libcxx] [clang] [mlir] [llvm] [asan] Enable StackSafetyAnalysis by default (PR #77210)

2024-01-19 Thread Fangrui Song via cfe-commits
MaskRay wrote: > @MaskRay can you help address [#77210 > (comment)](https://github.com/llvm/llvm-project/pull/77210#issuecomment-1893860870) > , test cases are failing on LoZ buildbot. Thanks The test (from https://reviews.llvm.org/D7098) is about the interaction of VLA and alloca

[compiler-rt] [clang-tools-extra] [clang] [llvm] Make clang report invalid target versions for all environment types. (PR #78655)

2024-01-18 Thread Fangrui Song via cfe-commits
@@ -1,7 +1,7 @@ // RUN: %clang -x c -ffixed-point -S -emit-llvm -o - %s | FileCheck %s -// RUN: %clang -x c -ffixed-point -S -emit-llvm -o - --target=x86_64-scei-ps4-ubuntu-fast %s | FileCheck %s MaskRay wrote: @pogo59

[clang] [Driver,sanitizer] Remove RequiresPIE and msan's NeedPIE setting (PR #77689)

2024-01-18 Thread Fangrui Song via cfe-commits
MaskRay wrote: > > > @MaskRay I see that in > > > [3bbc912](https://github.com/llvm/llvm-project/commit/3bbc912d37f03d9ad3be330b81d91c2eaf6c37f2) > > > you removed some tests that fail because of this change. Why do you > > > think that is an appropriate solution? I have some other tests in a

[clang] [llvm] [PowerPC][X86] Make cpu id builtins target independent and lower for PPC (PR #68919)

2024-01-18 Thread Fangrui Song via cfe-commits
@@ -359,6 +359,13 @@ class LLVM_LIBRARY_VISIBILITY PPCTargetInfo : public TargetInfo { bool isSPRegName(StringRef RegName) const override { return RegName.equals("r1") || RegName.equals("x1"); } + + // We support __builtin_cpu_supports/__builtin_cpu_is on targets

[clang] [Driver,sanitizer] Remove RequiresPIE and msan's NeedPIE setting (PR #77689)

2024-01-18 Thread Fangrui Song via cfe-commits
MaskRay wrote: > @MaskRay I see that in > [3bbc912](https://github.com/llvm/llvm-project/commit/3bbc912d37f03d9ad3be330b81d91c2eaf6c37f2) > you removed some tests that fail because of this change. Why do you think > that is an appropriate solution? I have some other tests in a downstream >

[clang] [clang][modules] Print library module manifest path. (PR #76451)

2024-01-18 Thread Fangrui Song via cfe-commits
@@ -0,0 +1,15 @@ +// Test that -print-library-module-manifest-path finds the correct file. + +// RUN: %clang -print-library-module-manifest-path \ MaskRay wrote: A lot of new options do support only the `--` form. For `--print-*` options, many support both `-`

[clang] [clang][modules] Print library module manifest path. (PR #76451)

2024-01-18 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay edited https://github.com/llvm/llvm-project/pull/76451 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][modules] Print library module manifest path. (PR #76451)

2024-01-18 Thread Fangrui Song via cfe-commits
@@ -0,0 +1,40 @@ +// Test that -print-library-module-manifest-path finds the correct file. MaskRay wrote: Is the `cxx23-` prefix useful? https://github.com/llvm/llvm-project/pull/76451 ___ cfe-commits mailing list

[clang] [clang][modules] Print library module manifest path. (PR #76451)

2024-01-18 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay edited https://github.com/llvm/llvm-project/pull/76451 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][modules] Print library module manifest path. (PR #76451)

2024-01-18 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay edited https://github.com/llvm/llvm-project/pull/76451 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][modules] Print library module manifest path. (PR #76451)

2024-01-18 Thread Fangrui Song via cfe-commits
@@ -0,0 +1,40 @@ +// Test that -print-library-module-manifest-path finds the correct file. + +// RUN: rm -rf %t +// RUN: mkdir -p %t +// RUN: touch %t/libc++.so +// RUN: split-file %s %t +// RUN: cd %t + +// RUN: %clang -print-library-module-manifest-path \ +// RUN:

[clang] [clang][modules] Print library module manifest path. (PR #76451)

2024-01-18 Thread Fangrui Song via cfe-commits
@@ -6135,6 +6141,42 @@ std::string Driver::GetProgramPath(StringRef Name, const ToolChain ) const { return std::string(Name); } +std::string Driver::GetStdModuleManifestPath(const Compilation , + const ToolChain ) const { + +

[clang] [clang][modules] Print library module manifest path. (PR #76451)

2024-01-18 Thread Fangrui Song via cfe-commits
@@ -6135,6 +6141,42 @@ std::string Driver::GetProgramPath(StringRef Name, const ToolChain ) const { return std::string(Name); } +std::string Driver::GetStdModuleManifestPath(const Compilation , + const ToolChain ) const { +

[clang] [clang][modules] Print library module manifest path. (PR #76451)

2024-01-18 Thread Fangrui Song via cfe-commits
@@ -602,6 +602,17 @@ class Driver { // FIXME: This should be in CompilationInfo. std::string GetProgramPath(StringRef Name, const ToolChain ) const; + /// GetStdModuleManifestPath - Lookup the path to the Standard library module MaskRay wrote: Remove

[clang] [clang][modules] Print library module manifest path. (PR #76451)

2024-01-18 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay requested changes to this pull request. https://github.com/llvm/llvm-project/pull/76451 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][modules] Print library module manifest path. (PR #76451)

2024-01-18 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay edited https://github.com/llvm/llvm-project/pull/76451 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][modules] Print library module manifest path. (PR #76451)

2024-01-18 Thread Fangrui Song via cfe-commits
@@ -0,0 +1,40 @@ +// Test that -print-library-module-manifest-path finds the correct file. + +// RUN: rm -rf %t +// RUN: mkdir -p %t +// RUN: touch %t/libc++.so +// RUN: split-file %s %t +// RUN: cd %t + +// RUN: %clang -print-library-module-manifest-path \ +// RUN:

[clang] [clang][modules] Print library module manifest path. (PR #76451)

2024-01-18 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay edited https://github.com/llvm/llvm-project/pull/76451 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][modules] Print library module manifest path. (PR #76451)

2024-01-18 Thread Fangrui Song via cfe-commits
@@ -0,0 +1,40 @@ +// Test that -print-library-module-manifest-path finds the correct file. + +// RUN: rm -rf %t MaskRay wrote: You can remove `mkdir -p %t` and simplify this to `rm -rf %t && split-file %s %t && cd %t`. This does place 3 commands on one line,

[clang] [libcxx] [mlir] [llvm] [compiler-rt] [sanitizer] Skip /include/c++/ from summary (PR #78534)

2024-01-17 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay approved this pull request. https://github.com/llvm/llvm-project/pull/78534 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libcxx] [mlir] [llvm] [compiler-rt] [sanitizer] Skip /include/c++/ from summary (PR #78534)

2024-01-17 Thread Fangrui Song via cfe-commits
MaskRay wrote: > std:: usually is not a cause of the bug. Consider elaborating this message. We now display `SUMMARY: AddressSanitizer: allocation-size-too-big path/to/allocator_returns_null.cpp:92:7 in main` instead of `SUMMARY: AddressSanitizer: allocation-size-too-big

[clang] [Driver] Add -fandroid-pad-segment/-fno-android-pad-segment (PR #75652)

2024-01-17 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay closed https://github.com/llvm/llvm-project/pull/75652 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[compiler-rt] [clang] [llvm] [X86] Support "f16c" and "avx512fp16" for __builtin_cpu_supports (PR #78384)

2024-01-17 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay approved this pull request. https://github.com/llvm/llvm-project/pull/78384 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[llvm] [clang] [compiler-rt] [X86] Support "f16c" and "avx512fp16" for __builtin_cpu_supports (PR #78384)

2024-01-17 Thread Fangrui Song via cfe-commits
@@ -80,17 +80,17 @@ OutOfLineDefs::foo(int, int, int) { // LINUX: define dso_local noundef i32 @_ZN13OutOfLineDefs3fooEiii.S // LINUX: define dso_local noundef i32 @_ZN13OutOfLineDefs3fooEiii.R // LINUX: define weak_odr ptr @_ZN13OutOfLineDefs3fooEiii.resolver() -// LINUX: ret

[clang-tools-extra] [clang] [llvm] [Driver] Add -fandroid-pad-segment/-fno-android-pad-segment (PR #77244)

2024-01-17 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay closed https://github.com/llvm/llvm-project/pull/77244 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] Hurd: Add x86_64 support (PR #78065)

2024-01-17 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay closed https://github.com/llvm/llvm-project/pull/78065 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang] [llvm] [Driver] Add -fandroid-pad-segment/-fno-android-pad-segment (PR #77244)

2024-01-17 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay updated https://github.com/llvm/llvm-project/pull/77244 >From f4758993998e221cc41924d8ec9feb70f759937a Mon Sep 17 00:00:00 2001 From: Fangrui Song Date: Sun, 7 Jan 2024 09:47:53 -0800 Subject: [PATCH] =?UTF-8?q?[=F0=9D=98=80=F0=9D=97=BD=F0=9D=97=BF]=20initia?=

[clang-tools-extra] [lld] [llvm] [lld/ELF] Hint if R_X86_64_PC32 overflows and references a SHF_X86_64_LARGE section (PR #73045)

2024-01-17 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay edited https://github.com/llvm/llvm-project/pull/73045 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [lld] [llvm] [lld/ELF] Hint if R_X86_64_PC32 overflows and references a SHF_X86_64_LARGE section (PR #73045)

2024-01-17 Thread Fangrui Song via cfe-commits
@@ -105,6 +105,13 @@ void elf::reportRangeError(uint8_t *loc, const Relocation , const Twine , hint = "; references '" + lld::toString(*rel.sym) + '\''; else if (auto *d = dyn_cast(rel.sym)) hint = ("; references section '" + d->section->name + "'").str(); + +

[clang-tools-extra] [llvm] [lld] [lld/ELF] Hint if R_X86_64_PC32 overflows and references a SHF_X86_64_LARGE section (PR #73045)

2024-01-17 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay approved this pull request. https://github.com/llvm/llvm-project/pull/73045 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [Clang] Update Unicode version to 15.1 (PR #77147)

2024-01-17 Thread Fangrui Song via cfe-commits
MaskRay wrote: Nice! I wonder whether there is any documentation/procedure notes to facilitate future updates, like: what files need to be updated? https://github.com/llvm/llvm-project/pull/77147 ___ cfe-commits mailing list

[llvm] [libcxx] [compiler-rt] [clang-tools-extra] [flang] [lld] [mlir] [libc] [clang] [lldb] [X86] Add "Ws" constraint and "p" modifier for symbolic address/label reference (PR #77886)

2024-01-16 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay edited https://github.com/llvm/llvm-project/pull/77886 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[llvm] [libcxx] [compiler-rt] [clang-tools-extra] [flang] [lld] [mlir] [libc] [clang] [lldb] [X86] Add "Ws" constraint and "p" modifier for symbolic address/label reference (PR #77886)

2024-01-16 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay closed https://github.com/llvm/llvm-project/pull/77886 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[libc] [clang] [compiler-rt] [clang-tools-extra] [libcxxabi] [flang] [lldb] [lld] [llvm] [libcxx] [RISCV] Support Global Dynamic TLSDESC in the RISC-V backend (PR #66915)

2024-01-16 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay edited https://github.com/llvm/llvm-project/pull/66915 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[libcxx] [clang-tools-extra] [libcxxabi] [compiler-rt] [clang] [lldb] [lld] [flang] [llvm] [libc] [RISCV] Support Global Dynamic TLSDESC in the RISC-V backend (PR #66915)

2024-01-16 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay approved this pull request. LGTM once the TLSDESC option is moved to use llvm/lib/CodeGen/CommandFlags.cpp It's worth giving others some time to respond. https://github.com/llvm/llvm-project/pull/66915 ___ cfe-commits

[libc] [clang] [compiler-rt] [clang-tools-extra] [libcxxabi] [flang] [lldb] [lld] [llvm] [libcxx] [RISCV] Support Global Dynamic TLSDESC in the RISC-V backend (PR #66915)

2024-01-16 Thread Fangrui Song via cfe-commits
@@ -80,6 +80,11 @@ static cl::opt EnableRISCVDeadRegisterElimination( " them with stores to x0"), cl::init(true)); +// TODO: This should be controlled by -mtls-dialect= +cl::opt EnableRISCVTLSDESC("riscv-enable-tlsdesc", MaskRay wrote: We

[libunwind] [libunwind][WebAssembly] Fix libunwind.cpp guard (PR #78230)

2024-01-16 Thread Fangrui Song via cfe-commits
MaskRay wrote: > This should have been &&, meaning neither SjLj nor Wasm uses this file. Thanks for the description. In the future, it'd be better to reference what PR this PR fixes. https://github.com/llvm/llvm-project/pull/78230 ___ cfe-commits

[clang] [llvm] [clang][Driver] Don't ignore -gmodules .gch files (PR #77711)

2024-01-15 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay approved this pull request. https://github.com/llvm/llvm-project/pull/77711 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CLANG][NFC] Modify test cases to suit assigned default sysroot path (PR #77075)

2024-01-15 Thread Fangrui Song via cfe-commits
MaskRay wrote: > @MaskRay Wasn't it you that mentioned this? Yes. I hoped that we could deprecated `DEFAULT_SYSROOT`: https://reviews.llvm.org/D158218 , but the relative `DEFAULT_SYSROOT` does not have a good replacement. https://github.com/llvm/llvm-project/pull/77075

[clang] [llvm] Hurd: Add x86_64 support (PR #78065)

2024-01-15 Thread Fangrui Song via cfe-commits
MaskRay wrote: > > Could you add some descriptions? > > What kind of description, where? The commit message/first comment. Currently it's "No description provided." https://github.com/llvm/llvm-project/pull/78065 ___ cfe-commits mailing list

[clang] [llvm] Hurd: Add x86_64 support (PR #78065)

2024-01-15 Thread Fangrui Song via cfe-commits
@@ -2652,6 +2652,31 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes( return; } + if (TargetTriple.isOSHurd()) { +static const char *const X86_64HurdTriples[] = {"x86_64-gnu"}; MaskRay wrote: No. It's for `-m32`/`-m64`

[llvm] [clang] Hurd: Add x86_64 support (PR #78065)

2024-01-14 Thread Fangrui Song via cfe-commits
MaskRay wrote: Thanks for the patch. It's in a very good shape and I did not need to make many nitpicky comments like I had to do for other "support a new target triple" driver patch:) Could you add some descriptions? https://github.com/llvm/llvm-project/pull/78065

[llvm] [clang] Hurd: Add x86_64 support (PR #78065)

2024-01-14 Thread Fangrui Song via cfe-commits
@@ -78,3 +78,82 @@ // CHECK-CROSS: "{{.*}}/Inputs/basic_cross_hurd_tree/usr/lib/gcc/i686-gnu/10/../../../../i686-gnu/bin/ld" {{.*}} "-m" "elf_i386" // CHECK-CROSS: "{{.*}}/Inputs/basic_cross_hurd_tree/usr/lib/gcc/i686-gnu/10/crtbegin.o" // CHECK-CROSS:

[llvm] [clang] Hurd: Add x86_64 support (PR #78065)

2024-01-14 Thread Fangrui Song via cfe-commits
@@ -2,8 +2,8 @@ // RUN: %clang -### %s --target=i686-pc-hurd-gnu --sysroot=%S/Inputs/basic_hurd_tree \ // RUN: --stdlib=platform 2>&1 | FileCheck --check-prefix=CHECK %s -// CHECK: "-cc1" -// CHECK: "-isysroot" "[[SYSROOT:[^"]+]]" +// CHECK: "-cc1" +// CHECK:

[clang] [llvm] Hurd: Add x86_64 support (PR #78065)

2024-01-14 Thread Fangrui Song via cfe-commits
@@ -29,9 +29,9 @@ // RUN: %clang -### %s --target=i686-pc-hurd-gnu --sysroot=%S/Inputs/basic_hurd_tree \ // RUN: --stdlib=platform -static 2>&1 | FileCheck --check-prefix=CHECK-STATIC %s -// CHECK-STATIC: "-cc1" -// CHECK-STATIC: "-static-define" -// CHECK-STATIC:

[llvm] [clang] Hurd: Add x86_64 support (PR #78065)

2024-01-14 Thread Fangrui Song via cfe-commits
@@ -78,3 +78,82 @@ // CHECK-CROSS: "{{.*}}/Inputs/basic_cross_hurd_tree/usr/lib/gcc/i686-gnu/10/../../../../i686-gnu/bin/ld" {{.*}} "-m" "elf_i386" // CHECK-CROSS: "{{.*}}/Inputs/basic_cross_hurd_tree/usr/lib/gcc/i686-gnu/10/crtbegin.o" // CHECK-CROSS:

[clang] [llvm] Hurd: Add x86_64 support (PR #78065)

2024-01-14 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay approved this pull request. https://github.com/llvm/llvm-project/pull/78065 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[llvm] [clang] Hurd: Add x86_64 support (PR #78065)

2024-01-14 Thread Fangrui Song via cfe-commits
@@ -57,9 +57,9 @@ // RUN: %clang -### %s --target=i686-pc-hurd-gnu --sysroot=%S/Inputs/basic_hurd_tree \ // RUN: -shared 2>&1 | FileCheck --check-prefix=CHECK-SHARED %s -// CHECK-SHARED: "{{.*}}ld" "--sysroot=[[SYSROOT:[^"]+]]" -// CHECK-SHARED:

[llvm] [clang] Hurd: Add x86_64 support (PR #78065)

2024-01-14 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay edited https://github.com/llvm/llvm-project/pull/78065 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] Hurd: Add x86_64 support (PR #78065)

2024-01-14 Thread Fangrui Song via cfe-commits
@@ -2652,6 +2652,31 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes( return; } + if (TargetTriple.isOSHurd()) { +static const char *const X86_64HurdTriples[] = {"x86_64-gnu"}; MaskRay wrote: Since there is just one,

[compiler-rt] [clang] [clang-tools-extra] [lldb] [libc] [lld] [flang] [llvm] [libcxx] [mlir] [X86] Add "Ws" constraint and "p" modifier for symbolic address/label reference (PR #77886)

2024-01-14 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay updated https://github.com/llvm/llvm-project/pull/77886 >From f5a33f9e6893250e3584a77630b771ee76693c20 Mon Sep 17 00:00:00 2001 From: Fangrui Song Date: Thu, 11 Jan 2024 23:42:38 -0800 Subject: [PATCH] =?UTF-8?q?[=F0=9D=98=80=F0=9D=97=BD=F0=9D=97=BF]=20initia?=

[compiler-rt] [clang] [clang-tools-extra] [lldb] [libc] [flang] [llvm] [libcxx] [mlir] [X86] Add "Ws" constraint and "p" modifier for symbolic address/label reference (PR #77886)

2024-01-14 Thread Fangrui Song via cfe-commits
@@ -130,3 +130,7 @@ void pr40890(void) { __asm__ __volatile__("\n#define BEEF abcd%0\n" : : "n"((int*)0xdeadbeef)); #endif } + +void test_W(int i) { + asm("" : : "Wd"(test_W)); // expected-error{{invalid input constraint 'Wd' in asm}} MaskRay wrote:

[libc] [lldb] [mlir] [clang-tools-extra] [flang] [clang] [llvm] [compiler-rt] [libcxx] [X86] Add "Ws" constraint and "p" modifier for symbolic address/label reference (PR #77886)

2024-01-14 Thread Fangrui Song via cfe-commits
@@ -1418,6 +1418,14 @@ bool X86TargetInfo::validateAsmConstraint( case 'O': Info.setRequiresImmediate(0, 127); return true; + case 'W': +switch (*++Name) { +default: + return false; +case 's': + Info.setAllowsRegister();

<    4   5   6   7   8   9   10   11   12   13   >