[clang] [llvm] riscv: Support -mstack-protector-guard=tls (PR #108942)

2024-10-02 Thread via cfe-commits
github-actions[bot] wrote: @keith-packard Congratulations on having your first Pull Request (PR) merged into the LLVM Project! Your changes will be combined with recent changes from other authors, then tested by our [build bots](https://lab.llvm.org/buildbot/). If there is a problem with a

[clang] [llvm] riscv: Support -mstack-protector-guard=tls (PR #108942)

2024-10-02 Thread Craig Topper via cfe-commits
https://github.com/topperc closed https://github.com/llvm/llvm-project/pull/108942 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] riscv: Support -mstack-protector-guard=tls (PR #108942)

2024-10-02 Thread Keith Packard via cfe-commits
keith-packard wrote: > LGTM. I assume you need someone to push it? Yes please! The PowerPC one is waiting in the wings :-) https://github.com/llvm/llvm-project/pull/108942 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/

[clang] [llvm] riscv: Support -mstack-protector-guard=tls (PR #108942)

2024-10-02 Thread Craig Topper via cfe-commits
https://github.com/topperc approved this pull request. LGTM. I assume you need someone to push it? https://github.com/llvm/llvm-project/pull/108942 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/

[clang] [llvm] riscv: Support -mstack-protector-guard=tls (PR #108942)

2024-10-02 Thread Keith Packard via cfe-commits
keith-packard wrote: I've retitled the commit messages to match llvm conventions and added a clean-up to replace another instance of `getParent()->getParent()` with `getModule()`. https://github.com/llvm/llvm-project/pull/108942 ___ cfe-commits maili

[clang] [llvm] riscv: Support -mstack-protector-guard=tls (PR #108942)

2024-10-02 Thread Keith Packard via cfe-commits
https://github.com/keith-packard updated https://github.com/llvm/llvm-project/pull/108942 >From f91cf985d10a07af617b6098f50d023108d060a4 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Wed, 2 Oct 2024 12:37:30 -0700 Subject: [PATCH 1/5] [RISCV][ISelLowering] Use getModule() instead of getPa

[clang] [llvm] riscv: Support -mstack-protector-guard=tls (PR #108942)

2024-10-02 Thread Keith Packard via cfe-commits
https://github.com/keith-packard updated https://github.com/llvm/llvm-project/pull/108942 >From 1ca3c96bc0e07a2fdae982736017f1d31147e4e4 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Mon, 16 Sep 2024 15:41:38 +0200 Subject: [PATCH 1/4] riscv: Support -mstack-protector-guard=tls Add suppor

[clang] [llvm] riscv: Support -mstack-protector-guard=tls (PR #108942)

2024-09-23 Thread Keith Packard via cfe-commits
@@ -0,0 +1,47 @@ +; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 5 +; RUN: llc -mtriple=riscv64-unknown-elf -verify-machineinstrs < %s \ +; RUN: | FileCheck %s + +define void @foo(i64 %t) sspstrong { keith-pa

[clang] [llvm] riscv: Support -mstack-protector-guard=tls (PR #108942)

2024-09-23 Thread Keith Packard via cfe-commits
https://github.com/keith-packard updated https://github.com/llvm/llvm-project/pull/108942 >From 156b989feea26694b291cde9be637947be9aca67 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Mon, 16 Sep 2024 15:41:38 +0200 Subject: [PATCH 1/4] riscv: Support -mstack-protector-guard=tls Add suppor

[clang] [llvm] riscv: Support -mstack-protector-guard=tls (PR #108942)

2024-09-23 Thread Keith Packard via cfe-commits
https://github.com/keith-packard updated https://github.com/llvm/llvm-project/pull/108942 >From 156b989feea26694b291cde9be637947be9aca67 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Mon, 16 Sep 2024 15:41:38 +0200 Subject: [PATCH 1/4] riscv: Support -mstack-protector-guard=tls Add suppor

[clang] [llvm] riscv: Support -mstack-protector-guard=tls (PR #108942)

2024-09-23 Thread Jessica Clarke via cfe-commits
@@ -0,0 +1,47 @@ +; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 5 +; RUN: llc -mtriple=riscv64-unknown-elf -verify-machineinstrs < %s \ +; RUN: | FileCheck %s + +define void @foo(i64 %t) sspstrong { jrtc27 w

[clang] [llvm] riscv: Support -mstack-protector-guard=tls (PR #108942)

2024-09-23 Thread Keith Packard via cfe-commits
@@ -0,0 +1,47 @@ +; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 5 +; RUN: llc -mtriple=riscv64-unknown-elf -verify-machineinstrs < %s \ +; RUN: | FileCheck %s + +define void @foo(i64 %t) sspstrong { keith-pa

[clang] [llvm] riscv: Support -mstack-protector-guard=tls (PR #108942)

2024-09-23 Thread Keith Packard via cfe-commits
@@ -0,0 +1,47 @@ +; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 5 +; RUN: llc -mtriple=riscv64-unknown-elf -verify-machineinstrs < %s \ keith-packard wrote: I kinda wondered -- the existing tests are all over t

[clang] [llvm] riscv: Support -mstack-protector-guard=tls (PR #108942)

2024-09-23 Thread Keith Packard via cfe-commits
keith-packard wrote: yup, all fixes mirrored over there. Thanks for your careful review! https://github.com/llvm/llvm-project/pull/108942 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/

[clang] [llvm] riscv: Support -mstack-protector-guard=tls (PR #108942)

2024-09-23 Thread Keith Packard via cfe-commits
@@ -0,0 +1,50 @@ +; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 5 +; RUN: llc -verify-machineinstrs < %s | \ +; RUN: FileCheck %s + +target triple = "riscv64-unknown-linux-gnu" + +define dso_local void @foo(i64 %t) local_unnamed

[clang] [llvm] riscv: Support -mstack-protector-guard=tls (PR #108942)

2024-09-23 Thread Keith Packard via cfe-commits
https://github.com/keith-packard updated https://github.com/llvm/llvm-project/pull/108942 >From 156b989feea26694b291cde9be637947be9aca67 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Mon, 16 Sep 2024 15:41:38 +0200 Subject: [PATCH 1/4] riscv: Support -mstack-protector-guard=tls Add suppor

[clang] [llvm] riscv: Support -mstack-protector-guard=tls (PR #108942)

2024-09-23 Thread Keith Packard via cfe-commits
@@ -0,0 +1,50 @@ +; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 5 +; RUN: llc -verify-machineinstrs < %s | \ +; RUN: FileCheck %s + +target triple = "riscv64-unknown-linux-gnu" + +define dso_local void @foo(i64 %t) local_unnamed

[clang] [llvm] riscv: Support -mstack-protector-guard=tls (PR #108942)

2024-09-23 Thread Jessica Clarke via cfe-commits
@@ -0,0 +1,47 @@ +; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 5 +; RUN: llc -mtriple=riscv64-unknown-elf -verify-machineinstrs < %s \ +; RUN: | FileCheck %s + +define void @foo(i64 %t) sspstrong { jrtc27 w

[clang] [llvm] riscv: Support -mstack-protector-guard=tls (PR #108942)

2024-09-23 Thread Jessica Clarke via cfe-commits
@@ -0,0 +1,47 @@ +; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 5 +; RUN: llc -mtriple=riscv64-unknown-elf -verify-machineinstrs < %s \ jrtc27 wrote: This was previously linux-gnu not elf. If it works fine with

[clang] [llvm] riscv: Support -mstack-protector-guard=tls (PR #108942)

2024-09-23 Thread Jessica Clarke via cfe-commits
@@ -23,3 +26,9 @@ void bar(int x) { // AARCH64: [[ATTR1]] = !{i32 1, !"stack-protector-guard", !"sysreg"} // AARCH64: [[ATTR2]] = !{i32 1, !"stack-protector-guard-reg", !"sp_el0"} // AARCH64: [[ATTR3]] = !{i32 1, !"stack-protector-guard-offset", i32 1024} + +// RISCV: !llvm.mod

[clang] [llvm] riscv: Support -mstack-protector-guard=tls (PR #108942)

2024-09-23 Thread Keith Packard via cfe-commits
@@ -0,0 +1,50 @@ +; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 5 +; RUN: llc -verify-machineinstrs < %s | \ +; RUN: FileCheck %s keith-packard wrote: Thanks. After moving the triple into the RUN line, it's lon

[clang] [llvm] riscv: Support -mstack-protector-guard=tls (PR #108942)

2024-09-23 Thread Keith Packard via cfe-commits
https://github.com/keith-packard updated https://github.com/llvm/llvm-project/pull/108942 >From 156b989feea26694b291cde9be637947be9aca67 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Mon, 16 Sep 2024 15:41:38 +0200 Subject: [PATCH 1/4] riscv: Support -mstack-protector-guard=tls Add suppor

[clang] [llvm] riscv: Support -mstack-protector-guard=tls (PR #108942)

2024-09-23 Thread Keith Packard via cfe-commits
https://github.com/keith-packard updated https://github.com/llvm/llvm-project/pull/108942 >From 156b989feea26694b291cde9be637947be9aca67 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Mon, 16 Sep 2024 15:41:38 +0200 Subject: [PATCH 1/4] riscv: Support -mstack-protector-guard=tls Add suppor

[clang] [llvm] riscv: Support -mstack-protector-guard=tls (PR #108942)

2024-09-23 Thread Keith Packard via cfe-commits
@@ -0,0 +1,50 @@ +; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 5 +; RUN: llc -verify-machineinstrs < %s | \ +; RUN: FileCheck %s + +target triple = "riscv64-unknown-linux-gnu" + +define dso_local void @foo(i64 %t) local_unnamed

[clang] [llvm] riscv: Support -mstack-protector-guard=tls (PR #108942)

2024-09-23 Thread Keith Packard via cfe-commits
@@ -0,0 +1,50 @@ +; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 5 +; RUN: llc -verify-machineinstrs < %s | \ +; RUN: FileCheck %s + +target triple = "riscv64-unknown-linux-gnu" keith-packard wrote: sorry, copie

[clang] [llvm] riscv: Support -mstack-protector-guard=tls (PR #108942)

2024-09-23 Thread Jessica Clarke via cfe-commits
jrtc27 wrote: Same comments as -global https://github.com/llvm/llvm-project/pull/108942 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] riscv: Support -mstack-protector-guard=tls (PR #108942)

2024-09-23 Thread Jessica Clarke via cfe-commits
@@ -0,0 +1,50 @@ +; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 5 +; RUN: llc -verify-machineinstrs < %s | \ +; RUN: FileCheck %s + +target triple = "riscv64-unknown-linux-gnu" + +define dso_local void @foo(i64 %t) local_unnamed

[clang] [llvm] riscv: Support -mstack-protector-guard=tls (PR #108942)

2024-09-23 Thread Jessica Clarke via cfe-commits
@@ -0,0 +1,50 @@ +; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 5 +; RUN: llc -verify-machineinstrs < %s | \ +; RUN: FileCheck %s + +target triple = "riscv64-unknown-linux-gnu" + +define dso_local void @foo(i64 %t) local_unnamed

[clang] [llvm] riscv: Support -mstack-protector-guard=tls (PR #108942)

2024-09-23 Thread Jessica Clarke via cfe-commits
@@ -0,0 +1,50 @@ +; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 5 +; RUN: llc -verify-machineinstrs < %s | \ +; RUN: FileCheck %s jrtc27 wrote: The line above isn't (currently) long enough to warrant wrapping,

[clang] [llvm] riscv: Support -mstack-protector-guard=tls (PR #108942)

2024-09-23 Thread Jessica Clarke via cfe-commits
@@ -0,0 +1,50 @@ +; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 5 +; RUN: llc -verify-machineinstrs < %s | \ +; RUN: FileCheck %s + +target triple = "riscv64-unknown-linux-gnu" + +define dso_local void @foo(i64 %t) local_unnamed

[clang] [llvm] riscv: Support -mstack-protector-guard=tls (PR #108942)

2024-09-23 Thread Jessica Clarke via cfe-commits
@@ -0,0 +1,50 @@ +; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 5 +; RUN: llc -verify-machineinstrs < %s | \ +; RUN: FileCheck %s + +target triple = "riscv64-unknown-linux-gnu" jrtc27 wrote: Convention is to pu

[clang] [llvm] riscv: Support -mstack-protector-guard=tls (PR #108942)

2024-09-23 Thread Keith Packard via cfe-commits
keith-packard wrote: > LGTM Thanks so much for all the review and help here; really appreciate it. https://github.com/llvm/llvm-project/pull/108942 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo

[clang] [llvm] riscv: Support -mstack-protector-guard=tls (PR #108942)

2024-09-23 Thread Keith Packard via cfe-commits
@@ -3644,13 +3645,28 @@ static void RenderSSPOptions(const Driver &D, const ToolChain &TC, << A->getOption().getName() << Value << "sysreg global"; return; } +if (EffectiveTriple.isRISCV()) { + if (Value != "tls" && Value != "global") { ---

[clang] [llvm] riscv: Support -mstack-protector-guard=tls (PR #108942)

2024-09-23 Thread Keith Packard via cfe-commits
https://github.com/keith-packard updated https://github.com/llvm/llvm-project/pull/108942 >From 156b989feea26694b291cde9be637947be9aca67 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Mon, 16 Sep 2024 15:41:38 +0200 Subject: [PATCH 1/4] riscv: Support -mstack-protector-guard=tls Add suppor

[clang] [llvm] riscv: Support -mstack-protector-guard=tls (PR #108942)

2024-09-23 Thread Craig Topper via cfe-commits
https://github.com/topperc approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/108942 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] riscv: Support -mstack-protector-guard=tls (PR #108942)

2024-09-23 Thread Keith Packard via cfe-commits
@@ -21228,6 +21228,14 @@ Value *RISCVTargetLowering::getIRStackGuard(IRBuilderBase &IRB) const { if (Subtarget.isTargetAndroid()) return useTpOffset(IRB, -0x18); + Module *M = IRB.GetInsertBlock()->getParent()->getParent(); keith-packard wrote: Yup, g

[clang] [llvm] riscv: Support -mstack-protector-guard=tls (PR #108942)

2024-09-23 Thread Keith Packard via cfe-commits
https://github.com/keith-packard updated https://github.com/llvm/llvm-project/pull/108942 >From 156b989feea26694b291cde9be637947be9aca67 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Mon, 16 Sep 2024 15:41:38 +0200 Subject: [PATCH 1/3] riscv: Support -mstack-protector-guard=tls Add suppor

[clang] [llvm] riscv: Support -mstack-protector-guard=tls (PR #108942)

2024-09-23 Thread Keith Packard via cfe-commits
@@ -21228,6 +21228,14 @@ Value *RISCVTargetLowering::getIRStackGuard(IRBuilderBase &IRB) const { if (Subtarget.isTargetAndroid()) return useTpOffset(IRB, -0x18); + Module *M = IRB.GetInsertBlock()->getParent()->getParent(); keith-packard wrote: Thanks

[clang] [llvm] riscv: Support -mstack-protector-guard=tls (PR #108942)

2024-09-23 Thread Keith Packard via cfe-commits
https://github.com/keith-packard edited https://github.com/llvm/llvm-project/pull/108942 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] riscv: Support -mstack-protector-guard=tls (PR #108942)

2024-09-23 Thread Craig Topper via cfe-commits
@@ -21228,6 +21228,14 @@ Value *RISCVTargetLowering::getIRStackGuard(IRBuilderBase &IRB) const { if (Subtarget.isTargetAndroid()) return useTpOffset(IRB, -0x18); + Module *M = IRB.GetInsertBlock()->getParent()->getParent(); topperc wrote: I think `get

[clang] [llvm] riscv: Support -mstack-protector-guard=tls (PR #108942)

2024-09-22 Thread Keith Packard via cfe-commits
https://github.com/keith-packard updated https://github.com/llvm/llvm-project/pull/108942 >From 60ad4f7793701bc50d1c65db4fe665558678fd7b Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Mon, 16 Sep 2024 15:41:38 +0200 Subject: [PATCH 1/3] riscv: Support -mstack-protector-guard=tls Add suppor

[clang] [llvm] riscv: Support -mstack-protector-guard=tls (PR #108942)

2024-09-22 Thread Keith Packard via cfe-commits
@@ -3644,13 +3645,28 @@ static void RenderSSPOptions(const Driver &D, const ToolChain &TC, << A->getOption().getName() << Value << "sysreg global"; return; } +if (EffectiveTriple.isRISCV()) { + if (Value != "tls" && Value != "global") { ---

[clang] [llvm] riscv: Support -mstack-protector-guard=tls (PR #108942)

2024-09-22 Thread Keith Packard via cfe-commits
@@ -3681,6 +3698,11 @@ static void RenderSSPOptions(const Driver &D, const ToolChain &TC, D.Diag(diag::err_drv_invalid_value) << A->getOption().getName() << Value; return; } +if (EffectiveTriple.isRISCV() && Value != "tp") { + D.Diag(diag::err_drv_inva

[clang] [llvm] riscv: Support -mstack-protector-guard=tls (PR #108942)

2024-09-22 Thread Keith Packard via cfe-commits
https://github.com/keith-packard updated https://github.com/llvm/llvm-project/pull/108942 >From a295c6d8057ddd712097e3bf659cdbe3bb4ec869 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Mon, 16 Sep 2024 15:41:38 +0200 Subject: [PATCH 1/3] riscv: Support -mstack-protector-guard=tls Add suppor

[clang] [llvm] riscv: Support -mstack-protector-guard=tls (PR #108942)

2024-09-22 Thread Keith Packard via cfe-commits
@@ -0,0 +1,19 @@ +; RUN: llc -mtriple=riscv64-unknown-elf < %s | \ keith-packard wrote: Thanks. I wondered how that was supposed to work. https://github.com/llvm/llvm-project/pull/108942 ___ cfe-commits mailing list cf

[clang] [llvm] riscv: Support -mstack-protector-guard=tls (PR #108942)

2024-09-20 Thread Alexander Richardson via cfe-commits
@@ -3644,13 +3645,28 @@ static void RenderSSPOptions(const Driver &D, const ToolChain &TC, << A->getOption().getName() << Value << "sysreg global"; return; } +if (EffectiveTriple.isRISCV()) { + if (Value != "tls" && Value != "global") { ---

[clang] [llvm] riscv: Support -mstack-protector-guard=tls (PR #108942)

2024-09-20 Thread Alexander Richardson via cfe-commits
https://github.com/arichardson edited https://github.com/llvm/llvm-project/pull/108942 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] riscv: Support -mstack-protector-guard=tls (PR #108942)

2024-09-20 Thread Alexander Richardson via cfe-commits
https://github.com/arichardson edited https://github.com/llvm/llvm-project/pull/108942 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] riscv: Support -mstack-protector-guard=tls (PR #108942)

2024-09-19 Thread Craig Topper via cfe-commits
@@ -3644,13 +3645,28 @@ static void RenderSSPOptions(const Driver &D, const ToolChain &TC, << A->getOption().getName() << Value << "sysreg global"; return; } +if (EffectiveTriple.isRISCV()) { + if (Value != "tls" && Value != "global") { ---

[clang] [llvm] riscv: Support -mstack-protector-guard=tls (PR #108942)

2024-09-19 Thread Craig Topper via cfe-commits
@@ -3681,6 +3698,11 @@ static void RenderSSPOptions(const Driver &D, const ToolChain &TC, D.Diag(diag::err_drv_invalid_value) << A->getOption().getName() << Value; return; } +if (EffectiveTriple.isRISCV() && Value != "tp") { + D.Diag(diag::err_drv_inva

[clang] [llvm] riscv: Support -mstack-protector-guard=tls (PR #108942)

2024-09-19 Thread Craig Topper via cfe-commits
@@ -0,0 +1,19 @@ +; RUN: llc -mtriple=riscv64-unknown-elf < %s | \ topperc wrote: Use `llvm/utils/update_llc_test_checks.py` to generate the checks. https://github.com/llvm/llvm-project/pull/108942 ___ cfe-commits mail

[clang] [llvm] riscv: Support -mstack-protector-guard=tls (PR #108942)

2024-09-19 Thread Keith Packard via cfe-commits
@@ -3664,12 +3680,18 @@ static void RenderSSPOptions(const Driver &D, const ToolChain &TC, << A->getOption().getName() << Value; return; } +if (EffectiveTriple.isRISCV() && (Offset <= -2048 || Offset >= 2048)) { keith-packard wrote: Do

[clang] [llvm] riscv: Support -mstack-protector-guard=tls (PR #108942)

2024-09-19 Thread Keith Packard via cfe-commits
@@ -3644,13 +3645,28 @@ static void RenderSSPOptions(const Driver &D, const ToolChain &TC, << A->getOption().getName() << Value << "sysreg global"; return; } +if (EffectiveTriple.isRISCV()) { + if (Value != "tls" && Value != "global") { +D.

[clang] [llvm] riscv: Support -mstack-protector-guard=tls (PR #108942)

2024-09-19 Thread Keith Packard via cfe-commits
@@ -3644,13 +3645,28 @@ static void RenderSSPOptions(const Driver &D, const ToolChain &TC, << A->getOption().getName() << Value << "sysreg global"; return; } +if (EffectiveTriple.isRISCV()) { + if (Value != "tls" && Value != "global") { ---

[clang] [llvm] riscv: Support -mstack-protector-guard=tls (PR #108942)

2024-09-19 Thread Craig Topper via cfe-commits
@@ -3664,12 +3680,18 @@ static void RenderSSPOptions(const Driver &D, const ToolChain &TC, << A->getOption().getName() << Value; return; } +if (EffectiveTriple.isRISCV() && (Offset <= -2048 || Offset >= 2048)) { topperc wrote: Ok. If t

[clang] [llvm] riscv: Support -mstack-protector-guard=tls (PR #108942)

2024-09-19 Thread Keith Packard via cfe-commits
https://github.com/keith-packard updated https://github.com/llvm/llvm-project/pull/108942 >From a295c6d8057ddd712097e3bf659cdbe3bb4ec869 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Mon, 16 Sep 2024 15:41:38 +0200 Subject: [PATCH 1/3] riscv: Support -mstack-protector-guard=tls Add suppor

[clang] [llvm] riscv: Support -mstack-protector-guard=tls (PR #108942)

2024-09-18 Thread Keith Packard via cfe-commits
@@ -3664,12 +3680,18 @@ static void RenderSSPOptions(const Driver &D, const ToolChain &TC, << A->getOption().getName() << Value; return; } +if (EffectiveTriple.isRISCV() && (Offset <= -2048 || Offset >= 2048)) { keith-packard wrote: Ye

[clang] [llvm] riscv: Support -mstack-protector-guard=tls (PR #108942)

2024-09-18 Thread Keith Packard via cfe-commits
https://github.com/keith-packard edited https://github.com/llvm/llvm-project/pull/108942 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] riscv: Support -mstack-protector-guard=tls (PR #108942)

2024-09-17 Thread Alexander Richardson via cfe-commits
@@ -3664,12 +3680,18 @@ static void RenderSSPOptions(const Driver &D, const ToolChain &TC, << A->getOption().getName() << Value; return; } +if (EffectiveTriple.isRISCV() && (Offset <= -2048 || Offset >= 2048)) { arichardson wrote: Shou

[clang] [llvm] riscv: Support -mstack-protector-guard=tls (PR #108942)

2024-09-17 Thread Alexander Richardson via cfe-commits
@@ -3644,13 +3645,28 @@ static void RenderSSPOptions(const Driver &D, const ToolChain &TC, << A->getOption().getName() << Value << "sysreg global"; return; } +if (EffectiveTriple.isRISCV()) { + if (Value != "tls" && Value != "global") { ---

[clang] [llvm] riscv: Support -mstack-protector-guard=tls (PR #108942)

2024-09-17 Thread Craig Topper via cfe-commits
@@ -3644,13 +3645,28 @@ static void RenderSSPOptions(const Driver &D, const ToolChain &TC, << A->getOption().getName() << Value << "sysreg global"; return; } +if (EffectiveTriple.isRISCV()) { + if (Value != "tls" && Value != "global") { ---

[clang] [llvm] riscv: Support -mstack-protector-guard=tls (PR #108942)

2024-09-17 Thread Craig Topper via cfe-commits
@@ -3664,12 +3680,18 @@ static void RenderSSPOptions(const Driver &D, const ToolChain &TC, << A->getOption().getName() << Value; return; } +if (EffectiveTriple.isRISCV() && (Offset <= -2048 || Offset >= 2048)) { topperc wrote: I don't

[clang] [llvm] riscv: Support -mstack-protector-guard=tls (PR #108942)

2024-09-17 Thread Craig Topper via cfe-commits
@@ -3644,13 +3645,28 @@ static void RenderSSPOptions(const Driver &D, const ToolChain &TC, << A->getOption().getName() << Value << "sysreg global"; return; } +if (EffectiveTriple.isRISCV()) { + if (Value != "tls" && Value != "global") { +D.

[clang] [llvm] riscv: Support -mstack-protector-guard=tls (PR #108942)

2024-09-17 Thread Craig Topper via cfe-commits
topperc wrote: > offsetfor offset for https://github.com/llvm/llvm-project/pull/108942 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] riscv: Support -mstack-protector-guard=tls (PR #108942)

2024-09-17 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-driver Author: Keith Packard (keith-packard) Changes Add support for using a thread-local variable with a specified offsetfor holding the stack guard canary value. --- Full diff: https://github.com/llvm/llvm-project/pull/108942.diff 5 Files Aff

[clang] [llvm] riscv: Support -mstack-protector-guard=tls (PR #108942)

2024-09-17 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Keith Packard (keith-packard) Changes Add support for using a thread-local variable with a specified offsetfor holding the stack guard canary value. --- Full diff: https://github.com/llvm/llvm-project/pull/108942.diff 5 Files Affected:

[clang] [llvm] riscv: Support -mstack-protector-guard=tls (PR #108942)

2024-09-17 Thread Keith Packard via cfe-commits
https://github.com/keith-packard created https://github.com/llvm/llvm-project/pull/108942 Add support for using a thread-local variable with a specified offsetfor holding the stack guard canary value. >From 7822a1ee2eed923a3014577668bdd8f1c8145d4c Mon Sep 17 00:00:00 2001 From: Keith Packard