[llvm-branch-commits] [llvm] [clang] [clang] Function Multi Versioning supports IFunc lowerings on Darwin platforms (PR #73688)

2023-11-29 Thread Tom Honermann via llvm-branch-commits

tahonermann wrote:

I recommend extending testing via additional `RUN` lines to all of the 
following tests:
- `clang/test/CodeGen/attr-cpuspecific.c`
- `clang/test/CodeGen/attr-target-clones.c`
- `clang/test/CodeGen/attr-target-mv-func-ptrs.c`
- `clang/test/CodeGen/attr-target-mv-va-args.c` (already done)
- `clang/test/CodeGen/attr-target-mv.c`
- `clang/test/CodeGenCXX/attr-cpuspecific.cpp`
- `clang/test/CodeGenCXX/attr-target-mv-diff-ns.cpp`
- `clang/test/CodeGenCXX/attr-target-mv-inalloca.cpp`
- `clang/test/CodeGenCXX/attr-target-mv-member-funcs.cpp`
- `clang/test/CodeGenCXX/attr-target-mv-modules.cpp`
- `clang/test/CodeGenCXX/attr-target-mv-out-of-line-defs.cpp`
- `clang/test/CodeGenCXX/attr-target-mv-overloads.cpp`
- `clang/test/CodeGenCXX/attr-target-clones.cpp`

Note that, for many of the above tests, changes planned in #71706 will impact 
the expected behavior.

https://github.com/llvm/llvm-project/pull/73688
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [llvm] bbeb3be - x86 support

2023-11-29 Thread Jon Roelofs via llvm-branch-commits

Author: Jon Roelofs
Date: 2023-11-29T08:23:21-08:00
New Revision: bbeb3beaf37d91911a96a20bb1825fa16dcfc094

URL: 
https://github.com/llvm/llvm-project/commit/bbeb3beaf37d91911a96a20bb1825fa16dcfc094
DIFF: 
https://github.com/llvm/llvm-project/commit/bbeb3beaf37d91911a96a20bb1825fa16dcfc094.diff

LOG: x86 support

Created using spr 1.3.4

Added: 


Modified: 
llvm/lib/Target/AArch64/AArch64AsmPrinter.cpp
llvm/lib/Target/X86/X86AsmPrinter.cpp
llvm/test/CodeGen/X86/ifunc-asm.ll

Removed: 




diff  --git a/llvm/lib/Target/AArch64/AArch64AsmPrinter.cpp 
b/llvm/lib/Target/AArch64/AArch64AsmPrinter.cpp
index 26b3a14e22b2ad9..1b5b7c556c79f6b 100644
--- a/llvm/lib/Target/AArch64/AArch64AsmPrinter.cpp
+++ b/llvm/lib/Target/AArch64/AArch64AsmPrinter.cpp
@@ -1901,6 +1901,9 @@ void AArch64AsmPrinter::emitManualSymbolResolver(Module 
&M,
 
   OutStreamer->switchSection(OutContext.getObjectFileInfo()->getDataSection());
 
+  // _ifunc.lazy_pointer:
+  //   .quad _ifunc.stub_helper
+
   EmitLinkage(LazyPointer);
   OutStreamer->emitLabel(LazyPointer);
   emitVisibility(LazyPointer, GI.getVisibility());
@@ -1908,18 +1911,18 @@ void AArch64AsmPrinter::emitManualSymbolResolver(Module 
&M,
 
   OutStreamer->switchSection(OutContext.getObjectFileInfo()->getTextSection());
 
-  MCSymbol *Stub = getSymbol(&GI);
+  // _ifunc:
+  //   adrpx16, lazy_pointer@GOTPAGE
+  //   ldr x16, [x16, lazy_pointer@GOTPAGEOFF]
+  //   ldr x16, [x16]
+  //   br  x16
 
+  MCSymbol *Stub = getSymbol(&GI);
   EmitLinkage(Stub);
   OutStreamer->emitCodeAlignment(Align(4), STI);
   OutStreamer->emitLabel(Stub);
   emitVisibility(Stub, GI.getVisibility());
 
-  // adrp  x16, lazy_pointer@GOTPAGE
-  // ldr   x16, [x16, lazy_pointer@GOTPAGEOFF]
-  // ldr   x16, [x16]
-  // brx16
-
   {
 MCInst Adrp;
 Adrp.setOpcode(AArch64::ADRP);
@@ -1960,39 +1963,40 @@ void AArch64AsmPrinter::emitManualSymbolResolver(Module 
&M,
.addReg(AArch64::X16),
*STI);
 
+  // _ifunc.stub_helper:
+  //   stp fp, lr, [sp, #-16]
+  //   sub fp, sp, 16
+  //   stp x1, x0, [sp, #-32]
+  //   stp x3, x2, [sp, #-48]
+  //   stp x5, x4, [sp, #-64]
+  //   stp x7, x6, [sp, #-80]
+  //   stp d1, d0, [sp, #-96]
+  //   stp d3, d2, [sp, #-112]
+  //   stp d5, d4, [sp, #-128]
+  //   stp d7, d6, [sp, #-144]
+  //   sub sp, sp, 144
+  //   bl  _resolver
+  //   adrpx16, lazy_pointer@GOTPAGE
+  //   ldr x16, [x16, lazy_pointer@GOTPAGEOFF]
+  //   str x0, [x16]
+  //   mov x16, x0
+  //   add sp, sp, 144
+  //   ldp d7, d6, [sp, #-144]
+  //   ldp d5, d4, [sp, #-128]
+  //   ldp d3, d2, [sp, #-112]
+  //   ldp d1, d0, [sp, #-96]
+  //   ldp x7, x6, [sp, #-80]
+  //   ldp x5, x4, [sp, #-64]
+  //   ldp x3, x2, [sp, #-48]
+  //   ldp x1, x0, [sp, #-32]
+  //   ldp fp, lr, [sp, #-16]
+  //   br  x16
+
   EmitLinkage(StubHelper);
   OutStreamer->emitCodeAlignment(Align(4), STI);
   OutStreamer->emitLabel(StubHelper);
   emitVisibility(StubHelper, GI.getVisibility());
 
-  // stp   fp, lr, [sp, #-16]
-  // sub   fp, sp, 16
-  // stp   x1, x0, [sp, #-32]
-  // stp   x3, x2, [sp, #-48]
-  // stp   x5, x4, [sp, #-64]
-  // stp   x7, x6, [sp, #-80]
-  // stp   d1, d0, [sp, #-96]
-  // stp   d3, d2, [sp, #-112]
-  // stp   d5, d4, [sp, #-128]
-  // stp   d7, d6, [sp, #-144]
-  // sub   sp, sp, 144
-  // bl_resolver
-  // adrp  x16, lazy_pointer@GOTPAGE
-  // ldr   x16, [x16, lazy_pointer@GOTPAGEOFF]
-  // str   x0, [x16]
-  // mov   x16, x0
-  // add   sp, sp, 144
-  // ldp   d7, d6, [sp, #-144]
-  // ldp   d5, d4, [sp, #-128]
-  // ldp   d3, d2, [sp, #-112]
-  // ldp   d1, d0, [sp, #-96]
-  // ldp   x7, x6, [sp, #-80]
-  // ldp   x5, x4, [sp, #-64]
-  // ldp   x3, x2, [sp, #-48]
-  // ldp   x1, x0, [sp, #-32]
-  // ldp   fp, lr, [sp, #-16]
-  // brx16
-
   OutStreamer->emitInstruction(MCInstBuilder(AArch64::STPXi)
.addReg(AArch64::FP)
.addReg(AArch64::LR)

diff  --git a/llvm/lib/Target/X86/X86AsmPrinter.cpp 
b/llvm/lib/Target/X86/X86AsmPrinter.cpp
index 37158900d2404dd..b0f4b9d98437284 100644
--- a/llvm/lib/Target/X86/X86AsmPrinter.cpp
+++ b/llvm/lib/Target/X86/X86AsmPrinter.cpp
@@ -14,6 +14,7 @@
 #include "X86AsmPrinter.h"
 #include "MCTargetDesc/X86ATTInstPrinter.h"
 #include "MCTargetDesc/X86BaseInfo.h"
+#include "MCTargetDesc/X86MCTargetDesc.h"
 #include "MCTargetDesc/X86TargetStreamer.h"
 #include "TargetInfo/X86TargetInfo.h"
 #include "X86InstrInfo.h"
@@ -34,6 +35,7 @@
 #include "llvm/MC/MCCodeEmitter.h"
 #include "llvm/MC/MCContext.h"
 #include "llvm/MC/MCExpr.h"
+#include "llvm/MC/MCInst.h"
 #inc

[llvm-branch-commits] [llvm] 68e1755 - rebase

2023-11-29 Thread Jon Roelofs via llvm-branch-commits

Author: Jon Roelofs
Date: 2023-11-29T08:23:28-08:00
New Revision: 68e1755aef6ce4bf70d73f27ddabcebd8ced9804

URL: 
https://github.com/llvm/llvm-project/commit/68e1755aef6ce4bf70d73f27ddabcebd8ced9804
DIFF: 
https://github.com/llvm/llvm-project/commit/68e1755aef6ce4bf70d73f27ddabcebd8ced9804.diff

LOG: rebase

Created using spr 1.3.4

Added: 


Modified: 
llvm/lib/Target/AArch64/AArch64AsmPrinter.cpp
llvm/lib/Target/X86/X86AsmPrinter.cpp
llvm/test/CodeGen/X86/ifunc-asm.ll

Removed: 




diff  --git a/llvm/lib/Target/AArch64/AArch64AsmPrinter.cpp 
b/llvm/lib/Target/AArch64/AArch64AsmPrinter.cpp
index 26b3a14e22b2ad9..1b5b7c556c79f6b 100644
--- a/llvm/lib/Target/AArch64/AArch64AsmPrinter.cpp
+++ b/llvm/lib/Target/AArch64/AArch64AsmPrinter.cpp
@@ -1901,6 +1901,9 @@ void AArch64AsmPrinter::emitManualSymbolResolver(Module 
&M,
 
   OutStreamer->switchSection(OutContext.getObjectFileInfo()->getDataSection());
 
+  // _ifunc.lazy_pointer:
+  //   .quad _ifunc.stub_helper
+
   EmitLinkage(LazyPointer);
   OutStreamer->emitLabel(LazyPointer);
   emitVisibility(LazyPointer, GI.getVisibility());
@@ -1908,18 +1911,18 @@ void AArch64AsmPrinter::emitManualSymbolResolver(Module 
&M,
 
   OutStreamer->switchSection(OutContext.getObjectFileInfo()->getTextSection());
 
-  MCSymbol *Stub = getSymbol(&GI);
+  // _ifunc:
+  //   adrpx16, lazy_pointer@GOTPAGE
+  //   ldr x16, [x16, lazy_pointer@GOTPAGEOFF]
+  //   ldr x16, [x16]
+  //   br  x16
 
+  MCSymbol *Stub = getSymbol(&GI);
   EmitLinkage(Stub);
   OutStreamer->emitCodeAlignment(Align(4), STI);
   OutStreamer->emitLabel(Stub);
   emitVisibility(Stub, GI.getVisibility());
 
-  // adrp  x16, lazy_pointer@GOTPAGE
-  // ldr   x16, [x16, lazy_pointer@GOTPAGEOFF]
-  // ldr   x16, [x16]
-  // brx16
-
   {
 MCInst Adrp;
 Adrp.setOpcode(AArch64::ADRP);
@@ -1960,39 +1963,40 @@ void AArch64AsmPrinter::emitManualSymbolResolver(Module 
&M,
.addReg(AArch64::X16),
*STI);
 
+  // _ifunc.stub_helper:
+  //   stp fp, lr, [sp, #-16]
+  //   sub fp, sp, 16
+  //   stp x1, x0, [sp, #-32]
+  //   stp x3, x2, [sp, #-48]
+  //   stp x5, x4, [sp, #-64]
+  //   stp x7, x6, [sp, #-80]
+  //   stp d1, d0, [sp, #-96]
+  //   stp d3, d2, [sp, #-112]
+  //   stp d5, d4, [sp, #-128]
+  //   stp d7, d6, [sp, #-144]
+  //   sub sp, sp, 144
+  //   bl  _resolver
+  //   adrpx16, lazy_pointer@GOTPAGE
+  //   ldr x16, [x16, lazy_pointer@GOTPAGEOFF]
+  //   str x0, [x16]
+  //   mov x16, x0
+  //   add sp, sp, 144
+  //   ldp d7, d6, [sp, #-144]
+  //   ldp d5, d4, [sp, #-128]
+  //   ldp d3, d2, [sp, #-112]
+  //   ldp d1, d0, [sp, #-96]
+  //   ldp x7, x6, [sp, #-80]
+  //   ldp x5, x4, [sp, #-64]
+  //   ldp x3, x2, [sp, #-48]
+  //   ldp x1, x0, [sp, #-32]
+  //   ldp fp, lr, [sp, #-16]
+  //   br  x16
+
   EmitLinkage(StubHelper);
   OutStreamer->emitCodeAlignment(Align(4), STI);
   OutStreamer->emitLabel(StubHelper);
   emitVisibility(StubHelper, GI.getVisibility());
 
-  // stp   fp, lr, [sp, #-16]
-  // sub   fp, sp, 16
-  // stp   x1, x0, [sp, #-32]
-  // stp   x3, x2, [sp, #-48]
-  // stp   x5, x4, [sp, #-64]
-  // stp   x7, x6, [sp, #-80]
-  // stp   d1, d0, [sp, #-96]
-  // stp   d3, d2, [sp, #-112]
-  // stp   d5, d4, [sp, #-128]
-  // stp   d7, d6, [sp, #-144]
-  // sub   sp, sp, 144
-  // bl_resolver
-  // adrp  x16, lazy_pointer@GOTPAGE
-  // ldr   x16, [x16, lazy_pointer@GOTPAGEOFF]
-  // str   x0, [x16]
-  // mov   x16, x0
-  // add   sp, sp, 144
-  // ldp   d7, d6, [sp, #-144]
-  // ldp   d5, d4, [sp, #-128]
-  // ldp   d3, d2, [sp, #-112]
-  // ldp   d1, d0, [sp, #-96]
-  // ldp   x7, x6, [sp, #-80]
-  // ldp   x5, x4, [sp, #-64]
-  // ldp   x3, x2, [sp, #-48]
-  // ldp   x1, x0, [sp, #-32]
-  // ldp   fp, lr, [sp, #-16]
-  // brx16
-
   OutStreamer->emitInstruction(MCInstBuilder(AArch64::STPXi)
.addReg(AArch64::FP)
.addReg(AArch64::LR)

diff  --git a/llvm/lib/Target/X86/X86AsmPrinter.cpp 
b/llvm/lib/Target/X86/X86AsmPrinter.cpp
index 37158900d2404dd..b0f4b9d98437284 100644
--- a/llvm/lib/Target/X86/X86AsmPrinter.cpp
+++ b/llvm/lib/Target/X86/X86AsmPrinter.cpp
@@ -14,6 +14,7 @@
 #include "X86AsmPrinter.h"
 #include "MCTargetDesc/X86ATTInstPrinter.h"
 #include "MCTargetDesc/X86BaseInfo.h"
+#include "MCTargetDesc/X86MCTargetDesc.h"
 #include "MCTargetDesc/X86TargetStreamer.h"
 #include "TargetInfo/X86TargetInfo.h"
 #include "X86InstrInfo.h"
@@ -34,6 +35,7 @@
 #include "llvm/MC/MCCodeEmitter.h"
 #include "llvm/MC/MCContext.h"
 #include "llvm/MC/MCExpr.h"
+#include "llvm/MC/MCInst.h"
 #include 

[llvm-branch-commits] [llvm] 6205bfd - [𝘀𝗽𝗿] changes introduced through rebase

2023-11-29 Thread Jon Roelofs via llvm-branch-commits

Author: Jon Roelofs
Date: 2023-11-29T08:23:25-08:00
New Revision: 6205bfd3ab2c8d8ff0a5128a97c1b73d7967761c

URL: 
https://github.com/llvm/llvm-project/commit/6205bfd3ab2c8d8ff0a5128a97c1b73d7967761c
DIFF: 
https://github.com/llvm/llvm-project/commit/6205bfd3ab2c8d8ff0a5128a97c1b73d7967761c.diff

LOG: [𝘀𝗽𝗿] changes introduced through rebase

Created using spr 1.3.4

[skip ci]

Added: 


Modified: 
llvm/lib/Target/AArch64/AArch64AsmPrinter.cpp
llvm/lib/Target/X86/X86AsmPrinter.cpp
llvm/test/CodeGen/X86/ifunc-asm.ll

Removed: 




diff  --git a/llvm/lib/Target/AArch64/AArch64AsmPrinter.cpp 
b/llvm/lib/Target/AArch64/AArch64AsmPrinter.cpp
index 26b3a14e22b2ad9..1b5b7c556c79f6b 100644
--- a/llvm/lib/Target/AArch64/AArch64AsmPrinter.cpp
+++ b/llvm/lib/Target/AArch64/AArch64AsmPrinter.cpp
@@ -1901,6 +1901,9 @@ void AArch64AsmPrinter::emitManualSymbolResolver(Module 
&M,
 
   OutStreamer->switchSection(OutContext.getObjectFileInfo()->getDataSection());
 
+  // _ifunc.lazy_pointer:
+  //   .quad _ifunc.stub_helper
+
   EmitLinkage(LazyPointer);
   OutStreamer->emitLabel(LazyPointer);
   emitVisibility(LazyPointer, GI.getVisibility());
@@ -1908,18 +1911,18 @@ void AArch64AsmPrinter::emitManualSymbolResolver(Module 
&M,
 
   OutStreamer->switchSection(OutContext.getObjectFileInfo()->getTextSection());
 
-  MCSymbol *Stub = getSymbol(&GI);
+  // _ifunc:
+  //   adrpx16, lazy_pointer@GOTPAGE
+  //   ldr x16, [x16, lazy_pointer@GOTPAGEOFF]
+  //   ldr x16, [x16]
+  //   br  x16
 
+  MCSymbol *Stub = getSymbol(&GI);
   EmitLinkage(Stub);
   OutStreamer->emitCodeAlignment(Align(4), STI);
   OutStreamer->emitLabel(Stub);
   emitVisibility(Stub, GI.getVisibility());
 
-  // adrp  x16, lazy_pointer@GOTPAGE
-  // ldr   x16, [x16, lazy_pointer@GOTPAGEOFF]
-  // ldr   x16, [x16]
-  // brx16
-
   {
 MCInst Adrp;
 Adrp.setOpcode(AArch64::ADRP);
@@ -1960,39 +1963,40 @@ void AArch64AsmPrinter::emitManualSymbolResolver(Module 
&M,
.addReg(AArch64::X16),
*STI);
 
+  // _ifunc.stub_helper:
+  //   stp fp, lr, [sp, #-16]
+  //   sub fp, sp, 16
+  //   stp x1, x0, [sp, #-32]
+  //   stp x3, x2, [sp, #-48]
+  //   stp x5, x4, [sp, #-64]
+  //   stp x7, x6, [sp, #-80]
+  //   stp d1, d0, [sp, #-96]
+  //   stp d3, d2, [sp, #-112]
+  //   stp d5, d4, [sp, #-128]
+  //   stp d7, d6, [sp, #-144]
+  //   sub sp, sp, 144
+  //   bl  _resolver
+  //   adrpx16, lazy_pointer@GOTPAGE
+  //   ldr x16, [x16, lazy_pointer@GOTPAGEOFF]
+  //   str x0, [x16]
+  //   mov x16, x0
+  //   add sp, sp, 144
+  //   ldp d7, d6, [sp, #-144]
+  //   ldp d5, d4, [sp, #-128]
+  //   ldp d3, d2, [sp, #-112]
+  //   ldp d1, d0, [sp, #-96]
+  //   ldp x7, x6, [sp, #-80]
+  //   ldp x5, x4, [sp, #-64]
+  //   ldp x3, x2, [sp, #-48]
+  //   ldp x1, x0, [sp, #-32]
+  //   ldp fp, lr, [sp, #-16]
+  //   br  x16
+
   EmitLinkage(StubHelper);
   OutStreamer->emitCodeAlignment(Align(4), STI);
   OutStreamer->emitLabel(StubHelper);
   emitVisibility(StubHelper, GI.getVisibility());
 
-  // stp   fp, lr, [sp, #-16]
-  // sub   fp, sp, 16
-  // stp   x1, x0, [sp, #-32]
-  // stp   x3, x2, [sp, #-48]
-  // stp   x5, x4, [sp, #-64]
-  // stp   x7, x6, [sp, #-80]
-  // stp   d1, d0, [sp, #-96]
-  // stp   d3, d2, [sp, #-112]
-  // stp   d5, d4, [sp, #-128]
-  // stp   d7, d6, [sp, #-144]
-  // sub   sp, sp, 144
-  // bl_resolver
-  // adrp  x16, lazy_pointer@GOTPAGE
-  // ldr   x16, [x16, lazy_pointer@GOTPAGEOFF]
-  // str   x0, [x16]
-  // mov   x16, x0
-  // add   sp, sp, 144
-  // ldp   d7, d6, [sp, #-144]
-  // ldp   d5, d4, [sp, #-128]
-  // ldp   d3, d2, [sp, #-112]
-  // ldp   d1, d0, [sp, #-96]
-  // ldp   x7, x6, [sp, #-80]
-  // ldp   x5, x4, [sp, #-64]
-  // ldp   x3, x2, [sp, #-48]
-  // ldp   x1, x0, [sp, #-32]
-  // ldp   fp, lr, [sp, #-16]
-  // brx16
-
   OutStreamer->emitInstruction(MCInstBuilder(AArch64::STPXi)
.addReg(AArch64::FP)
.addReg(AArch64::LR)

diff  --git a/llvm/lib/Target/X86/X86AsmPrinter.cpp 
b/llvm/lib/Target/X86/X86AsmPrinter.cpp
index 37158900d2404dd..b0f4b9d98437284 100644
--- a/llvm/lib/Target/X86/X86AsmPrinter.cpp
+++ b/llvm/lib/Target/X86/X86AsmPrinter.cpp
@@ -14,6 +14,7 @@
 #include "X86AsmPrinter.h"
 #include "MCTargetDesc/X86ATTInstPrinter.h"
 #include "MCTargetDesc/X86BaseInfo.h"
+#include "MCTargetDesc/X86MCTargetDesc.h"
 #include "MCTargetDesc/X86TargetStreamer.h"
 #include "TargetInfo/X86TargetInfo.h"
 #include "X86InstrInfo.h"
@@ -34,6 +35,7 @@
 #include "llvm/MC/MCCodeEmitter.h"
 #include "llvm/MC/MCContext.h"
 #include "llvm/MC/MCExp

[llvm-branch-commits] [llvm] [clang] [clang] Support __attribute__((ifunc(...))) on Darwin platforms (PR #73687)

2023-11-29 Thread Jon Roelofs via llvm-branch-commits

https://github.com/jroelofs updated 
https://github.com/llvm/llvm-project/pull/73687


___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [llvm] e5f65ac - [𝘀𝗽𝗿] changes introduced through rebase

2023-11-29 Thread Jon Roelofs via llvm-branch-commits

Author: Jon Roelofs
Date: 2023-11-29T08:23:38-08:00
New Revision: e5f65ace88f017fad809e43f0146ddefc2d6160f

URL: 
https://github.com/llvm/llvm-project/commit/e5f65ace88f017fad809e43f0146ddefc2d6160f
DIFF: 
https://github.com/llvm/llvm-project/commit/e5f65ace88f017fad809e43f0146ddefc2d6160f.diff

LOG: [𝘀𝗽𝗿] changes introduced through rebase

Created using spr 1.3.4

[skip ci]

Added: 


Modified: 
llvm/lib/Target/AArch64/AArch64AsmPrinter.cpp
llvm/lib/Target/X86/X86AsmPrinter.cpp
llvm/test/CodeGen/X86/ifunc-asm.ll

Removed: 




diff  --git a/llvm/lib/Target/AArch64/AArch64AsmPrinter.cpp 
b/llvm/lib/Target/AArch64/AArch64AsmPrinter.cpp
index 26b3a14e22b2ad9..1b5b7c556c79f6b 100644
--- a/llvm/lib/Target/AArch64/AArch64AsmPrinter.cpp
+++ b/llvm/lib/Target/AArch64/AArch64AsmPrinter.cpp
@@ -1901,6 +1901,9 @@ void AArch64AsmPrinter::emitManualSymbolResolver(Module 
&M,
 
   OutStreamer->switchSection(OutContext.getObjectFileInfo()->getDataSection());
 
+  // _ifunc.lazy_pointer:
+  //   .quad _ifunc.stub_helper
+
   EmitLinkage(LazyPointer);
   OutStreamer->emitLabel(LazyPointer);
   emitVisibility(LazyPointer, GI.getVisibility());
@@ -1908,18 +1911,18 @@ void AArch64AsmPrinter::emitManualSymbolResolver(Module 
&M,
 
   OutStreamer->switchSection(OutContext.getObjectFileInfo()->getTextSection());
 
-  MCSymbol *Stub = getSymbol(&GI);
+  // _ifunc:
+  //   adrpx16, lazy_pointer@GOTPAGE
+  //   ldr x16, [x16, lazy_pointer@GOTPAGEOFF]
+  //   ldr x16, [x16]
+  //   br  x16
 
+  MCSymbol *Stub = getSymbol(&GI);
   EmitLinkage(Stub);
   OutStreamer->emitCodeAlignment(Align(4), STI);
   OutStreamer->emitLabel(Stub);
   emitVisibility(Stub, GI.getVisibility());
 
-  // adrp  x16, lazy_pointer@GOTPAGE
-  // ldr   x16, [x16, lazy_pointer@GOTPAGEOFF]
-  // ldr   x16, [x16]
-  // brx16
-
   {
 MCInst Adrp;
 Adrp.setOpcode(AArch64::ADRP);
@@ -1960,39 +1963,40 @@ void AArch64AsmPrinter::emitManualSymbolResolver(Module 
&M,
.addReg(AArch64::X16),
*STI);
 
+  // _ifunc.stub_helper:
+  //   stp fp, lr, [sp, #-16]
+  //   sub fp, sp, 16
+  //   stp x1, x0, [sp, #-32]
+  //   stp x3, x2, [sp, #-48]
+  //   stp x5, x4, [sp, #-64]
+  //   stp x7, x6, [sp, #-80]
+  //   stp d1, d0, [sp, #-96]
+  //   stp d3, d2, [sp, #-112]
+  //   stp d5, d4, [sp, #-128]
+  //   stp d7, d6, [sp, #-144]
+  //   sub sp, sp, 144
+  //   bl  _resolver
+  //   adrpx16, lazy_pointer@GOTPAGE
+  //   ldr x16, [x16, lazy_pointer@GOTPAGEOFF]
+  //   str x0, [x16]
+  //   mov x16, x0
+  //   add sp, sp, 144
+  //   ldp d7, d6, [sp, #-144]
+  //   ldp d5, d4, [sp, #-128]
+  //   ldp d3, d2, [sp, #-112]
+  //   ldp d1, d0, [sp, #-96]
+  //   ldp x7, x6, [sp, #-80]
+  //   ldp x5, x4, [sp, #-64]
+  //   ldp x3, x2, [sp, #-48]
+  //   ldp x1, x0, [sp, #-32]
+  //   ldp fp, lr, [sp, #-16]
+  //   br  x16
+
   EmitLinkage(StubHelper);
   OutStreamer->emitCodeAlignment(Align(4), STI);
   OutStreamer->emitLabel(StubHelper);
   emitVisibility(StubHelper, GI.getVisibility());
 
-  // stp   fp, lr, [sp, #-16]
-  // sub   fp, sp, 16
-  // stp   x1, x0, [sp, #-32]
-  // stp   x3, x2, [sp, #-48]
-  // stp   x5, x4, [sp, #-64]
-  // stp   x7, x6, [sp, #-80]
-  // stp   d1, d0, [sp, #-96]
-  // stp   d3, d2, [sp, #-112]
-  // stp   d5, d4, [sp, #-128]
-  // stp   d7, d6, [sp, #-144]
-  // sub   sp, sp, 144
-  // bl_resolver
-  // adrp  x16, lazy_pointer@GOTPAGE
-  // ldr   x16, [x16, lazy_pointer@GOTPAGEOFF]
-  // str   x0, [x16]
-  // mov   x16, x0
-  // add   sp, sp, 144
-  // ldp   d7, d6, [sp, #-144]
-  // ldp   d5, d4, [sp, #-128]
-  // ldp   d3, d2, [sp, #-112]
-  // ldp   d1, d0, [sp, #-96]
-  // ldp   x7, x6, [sp, #-80]
-  // ldp   x5, x4, [sp, #-64]
-  // ldp   x3, x2, [sp, #-48]
-  // ldp   x1, x0, [sp, #-32]
-  // ldp   fp, lr, [sp, #-16]
-  // brx16
-
   OutStreamer->emitInstruction(MCInstBuilder(AArch64::STPXi)
.addReg(AArch64::FP)
.addReg(AArch64::LR)

diff  --git a/llvm/lib/Target/X86/X86AsmPrinter.cpp 
b/llvm/lib/Target/X86/X86AsmPrinter.cpp
index 37158900d2404dd..b0f4b9d98437284 100644
--- a/llvm/lib/Target/X86/X86AsmPrinter.cpp
+++ b/llvm/lib/Target/X86/X86AsmPrinter.cpp
@@ -14,6 +14,7 @@
 #include "X86AsmPrinter.h"
 #include "MCTargetDesc/X86ATTInstPrinter.h"
 #include "MCTargetDesc/X86BaseInfo.h"
+#include "MCTargetDesc/X86MCTargetDesc.h"
 #include "MCTargetDesc/X86TargetStreamer.h"
 #include "TargetInfo/X86TargetInfo.h"
 #include "X86InstrInfo.h"
@@ -34,6 +35,7 @@
 #include "llvm/MC/MCCodeEmitter.h"
 #include "llvm/MC/MCContext.h"
 #include "llvm/MC/MCExp

[llvm-branch-commits] [llvm] [clang] [clang] Function Multi Versioning supports IFunc lowerings on Darwin platforms (PR #73688)

2023-11-29 Thread Jon Roelofs via llvm-branch-commits

https://github.com/jroelofs updated 
https://github.com/llvm/llvm-project/pull/73688


___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [llvm] 44935a8 - rebase

2023-11-29 Thread Jon Roelofs via llvm-branch-commits

Author: Jon Roelofs
Date: 2023-11-29T08:23:39-08:00
New Revision: 44935a897f12870bf23aaf5ab0e1a52b91fe9f95

URL: 
https://github.com/llvm/llvm-project/commit/44935a897f12870bf23aaf5ab0e1a52b91fe9f95
DIFF: 
https://github.com/llvm/llvm-project/commit/44935a897f12870bf23aaf5ab0e1a52b91fe9f95.diff

LOG: rebase

Created using spr 1.3.4

Added: 


Modified: 
llvm/lib/Target/AArch64/AArch64AsmPrinter.cpp
llvm/lib/Target/X86/X86AsmPrinter.cpp
llvm/test/CodeGen/X86/ifunc-asm.ll

Removed: 




diff  --git a/llvm/lib/Target/AArch64/AArch64AsmPrinter.cpp 
b/llvm/lib/Target/AArch64/AArch64AsmPrinter.cpp
index 26b3a14e22b2ad9..1b5b7c556c79f6b 100644
--- a/llvm/lib/Target/AArch64/AArch64AsmPrinter.cpp
+++ b/llvm/lib/Target/AArch64/AArch64AsmPrinter.cpp
@@ -1901,6 +1901,9 @@ void AArch64AsmPrinter::emitManualSymbolResolver(Module 
&M,
 
   OutStreamer->switchSection(OutContext.getObjectFileInfo()->getDataSection());
 
+  // _ifunc.lazy_pointer:
+  //   .quad _ifunc.stub_helper
+
   EmitLinkage(LazyPointer);
   OutStreamer->emitLabel(LazyPointer);
   emitVisibility(LazyPointer, GI.getVisibility());
@@ -1908,18 +1911,18 @@ void AArch64AsmPrinter::emitManualSymbolResolver(Module 
&M,
 
   OutStreamer->switchSection(OutContext.getObjectFileInfo()->getTextSection());
 
-  MCSymbol *Stub = getSymbol(&GI);
+  // _ifunc:
+  //   adrpx16, lazy_pointer@GOTPAGE
+  //   ldr x16, [x16, lazy_pointer@GOTPAGEOFF]
+  //   ldr x16, [x16]
+  //   br  x16
 
+  MCSymbol *Stub = getSymbol(&GI);
   EmitLinkage(Stub);
   OutStreamer->emitCodeAlignment(Align(4), STI);
   OutStreamer->emitLabel(Stub);
   emitVisibility(Stub, GI.getVisibility());
 
-  // adrp  x16, lazy_pointer@GOTPAGE
-  // ldr   x16, [x16, lazy_pointer@GOTPAGEOFF]
-  // ldr   x16, [x16]
-  // brx16
-
   {
 MCInst Adrp;
 Adrp.setOpcode(AArch64::ADRP);
@@ -1960,39 +1963,40 @@ void AArch64AsmPrinter::emitManualSymbolResolver(Module 
&M,
.addReg(AArch64::X16),
*STI);
 
+  // _ifunc.stub_helper:
+  //   stp fp, lr, [sp, #-16]
+  //   sub fp, sp, 16
+  //   stp x1, x0, [sp, #-32]
+  //   stp x3, x2, [sp, #-48]
+  //   stp x5, x4, [sp, #-64]
+  //   stp x7, x6, [sp, #-80]
+  //   stp d1, d0, [sp, #-96]
+  //   stp d3, d2, [sp, #-112]
+  //   stp d5, d4, [sp, #-128]
+  //   stp d7, d6, [sp, #-144]
+  //   sub sp, sp, 144
+  //   bl  _resolver
+  //   adrpx16, lazy_pointer@GOTPAGE
+  //   ldr x16, [x16, lazy_pointer@GOTPAGEOFF]
+  //   str x0, [x16]
+  //   mov x16, x0
+  //   add sp, sp, 144
+  //   ldp d7, d6, [sp, #-144]
+  //   ldp d5, d4, [sp, #-128]
+  //   ldp d3, d2, [sp, #-112]
+  //   ldp d1, d0, [sp, #-96]
+  //   ldp x7, x6, [sp, #-80]
+  //   ldp x5, x4, [sp, #-64]
+  //   ldp x3, x2, [sp, #-48]
+  //   ldp x1, x0, [sp, #-32]
+  //   ldp fp, lr, [sp, #-16]
+  //   br  x16
+
   EmitLinkage(StubHelper);
   OutStreamer->emitCodeAlignment(Align(4), STI);
   OutStreamer->emitLabel(StubHelper);
   emitVisibility(StubHelper, GI.getVisibility());
 
-  // stp   fp, lr, [sp, #-16]
-  // sub   fp, sp, 16
-  // stp   x1, x0, [sp, #-32]
-  // stp   x3, x2, [sp, #-48]
-  // stp   x5, x4, [sp, #-64]
-  // stp   x7, x6, [sp, #-80]
-  // stp   d1, d0, [sp, #-96]
-  // stp   d3, d2, [sp, #-112]
-  // stp   d5, d4, [sp, #-128]
-  // stp   d7, d6, [sp, #-144]
-  // sub   sp, sp, 144
-  // bl_resolver
-  // adrp  x16, lazy_pointer@GOTPAGE
-  // ldr   x16, [x16, lazy_pointer@GOTPAGEOFF]
-  // str   x0, [x16]
-  // mov   x16, x0
-  // add   sp, sp, 144
-  // ldp   d7, d6, [sp, #-144]
-  // ldp   d5, d4, [sp, #-128]
-  // ldp   d3, d2, [sp, #-112]
-  // ldp   d1, d0, [sp, #-96]
-  // ldp   x7, x6, [sp, #-80]
-  // ldp   x5, x4, [sp, #-64]
-  // ldp   x3, x2, [sp, #-48]
-  // ldp   x1, x0, [sp, #-32]
-  // ldp   fp, lr, [sp, #-16]
-  // brx16
-
   OutStreamer->emitInstruction(MCInstBuilder(AArch64::STPXi)
.addReg(AArch64::FP)
.addReg(AArch64::LR)

diff  --git a/llvm/lib/Target/X86/X86AsmPrinter.cpp 
b/llvm/lib/Target/X86/X86AsmPrinter.cpp
index 37158900d2404dd..b0f4b9d98437284 100644
--- a/llvm/lib/Target/X86/X86AsmPrinter.cpp
+++ b/llvm/lib/Target/X86/X86AsmPrinter.cpp
@@ -14,6 +14,7 @@
 #include "X86AsmPrinter.h"
 #include "MCTargetDesc/X86ATTInstPrinter.h"
 #include "MCTargetDesc/X86BaseInfo.h"
+#include "MCTargetDesc/X86MCTargetDesc.h"
 #include "MCTargetDesc/X86TargetStreamer.h"
 #include "TargetInfo/X86TargetInfo.h"
 #include "X86InstrInfo.h"
@@ -34,6 +35,7 @@
 #include "llvm/MC/MCCodeEmitter.h"
 #include "llvm/MC/MCContext.h"
 #include "llvm/MC/MCExpr.h"
+#include "llvm/MC/MCInst.h"
 #include 

[llvm-branch-commits] [llvm] dd44429 - rebase

2023-11-29 Thread Jon Roelofs via llvm-branch-commits

Author: Jon Roelofs
Date: 2023-11-29T08:23:34-08:00
New Revision: dd44429fd59d84c5489fd970d59e685707ffabb6

URL: 
https://github.com/llvm/llvm-project/commit/dd44429fd59d84c5489fd970d59e685707ffabb6
DIFF: 
https://github.com/llvm/llvm-project/commit/dd44429fd59d84c5489fd970d59e685707ffabb6.diff

LOG: rebase

Created using spr 1.3.4

Added: 


Modified: 
llvm/lib/Target/AArch64/AArch64AsmPrinter.cpp
llvm/lib/Target/X86/X86AsmPrinter.cpp
llvm/test/CodeGen/X86/ifunc-asm.ll

Removed: 




diff  --git a/llvm/lib/Target/AArch64/AArch64AsmPrinter.cpp 
b/llvm/lib/Target/AArch64/AArch64AsmPrinter.cpp
index 26b3a14e22b2ad9..1b5b7c556c79f6b 100644
--- a/llvm/lib/Target/AArch64/AArch64AsmPrinter.cpp
+++ b/llvm/lib/Target/AArch64/AArch64AsmPrinter.cpp
@@ -1901,6 +1901,9 @@ void AArch64AsmPrinter::emitManualSymbolResolver(Module 
&M,
 
   OutStreamer->switchSection(OutContext.getObjectFileInfo()->getDataSection());
 
+  // _ifunc.lazy_pointer:
+  //   .quad _ifunc.stub_helper
+
   EmitLinkage(LazyPointer);
   OutStreamer->emitLabel(LazyPointer);
   emitVisibility(LazyPointer, GI.getVisibility());
@@ -1908,18 +1911,18 @@ void AArch64AsmPrinter::emitManualSymbolResolver(Module 
&M,
 
   OutStreamer->switchSection(OutContext.getObjectFileInfo()->getTextSection());
 
-  MCSymbol *Stub = getSymbol(&GI);
+  // _ifunc:
+  //   adrpx16, lazy_pointer@GOTPAGE
+  //   ldr x16, [x16, lazy_pointer@GOTPAGEOFF]
+  //   ldr x16, [x16]
+  //   br  x16
 
+  MCSymbol *Stub = getSymbol(&GI);
   EmitLinkage(Stub);
   OutStreamer->emitCodeAlignment(Align(4), STI);
   OutStreamer->emitLabel(Stub);
   emitVisibility(Stub, GI.getVisibility());
 
-  // adrp  x16, lazy_pointer@GOTPAGE
-  // ldr   x16, [x16, lazy_pointer@GOTPAGEOFF]
-  // ldr   x16, [x16]
-  // brx16
-
   {
 MCInst Adrp;
 Adrp.setOpcode(AArch64::ADRP);
@@ -1960,39 +1963,40 @@ void AArch64AsmPrinter::emitManualSymbolResolver(Module 
&M,
.addReg(AArch64::X16),
*STI);
 
+  // _ifunc.stub_helper:
+  //   stp fp, lr, [sp, #-16]
+  //   sub fp, sp, 16
+  //   stp x1, x0, [sp, #-32]
+  //   stp x3, x2, [sp, #-48]
+  //   stp x5, x4, [sp, #-64]
+  //   stp x7, x6, [sp, #-80]
+  //   stp d1, d0, [sp, #-96]
+  //   stp d3, d2, [sp, #-112]
+  //   stp d5, d4, [sp, #-128]
+  //   stp d7, d6, [sp, #-144]
+  //   sub sp, sp, 144
+  //   bl  _resolver
+  //   adrpx16, lazy_pointer@GOTPAGE
+  //   ldr x16, [x16, lazy_pointer@GOTPAGEOFF]
+  //   str x0, [x16]
+  //   mov x16, x0
+  //   add sp, sp, 144
+  //   ldp d7, d6, [sp, #-144]
+  //   ldp d5, d4, [sp, #-128]
+  //   ldp d3, d2, [sp, #-112]
+  //   ldp d1, d0, [sp, #-96]
+  //   ldp x7, x6, [sp, #-80]
+  //   ldp x5, x4, [sp, #-64]
+  //   ldp x3, x2, [sp, #-48]
+  //   ldp x1, x0, [sp, #-32]
+  //   ldp fp, lr, [sp, #-16]
+  //   br  x16
+
   EmitLinkage(StubHelper);
   OutStreamer->emitCodeAlignment(Align(4), STI);
   OutStreamer->emitLabel(StubHelper);
   emitVisibility(StubHelper, GI.getVisibility());
 
-  // stp   fp, lr, [sp, #-16]
-  // sub   fp, sp, 16
-  // stp   x1, x0, [sp, #-32]
-  // stp   x3, x2, [sp, #-48]
-  // stp   x5, x4, [sp, #-64]
-  // stp   x7, x6, [sp, #-80]
-  // stp   d1, d0, [sp, #-96]
-  // stp   d3, d2, [sp, #-112]
-  // stp   d5, d4, [sp, #-128]
-  // stp   d7, d6, [sp, #-144]
-  // sub   sp, sp, 144
-  // bl_resolver
-  // adrp  x16, lazy_pointer@GOTPAGE
-  // ldr   x16, [x16, lazy_pointer@GOTPAGEOFF]
-  // str   x0, [x16]
-  // mov   x16, x0
-  // add   sp, sp, 144
-  // ldp   d7, d6, [sp, #-144]
-  // ldp   d5, d4, [sp, #-128]
-  // ldp   d3, d2, [sp, #-112]
-  // ldp   d1, d0, [sp, #-96]
-  // ldp   x7, x6, [sp, #-80]
-  // ldp   x5, x4, [sp, #-64]
-  // ldp   x3, x2, [sp, #-48]
-  // ldp   x1, x0, [sp, #-32]
-  // ldp   fp, lr, [sp, #-16]
-  // brx16
-
   OutStreamer->emitInstruction(MCInstBuilder(AArch64::STPXi)
.addReg(AArch64::FP)
.addReg(AArch64::LR)

diff  --git a/llvm/lib/Target/X86/X86AsmPrinter.cpp 
b/llvm/lib/Target/X86/X86AsmPrinter.cpp
index 37158900d2404dd..b0f4b9d98437284 100644
--- a/llvm/lib/Target/X86/X86AsmPrinter.cpp
+++ b/llvm/lib/Target/X86/X86AsmPrinter.cpp
@@ -14,6 +14,7 @@
 #include "X86AsmPrinter.h"
 #include "MCTargetDesc/X86ATTInstPrinter.h"
 #include "MCTargetDesc/X86BaseInfo.h"
+#include "MCTargetDesc/X86MCTargetDesc.h"
 #include "MCTargetDesc/X86TargetStreamer.h"
 #include "TargetInfo/X86TargetInfo.h"
 #include "X86InstrInfo.h"
@@ -34,6 +35,7 @@
 #include "llvm/MC/MCCodeEmitter.h"
 #include "llvm/MC/MCContext.h"
 #include "llvm/MC/MCExpr.h"
+#include "llvm/MC/MCInst.h"
 #include 

[llvm-branch-commits] [llvm] [clang] [compiler-rt] [builtins][arm64] Build __init_cpu_features_resolver on Apple platforms (PR #73685)

2023-11-29 Thread Jon Roelofs via llvm-branch-commits

https://github.com/jroelofs updated 
https://github.com/llvm/llvm-project/pull/73685


___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [compiler-rt] [llvm] [clang] [builtins][arm64] Build __init_cpu_features_resolver on Apple platforms (PR #73685)

2023-11-29 Thread Jon Roelofs via llvm-branch-commits

https://github.com/jroelofs updated 
https://github.com/llvm/llvm-project/pull/73685


___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [llvm] c67ce7f - [𝘀𝗽𝗿] changes introduced through rebase

2023-11-29 Thread Jon Roelofs via llvm-branch-commits

Author: Jon Roelofs
Date: 2023-11-29T08:23:32-08:00
New Revision: c67ce7fb42a599a11b3c743812fe8ccf52daed0c

URL: 
https://github.com/llvm/llvm-project/commit/c67ce7fb42a599a11b3c743812fe8ccf52daed0c
DIFF: 
https://github.com/llvm/llvm-project/commit/c67ce7fb42a599a11b3c743812fe8ccf52daed0c.diff

LOG: [𝘀𝗽𝗿] changes introduced through rebase

Created using spr 1.3.4

[skip ci]

Added: 


Modified: 
llvm/lib/Target/AArch64/AArch64AsmPrinter.cpp
llvm/lib/Target/X86/X86AsmPrinter.cpp
llvm/test/CodeGen/X86/ifunc-asm.ll

Removed: 




diff  --git a/llvm/lib/Target/AArch64/AArch64AsmPrinter.cpp 
b/llvm/lib/Target/AArch64/AArch64AsmPrinter.cpp
index 26b3a14e22b2ad9..1b5b7c556c79f6b 100644
--- a/llvm/lib/Target/AArch64/AArch64AsmPrinter.cpp
+++ b/llvm/lib/Target/AArch64/AArch64AsmPrinter.cpp
@@ -1901,6 +1901,9 @@ void AArch64AsmPrinter::emitManualSymbolResolver(Module 
&M,
 
   OutStreamer->switchSection(OutContext.getObjectFileInfo()->getDataSection());
 
+  // _ifunc.lazy_pointer:
+  //   .quad _ifunc.stub_helper
+
   EmitLinkage(LazyPointer);
   OutStreamer->emitLabel(LazyPointer);
   emitVisibility(LazyPointer, GI.getVisibility());
@@ -1908,18 +1911,18 @@ void AArch64AsmPrinter::emitManualSymbolResolver(Module 
&M,
 
   OutStreamer->switchSection(OutContext.getObjectFileInfo()->getTextSection());
 
-  MCSymbol *Stub = getSymbol(&GI);
+  // _ifunc:
+  //   adrpx16, lazy_pointer@GOTPAGE
+  //   ldr x16, [x16, lazy_pointer@GOTPAGEOFF]
+  //   ldr x16, [x16]
+  //   br  x16
 
+  MCSymbol *Stub = getSymbol(&GI);
   EmitLinkage(Stub);
   OutStreamer->emitCodeAlignment(Align(4), STI);
   OutStreamer->emitLabel(Stub);
   emitVisibility(Stub, GI.getVisibility());
 
-  // adrp  x16, lazy_pointer@GOTPAGE
-  // ldr   x16, [x16, lazy_pointer@GOTPAGEOFF]
-  // ldr   x16, [x16]
-  // brx16
-
   {
 MCInst Adrp;
 Adrp.setOpcode(AArch64::ADRP);
@@ -1960,39 +1963,40 @@ void AArch64AsmPrinter::emitManualSymbolResolver(Module 
&M,
.addReg(AArch64::X16),
*STI);
 
+  // _ifunc.stub_helper:
+  //   stp fp, lr, [sp, #-16]
+  //   sub fp, sp, 16
+  //   stp x1, x0, [sp, #-32]
+  //   stp x3, x2, [sp, #-48]
+  //   stp x5, x4, [sp, #-64]
+  //   stp x7, x6, [sp, #-80]
+  //   stp d1, d0, [sp, #-96]
+  //   stp d3, d2, [sp, #-112]
+  //   stp d5, d4, [sp, #-128]
+  //   stp d7, d6, [sp, #-144]
+  //   sub sp, sp, 144
+  //   bl  _resolver
+  //   adrpx16, lazy_pointer@GOTPAGE
+  //   ldr x16, [x16, lazy_pointer@GOTPAGEOFF]
+  //   str x0, [x16]
+  //   mov x16, x0
+  //   add sp, sp, 144
+  //   ldp d7, d6, [sp, #-144]
+  //   ldp d5, d4, [sp, #-128]
+  //   ldp d3, d2, [sp, #-112]
+  //   ldp d1, d0, [sp, #-96]
+  //   ldp x7, x6, [sp, #-80]
+  //   ldp x5, x4, [sp, #-64]
+  //   ldp x3, x2, [sp, #-48]
+  //   ldp x1, x0, [sp, #-32]
+  //   ldp fp, lr, [sp, #-16]
+  //   br  x16
+
   EmitLinkage(StubHelper);
   OutStreamer->emitCodeAlignment(Align(4), STI);
   OutStreamer->emitLabel(StubHelper);
   emitVisibility(StubHelper, GI.getVisibility());
 
-  // stp   fp, lr, [sp, #-16]
-  // sub   fp, sp, 16
-  // stp   x1, x0, [sp, #-32]
-  // stp   x3, x2, [sp, #-48]
-  // stp   x5, x4, [sp, #-64]
-  // stp   x7, x6, [sp, #-80]
-  // stp   d1, d0, [sp, #-96]
-  // stp   d3, d2, [sp, #-112]
-  // stp   d5, d4, [sp, #-128]
-  // stp   d7, d6, [sp, #-144]
-  // sub   sp, sp, 144
-  // bl_resolver
-  // adrp  x16, lazy_pointer@GOTPAGE
-  // ldr   x16, [x16, lazy_pointer@GOTPAGEOFF]
-  // str   x0, [x16]
-  // mov   x16, x0
-  // add   sp, sp, 144
-  // ldp   d7, d6, [sp, #-144]
-  // ldp   d5, d4, [sp, #-128]
-  // ldp   d3, d2, [sp, #-112]
-  // ldp   d1, d0, [sp, #-96]
-  // ldp   x7, x6, [sp, #-80]
-  // ldp   x5, x4, [sp, #-64]
-  // ldp   x3, x2, [sp, #-48]
-  // ldp   x1, x0, [sp, #-32]
-  // ldp   fp, lr, [sp, #-16]
-  // brx16
-
   OutStreamer->emitInstruction(MCInstBuilder(AArch64::STPXi)
.addReg(AArch64::FP)
.addReg(AArch64::LR)

diff  --git a/llvm/lib/Target/X86/X86AsmPrinter.cpp 
b/llvm/lib/Target/X86/X86AsmPrinter.cpp
index 37158900d2404dd..b0f4b9d98437284 100644
--- a/llvm/lib/Target/X86/X86AsmPrinter.cpp
+++ b/llvm/lib/Target/X86/X86AsmPrinter.cpp
@@ -14,6 +14,7 @@
 #include "X86AsmPrinter.h"
 #include "MCTargetDesc/X86ATTInstPrinter.h"
 #include "MCTargetDesc/X86BaseInfo.h"
+#include "MCTargetDesc/X86MCTargetDesc.h"
 #include "MCTargetDesc/X86TargetStreamer.h"
 #include "TargetInfo/X86TargetInfo.h"
 #include "X86InstrInfo.h"
@@ -34,6 +35,7 @@
 #include "llvm/MC/MCCodeEmitter.h"
 #include "llvm/MC/MCContext.h"
 #include "llvm/MC/MCExp

[llvm-branch-commits] [llvm] [clang] [clang] Function Multi Versioning supports IFunc lowerings on Darwin platforms (PR #73688)

2023-11-29 Thread Tom Honermann via llvm-branch-commits

tahonermann wrote:

Added @erichkeane as a reviewer as well.

Will this cause an ABI compatibility issue for any existing use of the function 
multiversioning attributes on Darwin? I think it might, but I haven't tried to 
confirm.

https://github.com/llvm/llvm-project/pull/73688
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [llvm] [clang] [clang] Support __attribute__((ifunc(...))) on Darwin platforms (PR #73687)

2023-11-29 Thread Eric Christopher via llvm-branch-commits

echristo wrote:

Do you need an OS version check here?

https://github.com/llvm/llvm-project/pull/73687
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [clang] [llvm] [clang] Function Multi Versioning supports IFunc lowerings on Darwin platforms (PR #73688)

2023-11-29 Thread Jon Roelofs via llvm-branch-commits

jroelofs wrote:

> Will this cause an ABI compatibility issue for any existing use of the 
> function multiversioning attributes on Darwin? I think it might, but I 
> haven't tried to confirm.

I don't think there is an ABI compatibility concern here for a couple of 
reasons:
* The corresponding builtins were unimplemented on Darwin until 
https://github.com/llvm/llvm-project/pull/73685 (FYI, this is part of a patch 
series: #73688, #73687, #73686, #73685)
* On AArch64, the IFunc lowering is required: 
https://github.com/llvm/llvm-project/blob/859338a695169d2804d6999f44e1e94bedf6ddd7/clang/lib/CodeGen/CodeGenFunction.cpp#L2746-L2748

https://github.com/llvm/llvm-project/pull/73688
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [llvm] [clang] [clang] Support __attribute__((ifunc(...))) on Darwin platforms (PR #73687)

2023-11-29 Thread Tom Honermann via llvm-branch-commits

tahonermann wrote:

Added @erichkeane as a reviewer.

I recommend extending test coverage to all of the following tests:
- `clang/test/CodeGenCXX/externc-ifunc-resolver.cpp`
- `clang/test/SemaCXX/externc-ifunc-resolver.cpp`
- `clang/test/CodeGen/ifunc.c` (already done)
- `clang/test/CodeGen/attr-ifunc.cpp`
- `clang/test/CodeGen/attr-ifunc.c`

https://github.com/llvm/llvm-project/pull/73687
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [clang] [llvm] [clang] Support __attribute__((ifunc(...))) on Darwin platforms (PR #73687)

2023-11-29 Thread Jon Roelofs via llvm-branch-commits

jroelofs wrote:

This is part of a patch series:
* #73686
* #73688
* #73687
* #73685

https://github.com/llvm/llvm-project/pull/73687
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [llvm] [clang] [clang] Support __attribute__((ifunc(...))) on Darwin platforms (PR #73687)

2023-11-29 Thread Jon Roelofs via llvm-branch-commits

jroelofs wrote:

> Do you need an OS version check here?

I don't think so, at least not yet. With #73686, support for this is entirely 
up to the compiler.

https://github.com/llvm/llvm-project/pull/73687
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [llvm] [clang] [compiler-rt] [builtins][arm64] Build __init_cpu_features_resolver on Apple platforms (PR #73685)

2023-11-29 Thread Jon Roelofs via llvm-branch-commits

jroelofs wrote:

This is part of a patch series:
* #73686
* #73688
* #73687
* #73685

https://github.com/llvm/llvm-project/pull/73685
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [clang] [llvm] [clang] Support __attribute__((ifunc(...))) on Darwin platforms (PR #73687)

2023-11-29 Thread Eric Christopher via llvm-branch-commits

echristo wrote:

On Wed, Nov 29, 2023 at 9:37 AM Jon Roelofs ***@***.***>
wrote:

> Do you need an OS version check here?
>
> I don't think so, at least not yet. With #73686
> , support for this is
> entirely up to the compiler.
>
Aha I was wondering where the implementation side was :)

It looks like you don't necessarily need linker support as you're putting
it into the binary on occasion as well. This could work for now, but if you
plan on using this extensively it might be worth something else (as you
note).


https://github.com/llvm/llvm-project/pull/73687
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [clang] aeb39b9 - adjust tests per review feedback

2023-11-29 Thread Jon Roelofs via llvm-branch-commits

Author: Jon Roelofs
Date: 2023-11-29T12:23:46-08:00
New Revision: aeb39b92bbd7670fb8c6b9e76a456a92199691b3

URL: 
https://github.com/llvm/llvm-project/commit/aeb39b92bbd7670fb8c6b9e76a456a92199691b3
DIFF: 
https://github.com/llvm/llvm-project/commit/aeb39b92bbd7670fb8c6b9e76a456a92199691b3.diff

LOG: adjust tests per review feedback

Created using spr 1.3.4

Added: 


Modified: 
clang/test/CodeGen/attr-ifunc.c
clang/test/CodeGen/attr-ifunc.cpp
clang/test/CodeGenCXX/externc-ifunc-resolver.cpp
clang/test/SemaCXX/externc-ifunc-resolver.cpp

Removed: 




diff  --git a/clang/test/CodeGen/attr-ifunc.c b/clang/test/CodeGen/attr-ifunc.c
index 4f8fe13530fdb7b..2ad41edf20dfa01 100644
--- a/clang/test/CodeGen/attr-ifunc.c
+++ b/clang/test/CodeGen/attr-ifunc.c
@@ -1,6 +1,7 @@
 // RUN: %clang_cc1 -triple x86_64-windows -fsyntax-only -verify %s
 // RUN: %clang_cc1 -triple x86_64-linux -fsyntax-only -verify -emit-llvm-only 
-DCHECK_ALIASES %s
 // RUN: %clang_cc1 -triple x86_64-linux -fsyntax-only -verify -emit-llvm-only 
%s
+// RUN: %clang_cc1 -triple x86_64-apple-macosx -fsyntax-only -verify 
-emit-llvm-only %s
 
 #if defined(_WIN32)
 void foo(void) {}
@@ -36,6 +37,25 @@ void *f6_resolver(void) 
__attribute__((ifunc("f6_resolver_resolver")));
 void f6(void) __attribute__((ifunc("f6_resolver")));
 // expected-error@-1 {{ifunc must point to a defined function}}
 
+#elif defined(__APPLE__)
+
+// NOTE: aliases are not supported on Darwin, so the above tests are not 
relevant.
+
+#define STR2(X) #X
+#define STR(X) STR2(X)
+#define PREFIX STR(__USER_LABEL_PREFIX__)
+
+void f1a(void) __asm("f1");
+void f1a(void) {}
+// expected-note@-1 {{previous definition is here}}
+void f1(void) __attribute__((ifunc(PREFIX "f1_ifunc"))) __asm("f1");
+// expected-error@-1 {{definition with same mangled name 'f1' as 
another definition}}
+void *f1_ifunc(void) { return 0; }
+
+void *f6_ifunc(int i);
+void __attribute__((ifunc(PREFIX "f6_ifunc"))) f6(void) {}
+// expected-error@-1 {{definition 'f6' cannot also be an ifunc}}
+
 #else
 void f1a(void) __asm("f1");
 void f1a(void) {}

diff  --git a/clang/test/CodeGen/attr-ifunc.cpp 
b/clang/test/CodeGen/attr-ifunc.cpp
index 5b5b2c14b4074b7..b6e342df46eb583 100644
--- a/clang/test/CodeGen/attr-ifunc.cpp
+++ b/clang/test/CodeGen/attr-ifunc.cpp
@@ -1,5 +1,9 @@
 // RUN: %clang_cc1 -triple x86_64-linux -fsyntax-only -verify -emit-llvm-only 
%s
+// RUN: %clang_cc1 -triple x86_64-apple-macosx -fsyntax-only -verify 
-emit-llvm-only %s
+// RUN: %clang_cc1 -triple arm64-apple-macosx -fsyntax-only -verify 
-emit-llvm-only %s
 // RUN: not %clang_cc1 -triple x86_64-linux -emit-llvm-only 
-fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s
+// RUN: not %clang_cc1 -triple x86_64-apple-macosx -emit-llvm-only 
-fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s
+// RUN: not %clang_cc1 -triple arm64-apple-macosx -emit-llvm-only 
-fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s
 
 void *f1_ifunc(void) { return nullptr; }
 void f1(void) __attribute__((ifunc("f1_ifunc")));

diff  --git a/clang/test/CodeGenCXX/externc-ifunc-resolver.cpp 
b/clang/test/CodeGenCXX/externc-ifunc-resolver.cpp
index 0518a8dcc831dd4..be4453ae7eb08ce 100644
--- a/clang/test/CodeGenCXX/externc-ifunc-resolver.cpp
+++ b/clang/test/CodeGenCXX/externc-ifunc-resolver.cpp
@@ -1,4 +1,6 @@
 // RUN: %clang_cc1 -triple x86_64-linux-gnu -emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -triple x86_64-apple-macosx -emit-llvm -o - %s | FileCheck 
%s
+// RUN: %clang_cc1 -triple arm64-apple-macosx -emit-llvm -o - %s | FileCheck %s
 
 extern "C" {
 __attribute__((used)) static void *resolve_foo() { return 0; }

diff  --git a/clang/test/SemaCXX/externc-ifunc-resolver.cpp 
b/clang/test/SemaCXX/externc-ifunc-resolver.cpp
index aa44525bde2cae1..6c6c262c5f09d8e 100644
--- a/clang/test/SemaCXX/externc-ifunc-resolver.cpp
+++ b/clang/test/SemaCXX/externc-ifunc-resolver.cpp
@@ -1,5 +1,9 @@
 // RUN: %clang_cc1 -emit-llvm-only -triple x86_64-linux-gnu -verify %s
+// RUN: %clang_cc1 -emit-llvm-only -triple x86_64-apple-macosx -verify %s
+// RUN: %clang_cc1 -emit-llvm-only -triple arm64-apple-macosx -verify %s
 // RUN: not %clang_cc1 -triple x86_64-linux -emit-llvm-only 
-fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s
+// RUN: not %clang_cc1 -triple x86_64-apple-macosx -emit-llvm-only 
-fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s
+// RUN: not %clang_cc1 -triple arm64-apple-macosx -emit-llvm-only 
-fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s
 
 extern "C" {
 __attribute__((used)) static void *resolve_foo() { return 0; }



___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [clang] 0041d6d - [𝘀𝗽𝗿] changes introduced through rebase

2023-11-29 Thread Jon Roelofs via llvm-branch-commits

Author: Jon Roelofs
Date: 2023-11-29T12:23:50-08:00
New Revision: 0041d6d015ae98b29820f649160c60a90c7c4220

URL: 
https://github.com/llvm/llvm-project/commit/0041d6d015ae98b29820f649160c60a90c7c4220
DIFF: 
https://github.com/llvm/llvm-project/commit/0041d6d015ae98b29820f649160c60a90c7c4220.diff

LOG: [𝘀𝗽𝗿] changes introduced through rebase

Created using spr 1.3.4

[skip ci]

Added: 


Modified: 
clang/test/CodeGen/attr-ifunc.c
clang/test/CodeGen/attr-ifunc.cpp
clang/test/CodeGenCXX/externc-ifunc-resolver.cpp
clang/test/SemaCXX/externc-ifunc-resolver.cpp

Removed: 




diff  --git a/clang/test/CodeGen/attr-ifunc.c b/clang/test/CodeGen/attr-ifunc.c
index 4f8fe13530fdb7b..2ad41edf20dfa01 100644
--- a/clang/test/CodeGen/attr-ifunc.c
+++ b/clang/test/CodeGen/attr-ifunc.c
@@ -1,6 +1,7 @@
 // RUN: %clang_cc1 -triple x86_64-windows -fsyntax-only -verify %s
 // RUN: %clang_cc1 -triple x86_64-linux -fsyntax-only -verify -emit-llvm-only 
-DCHECK_ALIASES %s
 // RUN: %clang_cc1 -triple x86_64-linux -fsyntax-only -verify -emit-llvm-only 
%s
+// RUN: %clang_cc1 -triple x86_64-apple-macosx -fsyntax-only -verify 
-emit-llvm-only %s
 
 #if defined(_WIN32)
 void foo(void) {}
@@ -36,6 +37,25 @@ void *f6_resolver(void) 
__attribute__((ifunc("f6_resolver_resolver")));
 void f6(void) __attribute__((ifunc("f6_resolver")));
 // expected-error@-1 {{ifunc must point to a defined function}}
 
+#elif defined(__APPLE__)
+
+// NOTE: aliases are not supported on Darwin, so the above tests are not 
relevant.
+
+#define STR2(X) #X
+#define STR(X) STR2(X)
+#define PREFIX STR(__USER_LABEL_PREFIX__)
+
+void f1a(void) __asm("f1");
+void f1a(void) {}
+// expected-note@-1 {{previous definition is here}}
+void f1(void) __attribute__((ifunc(PREFIX "f1_ifunc"))) __asm("f1");
+// expected-error@-1 {{definition with same mangled name 'f1' as 
another definition}}
+void *f1_ifunc(void) { return 0; }
+
+void *f6_ifunc(int i);
+void __attribute__((ifunc(PREFIX "f6_ifunc"))) f6(void) {}
+// expected-error@-1 {{definition 'f6' cannot also be an ifunc}}
+
 #else
 void f1a(void) __asm("f1");
 void f1a(void) {}

diff  --git a/clang/test/CodeGen/attr-ifunc.cpp 
b/clang/test/CodeGen/attr-ifunc.cpp
index 5b5b2c14b4074b7..b6e342df46eb583 100644
--- a/clang/test/CodeGen/attr-ifunc.cpp
+++ b/clang/test/CodeGen/attr-ifunc.cpp
@@ -1,5 +1,9 @@
 // RUN: %clang_cc1 -triple x86_64-linux -fsyntax-only -verify -emit-llvm-only 
%s
+// RUN: %clang_cc1 -triple x86_64-apple-macosx -fsyntax-only -verify 
-emit-llvm-only %s
+// RUN: %clang_cc1 -triple arm64-apple-macosx -fsyntax-only -verify 
-emit-llvm-only %s
 // RUN: not %clang_cc1 -triple x86_64-linux -emit-llvm-only 
-fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s
+// RUN: not %clang_cc1 -triple x86_64-apple-macosx -emit-llvm-only 
-fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s
+// RUN: not %clang_cc1 -triple arm64-apple-macosx -emit-llvm-only 
-fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s
 
 void *f1_ifunc(void) { return nullptr; }
 void f1(void) __attribute__((ifunc("f1_ifunc")));

diff  --git a/clang/test/CodeGenCXX/externc-ifunc-resolver.cpp 
b/clang/test/CodeGenCXX/externc-ifunc-resolver.cpp
index 0518a8dcc831dd4..be4453ae7eb08ce 100644
--- a/clang/test/CodeGenCXX/externc-ifunc-resolver.cpp
+++ b/clang/test/CodeGenCXX/externc-ifunc-resolver.cpp
@@ -1,4 +1,6 @@
 // RUN: %clang_cc1 -triple x86_64-linux-gnu -emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -triple x86_64-apple-macosx -emit-llvm -o - %s | FileCheck 
%s
+// RUN: %clang_cc1 -triple arm64-apple-macosx -emit-llvm -o - %s | FileCheck %s
 
 extern "C" {
 __attribute__((used)) static void *resolve_foo() { return 0; }

diff  --git a/clang/test/SemaCXX/externc-ifunc-resolver.cpp 
b/clang/test/SemaCXX/externc-ifunc-resolver.cpp
index aa44525bde2cae1..6c6c262c5f09d8e 100644
--- a/clang/test/SemaCXX/externc-ifunc-resolver.cpp
+++ b/clang/test/SemaCXX/externc-ifunc-resolver.cpp
@@ -1,5 +1,9 @@
 // RUN: %clang_cc1 -emit-llvm-only -triple x86_64-linux-gnu -verify %s
+// RUN: %clang_cc1 -emit-llvm-only -triple x86_64-apple-macosx -verify %s
+// RUN: %clang_cc1 -emit-llvm-only -triple arm64-apple-macosx -verify %s
 // RUN: not %clang_cc1 -triple x86_64-linux -emit-llvm-only 
-fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s
+// RUN: not %clang_cc1 -triple x86_64-apple-macosx -emit-llvm-only 
-fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s
+// RUN: not %clang_cc1 -triple arm64-apple-macosx -emit-llvm-only 
-fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s
 
 extern "C" {
 __attribute__((used)) static void *resolve_foo() { return 0; }



___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [llvm] [clang] [clang] Support __attribute__((ifunc(...))) on Darwin platforms (PR #73687)

2023-11-29 Thread Jon Roelofs via llvm-branch-commits

https://github.com/jroelofs updated 
https://github.com/llvm/llvm-project/pull/73687

>From aeb39b92bbd7670fb8c6b9e76a456a92199691b3 Mon Sep 17 00:00:00 2001
From: Jon Roelofs 
Date: Wed, 29 Nov 2023 12:23:46 -0800
Subject: [PATCH] adjust tests per review feedback

Created using spr 1.3.4
---
 clang/test/CodeGen/attr-ifunc.c   | 20 +++
 clang/test/CodeGen/attr-ifunc.cpp |  4 
 .../CodeGenCXX/externc-ifunc-resolver.cpp |  2 ++
 clang/test/SemaCXX/externc-ifunc-resolver.cpp |  4 
 4 files changed, 30 insertions(+)

diff --git a/clang/test/CodeGen/attr-ifunc.c b/clang/test/CodeGen/attr-ifunc.c
index 4f8fe13530fdb7b..2ad41edf20dfa01 100644
--- a/clang/test/CodeGen/attr-ifunc.c
+++ b/clang/test/CodeGen/attr-ifunc.c
@@ -1,6 +1,7 @@
 // RUN: %clang_cc1 -triple x86_64-windows -fsyntax-only -verify %s
 // RUN: %clang_cc1 -triple x86_64-linux -fsyntax-only -verify -emit-llvm-only 
-DCHECK_ALIASES %s
 // RUN: %clang_cc1 -triple x86_64-linux -fsyntax-only -verify -emit-llvm-only 
%s
+// RUN: %clang_cc1 -triple x86_64-apple-macosx -fsyntax-only -verify 
-emit-llvm-only %s
 
 #if defined(_WIN32)
 void foo(void) {}
@@ -36,6 +37,25 @@ void *f6_resolver(void) 
__attribute__((ifunc("f6_resolver_resolver")));
 void f6(void) __attribute__((ifunc("f6_resolver")));
 // expected-error@-1 {{ifunc must point to a defined function}}
 
+#elif defined(__APPLE__)
+
+// NOTE: aliases are not supported on Darwin, so the above tests are not 
relevant.
+
+#define STR2(X) #X
+#define STR(X) STR2(X)
+#define PREFIX STR(__USER_LABEL_PREFIX__)
+
+void f1a(void) __asm("f1");
+void f1a(void) {}
+// expected-note@-1 {{previous definition is here}}
+void f1(void) __attribute__((ifunc(PREFIX "f1_ifunc"))) __asm("f1");
+// expected-error@-1 {{definition with same mangled name 'f1' as 
another definition}}
+void *f1_ifunc(void) { return 0; }
+
+void *f6_ifunc(int i);
+void __attribute__((ifunc(PREFIX "f6_ifunc"))) f6(void) {}
+// expected-error@-1 {{definition 'f6' cannot also be an ifunc}}
+
 #else
 void f1a(void) __asm("f1");
 void f1a(void) {}
diff --git a/clang/test/CodeGen/attr-ifunc.cpp 
b/clang/test/CodeGen/attr-ifunc.cpp
index 5b5b2c14b4074b7..b6e342df46eb583 100644
--- a/clang/test/CodeGen/attr-ifunc.cpp
+++ b/clang/test/CodeGen/attr-ifunc.cpp
@@ -1,5 +1,9 @@
 // RUN: %clang_cc1 -triple x86_64-linux -fsyntax-only -verify -emit-llvm-only 
%s
+// RUN: %clang_cc1 -triple x86_64-apple-macosx -fsyntax-only -verify 
-emit-llvm-only %s
+// RUN: %clang_cc1 -triple arm64-apple-macosx -fsyntax-only -verify 
-emit-llvm-only %s
 // RUN: not %clang_cc1 -triple x86_64-linux -emit-llvm-only 
-fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s
+// RUN: not %clang_cc1 -triple x86_64-apple-macosx -emit-llvm-only 
-fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s
+// RUN: not %clang_cc1 -triple arm64-apple-macosx -emit-llvm-only 
-fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s
 
 void *f1_ifunc(void) { return nullptr; }
 void f1(void) __attribute__((ifunc("f1_ifunc")));
diff --git a/clang/test/CodeGenCXX/externc-ifunc-resolver.cpp 
b/clang/test/CodeGenCXX/externc-ifunc-resolver.cpp
index 0518a8dcc831dd4..be4453ae7eb08ce 100644
--- a/clang/test/CodeGenCXX/externc-ifunc-resolver.cpp
+++ b/clang/test/CodeGenCXX/externc-ifunc-resolver.cpp
@@ -1,4 +1,6 @@
 // RUN: %clang_cc1 -triple x86_64-linux-gnu -emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -triple x86_64-apple-macosx -emit-llvm -o - %s | FileCheck 
%s
+// RUN: %clang_cc1 -triple arm64-apple-macosx -emit-llvm -o - %s | FileCheck %s
 
 extern "C" {
 __attribute__((used)) static void *resolve_foo() { return 0; }
diff --git a/clang/test/SemaCXX/externc-ifunc-resolver.cpp 
b/clang/test/SemaCXX/externc-ifunc-resolver.cpp
index aa44525bde2cae1..6c6c262c5f09d8e 100644
--- a/clang/test/SemaCXX/externc-ifunc-resolver.cpp
+++ b/clang/test/SemaCXX/externc-ifunc-resolver.cpp
@@ -1,5 +1,9 @@
 // RUN: %clang_cc1 -emit-llvm-only -triple x86_64-linux-gnu -verify %s
+// RUN: %clang_cc1 -emit-llvm-only -triple x86_64-apple-macosx -verify %s
+// RUN: %clang_cc1 -emit-llvm-only -triple arm64-apple-macosx -verify %s
 // RUN: not %clang_cc1 -triple x86_64-linux -emit-llvm-only 
-fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s
+// RUN: not %clang_cc1 -triple x86_64-apple-macosx -emit-llvm-only 
-fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s
+// RUN: not %clang_cc1 -triple arm64-apple-macosx -emit-llvm-only 
-fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s
 
 extern "C" {
 __attribute__((used)) static void *resolve_foo() { return 0; }

___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [clang] d0c0b86 - adjust tests per review feedback

2023-11-29 Thread Jon Roelofs via llvm-branch-commits

Author: Jon Roelofs
Date: 2023-11-29T12:23:52-08:00
New Revision: d0c0b8656f21672ff5b31f2e7ce3583b5008e38b

URL: 
https://github.com/llvm/llvm-project/commit/d0c0b8656f21672ff5b31f2e7ce3583b5008e38b
DIFF: 
https://github.com/llvm/llvm-project/commit/d0c0b8656f21672ff5b31f2e7ce3583b5008e38b.diff

LOG: adjust tests per review feedback

Created using spr 1.3.4

Added: 


Modified: 
clang/test/CodeGen/attr-cpuspecific.c
clang/test/CodeGen/attr-ifunc.c
clang/test/CodeGen/attr-ifunc.cpp
clang/test/CodeGen/attr-target-clones.c
clang/test/CodeGen/attr-target-mv-func-ptrs.c
clang/test/CodeGen/attr-target-mv.c
clang/test/CodeGenCXX/attr-cpuspecific.cpp
clang/test/CodeGenCXX/attr-target-clones.cpp
clang/test/CodeGenCXX/attr-target-mv-diff-ns.cpp
clang/test/CodeGenCXX/attr-target-mv-func-ptrs.cpp
clang/test/CodeGenCXX/attr-target-mv-inalloca.cpp
clang/test/CodeGenCXX/attr-target-mv-member-funcs.cpp
clang/test/CodeGenCXX/attr-target-mv-modules.cpp
clang/test/CodeGenCXX/attr-target-mv-out-of-line-defs.cpp
clang/test/CodeGenCXX/attr-target-mv-overloads.cpp
clang/test/CodeGenCXX/externc-ifunc-resolver.cpp
clang/test/SemaCXX/externc-ifunc-resolver.cpp

Removed: 




diff  --git a/clang/test/CodeGen/attr-cpuspecific.c 
b/clang/test/CodeGen/attr-cpuspecific.c
index 9150597e8c5a847..5baa271b5240f0a 100644
--- a/clang/test/CodeGen/attr-cpuspecific.c
+++ b/clang/test/CodeGen/attr-cpuspecific.c
@@ -1,4 +1,5 @@
 // RUN: %clang_cc1 -triple x86_64-linux-gnu -emit-llvm -o - %s | FileCheck %s 
--check-prefixes=CHECK,LINUX
+// RUN: %clang_cc1 -triple x86_64-apple-macosx -emit-llvm -o - %s | FileCheck 
%s --check-prefixes=CHECK,LINUX
 // RUN: %clang_cc1 -triple x86_64-windows-pc -fms-compatibility -emit-llvm -o 
- %s | FileCheck %s --check-prefixes=CHECK,WINDOWS
 
 #ifdef _WIN64

diff  --git a/clang/test/CodeGen/attr-ifunc.c b/clang/test/CodeGen/attr-ifunc.c
index 4f8fe13530fdb7b..2ad41edf20dfa01 100644
--- a/clang/test/CodeGen/attr-ifunc.c
+++ b/clang/test/CodeGen/attr-ifunc.c
@@ -1,6 +1,7 @@
 // RUN: %clang_cc1 -triple x86_64-windows -fsyntax-only -verify %s
 // RUN: %clang_cc1 -triple x86_64-linux -fsyntax-only -verify -emit-llvm-only 
-DCHECK_ALIASES %s
 // RUN: %clang_cc1 -triple x86_64-linux -fsyntax-only -verify -emit-llvm-only 
%s
+// RUN: %clang_cc1 -triple x86_64-apple-macosx -fsyntax-only -verify 
-emit-llvm-only %s
 
 #if defined(_WIN32)
 void foo(void) {}
@@ -36,6 +37,25 @@ void *f6_resolver(void) 
__attribute__((ifunc("f6_resolver_resolver")));
 void f6(void) __attribute__((ifunc("f6_resolver")));
 // expected-error@-1 {{ifunc must point to a defined function}}
 
+#elif defined(__APPLE__)
+
+// NOTE: aliases are not supported on Darwin, so the above tests are not 
relevant.
+
+#define STR2(X) #X
+#define STR(X) STR2(X)
+#define PREFIX STR(__USER_LABEL_PREFIX__)
+
+void f1a(void) __asm("f1");
+void f1a(void) {}
+// expected-note@-1 {{previous definition is here}}
+void f1(void) __attribute__((ifunc(PREFIX "f1_ifunc"))) __asm("f1");
+// expected-error@-1 {{definition with same mangled name 'f1' as 
another definition}}
+void *f1_ifunc(void) { return 0; }
+
+void *f6_ifunc(int i);
+void __attribute__((ifunc(PREFIX "f6_ifunc"))) f6(void) {}
+// expected-error@-1 {{definition 'f6' cannot also be an ifunc}}
+
 #else
 void f1a(void) __asm("f1");
 void f1a(void) {}

diff  --git a/clang/test/CodeGen/attr-ifunc.cpp 
b/clang/test/CodeGen/attr-ifunc.cpp
index 5b5b2c14b4074b7..b6e342df46eb583 100644
--- a/clang/test/CodeGen/attr-ifunc.cpp
+++ b/clang/test/CodeGen/attr-ifunc.cpp
@@ -1,5 +1,9 @@
 // RUN: %clang_cc1 -triple x86_64-linux -fsyntax-only -verify -emit-llvm-only 
%s
+// RUN: %clang_cc1 -triple x86_64-apple-macosx -fsyntax-only -verify 
-emit-llvm-only %s
+// RUN: %clang_cc1 -triple arm64-apple-macosx -fsyntax-only -verify 
-emit-llvm-only %s
 // RUN: not %clang_cc1 -triple x86_64-linux -emit-llvm-only 
-fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s
+// RUN: not %clang_cc1 -triple x86_64-apple-macosx -emit-llvm-only 
-fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s
+// RUN: not %clang_cc1 -triple arm64-apple-macosx -emit-llvm-only 
-fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s
 
 void *f1_ifunc(void) { return nullptr; }
 void f1(void) __attribute__((ifunc("f1_ifunc")));

diff  --git a/clang/test/CodeGen/attr-target-clones.c 
b/clang/test/CodeGen/attr-target-clones.c
index 98ffea40f56d887..32d4d6f32f68e56 100644
--- a/clang/test/CodeGen/attr-target-clones.c
+++ b/clang/test/CodeGen/attr-target-clones.c
@@ -1,4 +1,5 @@
 // RUN: %clang_cc1 -triple x86_64-linux-gnu -emit-llvm %s -o - | FileCheck %s 
--check-prefixes=LINUX,CHECK
+// RUN: %clang_cc1 -triple x86_64-apple-macosx -emit-llvm %s -o - | FileCheck 
%s --check-prefixes=DARWIN,CHECK
 // RUN: %clang_cc1 -triple x86_64-windows-pc -emit-llvm %s -o - | FileCheck %s 
--check-prefixes=WINDOWS,CHECK
 
 // LI

[llvm-branch-commits] [llvm] [clang] [clang] Function Multi Versioning supports IFunc lowerings on Darwin platforms (PR #73688)

2023-11-29 Thread Jon Roelofs via llvm-branch-commits

https://github.com/jroelofs updated 
https://github.com/llvm/llvm-project/pull/73688


___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [clang] eafbe06 - [𝘀𝗽𝗿] changes introduced through rebase

2023-11-29 Thread Jon Roelofs via llvm-branch-commits

Author: Jon Roelofs
Date: 2023-11-29T12:23:57-08:00
New Revision: eafbe063de80818d4a9e2714bf317fa759550f39

URL: 
https://github.com/llvm/llvm-project/commit/eafbe063de80818d4a9e2714bf317fa759550f39
DIFF: 
https://github.com/llvm/llvm-project/commit/eafbe063de80818d4a9e2714bf317fa759550f39.diff

LOG: [𝘀𝗽𝗿] changes introduced through rebase

Created using spr 1.3.4

[skip ci]

Added: 


Modified: 
clang/test/CodeGen/attr-cpuspecific.c
clang/test/CodeGen/attr-ifunc.c
clang/test/CodeGen/attr-ifunc.cpp
clang/test/CodeGen/attr-target-clones.c
clang/test/CodeGen/attr-target-mv-func-ptrs.c
clang/test/CodeGen/attr-target-mv.c
clang/test/CodeGenCXX/attr-cpuspecific.cpp
clang/test/CodeGenCXX/attr-target-clones.cpp
clang/test/CodeGenCXX/attr-target-mv-diff-ns.cpp
clang/test/CodeGenCXX/attr-target-mv-func-ptrs.cpp
clang/test/CodeGenCXX/attr-target-mv-inalloca.cpp
clang/test/CodeGenCXX/attr-target-mv-member-funcs.cpp
clang/test/CodeGenCXX/attr-target-mv-modules.cpp
clang/test/CodeGenCXX/attr-target-mv-out-of-line-defs.cpp
clang/test/CodeGenCXX/attr-target-mv-overloads.cpp
clang/test/CodeGenCXX/externc-ifunc-resolver.cpp
clang/test/SemaCXX/externc-ifunc-resolver.cpp

Removed: 




diff  --git a/clang/test/CodeGen/attr-cpuspecific.c 
b/clang/test/CodeGen/attr-cpuspecific.c
index 9150597e8c5a847..5baa271b5240f0a 100644
--- a/clang/test/CodeGen/attr-cpuspecific.c
+++ b/clang/test/CodeGen/attr-cpuspecific.c
@@ -1,4 +1,5 @@
 // RUN: %clang_cc1 -triple x86_64-linux-gnu -emit-llvm -o - %s | FileCheck %s 
--check-prefixes=CHECK,LINUX
+// RUN: %clang_cc1 -triple x86_64-apple-macosx -emit-llvm -o - %s | FileCheck 
%s --check-prefixes=CHECK,LINUX
 // RUN: %clang_cc1 -triple x86_64-windows-pc -fms-compatibility -emit-llvm -o 
- %s | FileCheck %s --check-prefixes=CHECK,WINDOWS
 
 #ifdef _WIN64

diff  --git a/clang/test/CodeGen/attr-ifunc.c b/clang/test/CodeGen/attr-ifunc.c
index 4f8fe13530fdb7b..2ad41edf20dfa01 100644
--- a/clang/test/CodeGen/attr-ifunc.c
+++ b/clang/test/CodeGen/attr-ifunc.c
@@ -1,6 +1,7 @@
 // RUN: %clang_cc1 -triple x86_64-windows -fsyntax-only -verify %s
 // RUN: %clang_cc1 -triple x86_64-linux -fsyntax-only -verify -emit-llvm-only 
-DCHECK_ALIASES %s
 // RUN: %clang_cc1 -triple x86_64-linux -fsyntax-only -verify -emit-llvm-only 
%s
+// RUN: %clang_cc1 -triple x86_64-apple-macosx -fsyntax-only -verify 
-emit-llvm-only %s
 
 #if defined(_WIN32)
 void foo(void) {}
@@ -36,6 +37,25 @@ void *f6_resolver(void) 
__attribute__((ifunc("f6_resolver_resolver")));
 void f6(void) __attribute__((ifunc("f6_resolver")));
 // expected-error@-1 {{ifunc must point to a defined function}}
 
+#elif defined(__APPLE__)
+
+// NOTE: aliases are not supported on Darwin, so the above tests are not 
relevant.
+
+#define STR2(X) #X
+#define STR(X) STR2(X)
+#define PREFIX STR(__USER_LABEL_PREFIX__)
+
+void f1a(void) __asm("f1");
+void f1a(void) {}
+// expected-note@-1 {{previous definition is here}}
+void f1(void) __attribute__((ifunc(PREFIX "f1_ifunc"))) __asm("f1");
+// expected-error@-1 {{definition with same mangled name 'f1' as 
another definition}}
+void *f1_ifunc(void) { return 0; }
+
+void *f6_ifunc(int i);
+void __attribute__((ifunc(PREFIX "f6_ifunc"))) f6(void) {}
+// expected-error@-1 {{definition 'f6' cannot also be an ifunc}}
+
 #else
 void f1a(void) __asm("f1");
 void f1a(void) {}

diff  --git a/clang/test/CodeGen/attr-ifunc.cpp 
b/clang/test/CodeGen/attr-ifunc.cpp
index 5b5b2c14b4074b7..b6e342df46eb583 100644
--- a/clang/test/CodeGen/attr-ifunc.cpp
+++ b/clang/test/CodeGen/attr-ifunc.cpp
@@ -1,5 +1,9 @@
 // RUN: %clang_cc1 -triple x86_64-linux -fsyntax-only -verify -emit-llvm-only 
%s
+// RUN: %clang_cc1 -triple x86_64-apple-macosx -fsyntax-only -verify 
-emit-llvm-only %s
+// RUN: %clang_cc1 -triple arm64-apple-macosx -fsyntax-only -verify 
-emit-llvm-only %s
 // RUN: not %clang_cc1 -triple x86_64-linux -emit-llvm-only 
-fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s
+// RUN: not %clang_cc1 -triple x86_64-apple-macosx -emit-llvm-only 
-fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s
+// RUN: not %clang_cc1 -triple arm64-apple-macosx -emit-llvm-only 
-fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s
 
 void *f1_ifunc(void) { return nullptr; }
 void f1(void) __attribute__((ifunc("f1_ifunc")));

diff  --git a/clang/test/CodeGen/attr-target-clones.c 
b/clang/test/CodeGen/attr-target-clones.c
index 98ffea40f56d887..32d4d6f32f68e56 100644
--- a/clang/test/CodeGen/attr-target-clones.c
+++ b/clang/test/CodeGen/attr-target-clones.c
@@ -1,4 +1,5 @@
 // RUN: %clang_cc1 -triple x86_64-linux-gnu -emit-llvm %s -o - | FileCheck %s 
--check-prefixes=LINUX,CHECK
+// RUN: %clang_cc1 -triple x86_64-apple-macosx -emit-llvm %s -o - | FileCheck 
%s --check-prefixes=DARWIN,CHECK
 // RUN: %clang_cc1 -triple x86_64-windows-pc -emit-llvm %s -o - | FileCheck %s 
--check-prefixes=WIND

[llvm-branch-commits] [clang] b6a5fe0 - rebase

2023-11-29 Thread Jon Roelofs via llvm-branch-commits

Author: Jon Roelofs
Date: 2023-11-29T12:24:02-08:00
New Revision: b6a5fe0edbcbd6ce6d0078c6be096fd65f080b10

URL: 
https://github.com/llvm/llvm-project/commit/b6a5fe0edbcbd6ce6d0078c6be096fd65f080b10
DIFF: 
https://github.com/llvm/llvm-project/commit/b6a5fe0edbcbd6ce6d0078c6be096fd65f080b10.diff

LOG: rebase

Created using spr 1.3.4

Added: 


Modified: 
clang/test/CodeGen/attr-cpuspecific.c
clang/test/CodeGen/attr-ifunc.c
clang/test/CodeGen/attr-ifunc.cpp
clang/test/CodeGen/attr-target-clones.c
clang/test/CodeGen/attr-target-mv-func-ptrs.c
clang/test/CodeGen/attr-target-mv.c
clang/test/CodeGenCXX/attr-cpuspecific.cpp
clang/test/CodeGenCXX/attr-target-clones.cpp
clang/test/CodeGenCXX/attr-target-mv-diff-ns.cpp
clang/test/CodeGenCXX/attr-target-mv-func-ptrs.cpp
clang/test/CodeGenCXX/attr-target-mv-inalloca.cpp
clang/test/CodeGenCXX/attr-target-mv-member-funcs.cpp
clang/test/CodeGenCXX/attr-target-mv-modules.cpp
clang/test/CodeGenCXX/attr-target-mv-out-of-line-defs.cpp
clang/test/CodeGenCXX/attr-target-mv-overloads.cpp
clang/test/CodeGenCXX/externc-ifunc-resolver.cpp
clang/test/SemaCXX/externc-ifunc-resolver.cpp

Removed: 




diff  --git a/clang/test/CodeGen/attr-cpuspecific.c 
b/clang/test/CodeGen/attr-cpuspecific.c
index 9150597e8c5a847..5baa271b5240f0a 100644
--- a/clang/test/CodeGen/attr-cpuspecific.c
+++ b/clang/test/CodeGen/attr-cpuspecific.c
@@ -1,4 +1,5 @@
 // RUN: %clang_cc1 -triple x86_64-linux-gnu -emit-llvm -o - %s | FileCheck %s 
--check-prefixes=CHECK,LINUX
+// RUN: %clang_cc1 -triple x86_64-apple-macosx -emit-llvm -o - %s | FileCheck 
%s --check-prefixes=CHECK,LINUX
 // RUN: %clang_cc1 -triple x86_64-windows-pc -fms-compatibility -emit-llvm -o 
- %s | FileCheck %s --check-prefixes=CHECK,WINDOWS
 
 #ifdef _WIN64

diff  --git a/clang/test/CodeGen/attr-ifunc.c b/clang/test/CodeGen/attr-ifunc.c
index 4f8fe13530fdb7b..2ad41edf20dfa01 100644
--- a/clang/test/CodeGen/attr-ifunc.c
+++ b/clang/test/CodeGen/attr-ifunc.c
@@ -1,6 +1,7 @@
 // RUN: %clang_cc1 -triple x86_64-windows -fsyntax-only -verify %s
 // RUN: %clang_cc1 -triple x86_64-linux -fsyntax-only -verify -emit-llvm-only 
-DCHECK_ALIASES %s
 // RUN: %clang_cc1 -triple x86_64-linux -fsyntax-only -verify -emit-llvm-only 
%s
+// RUN: %clang_cc1 -triple x86_64-apple-macosx -fsyntax-only -verify 
-emit-llvm-only %s
 
 #if defined(_WIN32)
 void foo(void) {}
@@ -36,6 +37,25 @@ void *f6_resolver(void) 
__attribute__((ifunc("f6_resolver_resolver")));
 void f6(void) __attribute__((ifunc("f6_resolver")));
 // expected-error@-1 {{ifunc must point to a defined function}}
 
+#elif defined(__APPLE__)
+
+// NOTE: aliases are not supported on Darwin, so the above tests are not 
relevant.
+
+#define STR2(X) #X
+#define STR(X) STR2(X)
+#define PREFIX STR(__USER_LABEL_PREFIX__)
+
+void f1a(void) __asm("f1");
+void f1a(void) {}
+// expected-note@-1 {{previous definition is here}}
+void f1(void) __attribute__((ifunc(PREFIX "f1_ifunc"))) __asm("f1");
+// expected-error@-1 {{definition with same mangled name 'f1' as 
another definition}}
+void *f1_ifunc(void) { return 0; }
+
+void *f6_ifunc(int i);
+void __attribute__((ifunc(PREFIX "f6_ifunc"))) f6(void) {}
+// expected-error@-1 {{definition 'f6' cannot also be an ifunc}}
+
 #else
 void f1a(void) __asm("f1");
 void f1a(void) {}

diff  --git a/clang/test/CodeGen/attr-ifunc.cpp 
b/clang/test/CodeGen/attr-ifunc.cpp
index 5b5b2c14b4074b7..b6e342df46eb583 100644
--- a/clang/test/CodeGen/attr-ifunc.cpp
+++ b/clang/test/CodeGen/attr-ifunc.cpp
@@ -1,5 +1,9 @@
 // RUN: %clang_cc1 -triple x86_64-linux -fsyntax-only -verify -emit-llvm-only 
%s
+// RUN: %clang_cc1 -triple x86_64-apple-macosx -fsyntax-only -verify 
-emit-llvm-only %s
+// RUN: %clang_cc1 -triple arm64-apple-macosx -fsyntax-only -verify 
-emit-llvm-only %s
 // RUN: not %clang_cc1 -triple x86_64-linux -emit-llvm-only 
-fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s
+// RUN: not %clang_cc1 -triple x86_64-apple-macosx -emit-llvm-only 
-fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s
+// RUN: not %clang_cc1 -triple arm64-apple-macosx -emit-llvm-only 
-fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s
 
 void *f1_ifunc(void) { return nullptr; }
 void f1(void) __attribute__((ifunc("f1_ifunc")));

diff  --git a/clang/test/CodeGen/attr-target-clones.c 
b/clang/test/CodeGen/attr-target-clones.c
index 98ffea40f56d887..32d4d6f32f68e56 100644
--- a/clang/test/CodeGen/attr-target-clones.c
+++ b/clang/test/CodeGen/attr-target-clones.c
@@ -1,4 +1,5 @@
 // RUN: %clang_cc1 -triple x86_64-linux-gnu -emit-llvm %s -o - | FileCheck %s 
--check-prefixes=LINUX,CHECK
+// RUN: %clang_cc1 -triple x86_64-apple-macosx -emit-llvm %s -o - | FileCheck 
%s --check-prefixes=DARWIN,CHECK
 // RUN: %clang_cc1 -triple x86_64-windows-pc -emit-llvm %s -o - | FileCheck %s 
--check-prefixes=WINDOWS,CHECK
 
 // LINUX: $foo.resolver = comda

[llvm-branch-commits] [compiler-rt] [llvm] [clang] [builtins][arm64] Build __init_cpu_features_resolver on Apple platforms (PR #73685)

2023-11-29 Thread Jon Roelofs via llvm-branch-commits

https://github.com/jroelofs updated 
https://github.com/llvm/llvm-project/pull/73685


___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [compiler-rt] [llvm] [clang] [builtins][arm64] Build __init_cpu_features_resolver on Apple platforms (PR #73685)

2023-11-29 Thread Jon Roelofs via llvm-branch-commits

https://github.com/jroelofs updated 
https://github.com/llvm/llvm-project/pull/73685


___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [llvm] [clang] [compiler-rt] [builtins][arm64] Build __init_cpu_features_resolver on Apple platforms (PR #73685)

2023-11-29 Thread Fangrui Song via llvm-branch-commits


@@ -1259,6 +1270,64 @@ struct {
   // As features grows new fields could be added
 } __aarch64_cpu_features __attribute__((visibility("hidden"), nocommon));
 
+#if defined(__APPLE__)
+#include 
+#if TARGET_OS_OSX || TARGET_OS_IPHONE
+#include 
+#include 
+
+static bool isKnownAndSupported(const char *name) {
+  int32_t val = 0;
+  size_t size = sizeof(val);
+  if (sysctlbyname(name, &val, &size, NULL, 0))
+return false;
+  return val;
+}
+
+void __init_cpu_features_resolver(void) {
+  static dispatch_once_t onceToken = 0;
+  dispatch_once(&onceToken, ^{

MaskRay wrote:

I am not familiar with blocks. Does this introduce any dependency on libcalls? 
Can this reuse `if (__aarch64_cpu_features.features)` used by ELF?

https://github.com/llvm/llvm-project/pull/73685
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [compiler-rt] [llvm] [clang] [builtins][arm64] Build __init_cpu_features_resolver on Apple platforms (PR #73685)

2023-11-29 Thread Fangrui Song via llvm-branch-commits


@@ -1259,6 +1270,64 @@ struct {
   // As features grows new fields could be added
 } __aarch64_cpu_features __attribute__((visibility("hidden"), nocommon));
 
+#if defined(__APPLE__)
+#include 
+#if TARGET_OS_OSX || TARGET_OS_IPHONE
+#include 
+#include 
+
+static bool isKnownAndSupported(const char *name) {
+  int32_t val = 0;
+  size_t size = sizeof(val);
+  if (sysctlbyname(name, &val, &size, NULL, 0))
+return false;
+  return val;
+}
+
+void __init_cpu_features_resolver(void) {
+  static dispatch_once_t onceToken = 0;
+  dispatch_once(&onceToken, ^{
+// 
https://developer.apple.com/documentation/kernel/1387446-sysctlbyname/determining_instruction_set_characteristics
+static struct {
+  const char *sysctl_name;
+  enum CPUFeatures feature;
+} Features[] = {
+{"hw.optional.arm.FEAT_FlagM", FEAT_FLAGM},
+{"hw.optional.arm.FEAT_FlagM2", FEAT_FLAGM2},
+{"hw.optional.arm.FEAT_FHM", FEAT_FP16FML},
+{"hw.optional.arm.FEAT_DotProd", FEAT_DOTPROD},
+{"hw.optional.arm.FEAT_RDM", FEAT_RDM},
+{"hw.optional.arm.FEAT_LSE", FEAT_LSE},
+{"hw.optional.floatingpoint", FEAT_FP},
+{"hw.optional.AdvSIMD", FEAT_SIMD},
+{"hw.optional.armv8_crc32", FEAT_CRC},
+{"hw.optional.arm.FEAT_SHA1", FEAT_SHA1},
+{"hw.optional.arm.FEAT_SHA256", FEAT_SHA2},
+{"hw.optional.armv8_2_sha3", FEAT_SHA3},
+{"hw.optional.arm.FEAT_AES", FEAT_AES},
+{"hw.optional.arm.FEAT_PMULL", FEAT_PMULL},
+{"hw.optional.arm.FEAT_FP16", FEAT_FP16},
+{"hw.optional.arm.FEAT_JSCVT", FEAT_JSCVT},
+{"hw.optional.arm.FEAT_FCMA", FEAT_FCMA},
+{"hw.optional.arm.FEAT_LRCPC", FEAT_RCPC},
+{"hw.optional.arm.FEAT_LRCPC2", FEAT_RCPC2},
+{"hw.optional.arm.FEAT_FRINTTS", FEAT_FRINTTS},
+{"hw.optional.arm.FEAT_I8MM", FEAT_I8MM},
+{"hw.optional.arm.FEAT_BF16", FEAT_BF16},
+{"hw.optional.arm.FEAT_SB", FEAT_SB},
+{"hw.optional.arm.FEAT_SSBS", FEAT_SSBS2},
+{"hw.optional.arm.FEAT_BTI", FEAT_BTI},
+};
+
+for (size_t I = 0, E = sizeof(Features) / sizeof(Features[0]); I != E; ++I)

MaskRay wrote:

compiler-rt generally uses lower-case variable names.

https://github.com/llvm/llvm-project/pull/73685
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [llvm] [clang] [compiler-rt] [builtins][arm64] Build __init_cpu_features_resolver on Apple platforms (PR #73685)

2023-11-29 Thread Fangrui Song via llvm-branch-commits

https://github.com/MaskRay edited 
https://github.com/llvm/llvm-project/pull/73685
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [llvm] [compiler-rt] [clang] [builtins][arm64] Build __init_cpu_features_resolver on Apple platforms (PR #73685)

2023-11-29 Thread Fangrui Song via llvm-branch-commits

https://github.com/MaskRay approved this pull request.


https://github.com/llvm/llvm-project/pull/73685
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [llvm] [clang] [clang] Function Multi Versioning supports IFunc lowerings on Darwin platforms (PR #73688)

2023-11-29 Thread Fangrui Song via llvm-branch-commits

https://github.com/MaskRay approved this pull request.

This PR just updates `supportsIFunc` and extends clang tests. LGTM

https://github.com/llvm/llvm-project/pull/73688
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [llvm] [clang] [clang] Support __attribute__((ifunc(...))) on Darwin platforms (PR #73687)

2023-11-29 Thread Fangrui Song via llvm-branch-commits


@@ -3,6 +3,10 @@
 // RUN: %clang_cc1 -triple i386-unknown-linux-gnu -fsanitize=thread -O2 
-emit-llvm -o - %s | FileCheck %s --check-prefix=SAN
 // RUN: %clang_cc1 -triple i386-unknown-linux-gnu -fsanitize=address -O2 
-emit-llvm -o - %s | FileCheck %s --check-prefix=SAN
 // RUN: %clang_cc1 -triple i386-unknown-linux-gnu -fsanitize=memory -O2 
-emit-llvm -o - %s | FileCheck %s --check-prefix=SAN
+// RUN: %clang_cc1 -triple x86_64-apple-macosx -emit-llvm -o - %s | FileCheck 
%s
+// RUN: %clang_cc1 -triple x86_64-apple-macosx -O2 -emit-llvm -o - %s | 
FileCheck %s
+// RUN: %clang_cc1 -triple x86_64-apple-macosx -fsanitize=thread -O2 
-emit-llvm -o - %s | FileCheck %s --check-prefix=MACSAN
+// RUN: %clang_cc1 -triple x86_64-apple-macosx -fsanitize=address -O2 
-emit-llvm -o - %s | FileCheck %s --check-prefix=MACSAN

MaskRay wrote:

Consider changing one extra apple RUN line to arm64 to add some nuance.

https://github.com/llvm/llvm-project/pull/73687
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [llvm] [clang] [clang] Support __attribute__((ifunc(...))) on Darwin platforms (PR #73687)

2023-11-29 Thread Fangrui Song via llvm-branch-commits


@@ -5408,7 +5408,9 @@ considered inline.
 Not all targets support this attribute. ELF target support depends on both the
 linker and runtime linker, and is available in at least lld 4.0 and later,
 binutils 2.20.1 and later, glibc v2.11.1 and later, and FreeBSD 9.1 and later.
-Non-ELF targets currently do not support this attribute.
+MachO targets support it, but with slightly different semantics: the resolver 
is

MaskRay wrote:

In docs and comments, we prefer the canonical spelling: Mach-O

https://github.com/llvm/llvm-project/pull/73687
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [llvm] b2d46d6 - review feedback

2023-11-29 Thread Jon Roelofs via llvm-branch-commits

Author: Jon Roelofs
Date: 2023-11-29T13:56:55-08:00
New Revision: b2d46d62984b685cd94597c957708e7b5b34d671

URL: 
https://github.com/llvm/llvm-project/commit/b2d46d62984b685cd94597c957708e7b5b34d671
DIFF: 
https://github.com/llvm/llvm-project/commit/b2d46d62984b685cd94597c957708e7b5b34d671.diff

LOG: review feedback

Created using spr 1.3.4

Added: 


Modified: 
llvm/docs/LangRef.rst
llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp

Removed: 




diff  --git a/llvm/docs/LangRef.rst b/llvm/docs/LangRef.rst
index cb222e979db29d4..fece4ac7f127d6b 100644
--- a/llvm/docs/LangRef.rst
+++ b/llvm/docs/LangRef.rst
@@ -937,7 +937,7 @@ IFuncs, like as aliases, don't create any new data or func. 
They are just a new
 symbol that is resolved at runtime by calling a resolver function.
 
 On ELF platforms, IFuncs are resolved by the dynamic linker at load time. On
-MachO platforms, they are lowered in terms of ``.symbol_resolver``s, which
+Mach-O platforms, they are lowered in terms of ``.symbol_resolver``s, which
 lazily resolve the callee the first time they are called.
 
 IFunc may have an optional :ref:`linkage type ` and an optional

diff  --git a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp 
b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
index b4ac0a70e7fde9c..aaa7693c61f0e85 100644
--- a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
@@ -2321,7 +2321,7 @@ bool AsmPrinter::doFinalization(Module &M) {
   }
 
   // IFuncs must come before deubginfo in case the backend decides to emit them
-  // as actual functions, since on MachO targets, we cannot create regular
+  // as actual functions, since on Mach-O targets, we cannot create regular
   // sections after DWARF.
   for (const auto &IFunc : M.ifuncs())
 emitGlobalIFunc(M, IFunc);



___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [llvm] c259170 - [𝘀𝗽𝗿] changes introduced through rebase

2023-11-29 Thread Jon Roelofs via llvm-branch-commits

Author: Jon Roelofs
Date: 2023-11-29T13:56:58-08:00
New Revision: c259170dfdadbdadbabdc769b547d278045fc323

URL: 
https://github.com/llvm/llvm-project/commit/c259170dfdadbdadbabdc769b547d278045fc323
DIFF: 
https://github.com/llvm/llvm-project/commit/c259170dfdadbdadbabdc769b547d278045fc323.diff

LOG: [𝘀𝗽𝗿] changes introduced through rebase

Created using spr 1.3.4

[skip ci]

Added: 


Modified: 
llvm/docs/LangRef.rst
llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp

Removed: 




diff  --git a/llvm/docs/LangRef.rst b/llvm/docs/LangRef.rst
index cb222e979db29d4..fece4ac7f127d6b 100644
--- a/llvm/docs/LangRef.rst
+++ b/llvm/docs/LangRef.rst
@@ -937,7 +937,7 @@ IFuncs, like as aliases, don't create any new data or func. 
They are just a new
 symbol that is resolved at runtime by calling a resolver function.
 
 On ELF platforms, IFuncs are resolved by the dynamic linker at load time. On
-MachO platforms, they are lowered in terms of ``.symbol_resolver``s, which
+Mach-O platforms, they are lowered in terms of ``.symbol_resolver``s, which
 lazily resolve the callee the first time they are called.
 
 IFunc may have an optional :ref:`linkage type ` and an optional

diff  --git a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp 
b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
index b4ac0a70e7fde9c..aaa7693c61f0e85 100644
--- a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
@@ -2321,7 +2321,7 @@ bool AsmPrinter::doFinalization(Module &M) {
   }
 
   // IFuncs must come before deubginfo in case the backend decides to emit them
-  // as actual functions, since on MachO targets, we cannot create regular
+  // as actual functions, since on Mach-O targets, we cannot create regular
   // sections after DWARF.
   for (const auto &IFunc : M.ifuncs())
 emitGlobalIFunc(M, IFunc);



___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [llvm] edf4acd - review feedback

2023-11-29 Thread Jon Roelofs via llvm-branch-commits

Author: Jon Roelofs
Date: 2023-11-29T13:57:00-08:00
New Revision: edf4acd0884b3e96411d6def562cbd3afaada41b

URL: 
https://github.com/llvm/llvm-project/commit/edf4acd0884b3e96411d6def562cbd3afaada41b
DIFF: 
https://github.com/llvm/llvm-project/commit/edf4acd0884b3e96411d6def562cbd3afaada41b.diff

LOG: review feedback

Created using spr 1.3.4

Added: 


Modified: 
clang/include/clang/Basic/AttrDocs.td
clang/test/CodeGen/ifunc.c
llvm/docs/LangRef.rst
llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp

Removed: 




diff  --git a/clang/include/clang/Basic/AttrDocs.td 
b/clang/include/clang/Basic/AttrDocs.td
index 4c4c4eb606fb0dc..5e85ec52a4634e5 100644
--- a/clang/include/clang/Basic/AttrDocs.td
+++ b/clang/include/clang/Basic/AttrDocs.td
@@ -5408,9 +5408,9 @@ considered inline.
 Not all targets support this attribute. ELF target support depends on both the
 linker and runtime linker, and is available in at least lld 4.0 and later,
 binutils 2.20.1 and later, glibc v2.11.1 and later, and FreeBSD 9.1 and later.
-MachO targets support it, but with slightly 
diff erent semantics: the resolver is
-run at first call, instead of at load time by the runtime linker. Targets other
-than ELF and MachO currently do not support this attribute.
+Mach-O targets support it, but with slightly 
diff erent semantics: the resolver
+is run at first call, instead of at load time by the runtime linker. Targets
+other than ELF and Mach-O currently do not support this attribute.
   }];
 }
 

diff  --git a/clang/test/CodeGen/ifunc.c b/clang/test/CodeGen/ifunc.c
index 99d60dc0ea85dbd..a29b500e80bd50b 100644
--- a/clang/test/CodeGen/ifunc.c
+++ b/clang/test/CodeGen/ifunc.c
@@ -3,9 +3,13 @@
 // RUN: %clang_cc1 -triple i386-unknown-linux-gnu -fsanitize=thread -O2 
-emit-llvm -o - %s | FileCheck %s --check-prefix=SAN
 // RUN: %clang_cc1 -triple i386-unknown-linux-gnu -fsanitize=address -O2 
-emit-llvm -o - %s | FileCheck %s --check-prefix=SAN
 // RUN: %clang_cc1 -triple i386-unknown-linux-gnu -fsanitize=memory -O2 
-emit-llvm -o - %s | FileCheck %s --check-prefix=SAN
+// RUN: %clang_cc1 -triple arm64-apple-macosx -emit-llvm -o - %s | FileCheck %s
 // RUN: %clang_cc1 -triple x86_64-apple-macosx -emit-llvm -o - %s | FileCheck 
%s
+// RUN: %clang_cc1 -triple arm64-apple-macosx -O2 -emit-llvm -o - %s | 
FileCheck %s
 // RUN: %clang_cc1 -triple x86_64-apple-macosx -O2 -emit-llvm -o - %s | 
FileCheck %s
+// RUN: %clang_cc1 -triple arm64-apple-macosx -fsanitize=thread -O2 -emit-llvm 
-o - %s | FileCheck %s --check-prefix=MACSAN
 // RUN: %clang_cc1 -triple x86_64-apple-macosx -fsanitize=thread -O2 
-emit-llvm -o - %s | FileCheck %s --check-prefix=MACSAN
+// RUN: %clang_cc1 -triple arm64-apple-macosx -fsanitize=address -O2 
-emit-llvm -o - %s | FileCheck %s --check-prefix=MACSAN
 // RUN: %clang_cc1 -triple x86_64-apple-macosx -fsanitize=address -O2 
-emit-llvm -o - %s | FileCheck %s --check-prefix=MACSAN
 
 int foo(int) __attribute__ ((ifunc("foo_ifunc")));

diff  --git a/llvm/docs/LangRef.rst b/llvm/docs/LangRef.rst
index cb222e979db29d4..fece4ac7f127d6b 100644
--- a/llvm/docs/LangRef.rst
+++ b/llvm/docs/LangRef.rst
@@ -937,7 +937,7 @@ IFuncs, like as aliases, don't create any new data or func. 
They are just a new
 symbol that is resolved at runtime by calling a resolver function.
 
 On ELF platforms, IFuncs are resolved by the dynamic linker at load time. On
-MachO platforms, they are lowered in terms of ``.symbol_resolver``s, which
+Mach-O platforms, they are lowered in terms of ``.symbol_resolver``s, which
 lazily resolve the callee the first time they are called.
 
 IFunc may have an optional :ref:`linkage type ` and an optional

diff  --git a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp 
b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
index b4ac0a70e7fde9c..aaa7693c61f0e85 100644
--- a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
@@ -2321,7 +2321,7 @@ bool AsmPrinter::doFinalization(Module &M) {
   }
 
   // IFuncs must come before deubginfo in case the backend decides to emit them
-  // as actual functions, since on MachO targets, we cannot create regular
+  // as actual functions, since on Mach-O targets, we cannot create regular
   // sections after DWARF.
   for (const auto &IFunc : M.ifuncs())
 emitGlobalIFunc(M, IFunc);



___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [llvm] ecbfa04 - [𝘀𝗽𝗿] changes introduced through rebase

2023-11-29 Thread Jon Roelofs via llvm-branch-commits

Author: Jon Roelofs
Date: 2023-11-29T13:57:04-08:00
New Revision: ecbfa0495147d255964d8beeb89c8d8d80ec74a1

URL: 
https://github.com/llvm/llvm-project/commit/ecbfa0495147d255964d8beeb89c8d8d80ec74a1
DIFF: 
https://github.com/llvm/llvm-project/commit/ecbfa0495147d255964d8beeb89c8d8d80ec74a1.diff

LOG: [𝘀𝗽𝗿] changes introduced through rebase

Created using spr 1.3.4

[skip ci]

Added: 


Modified: 
clang/include/clang/Basic/AttrDocs.td
clang/test/CodeGen/ifunc.c
llvm/docs/LangRef.rst
llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp

Removed: 




diff  --git a/clang/include/clang/Basic/AttrDocs.td 
b/clang/include/clang/Basic/AttrDocs.td
index 4c4c4eb606fb0dc..5e85ec52a4634e5 100644
--- a/clang/include/clang/Basic/AttrDocs.td
+++ b/clang/include/clang/Basic/AttrDocs.td
@@ -5408,9 +5408,9 @@ considered inline.
 Not all targets support this attribute. ELF target support depends on both the
 linker and runtime linker, and is available in at least lld 4.0 and later,
 binutils 2.20.1 and later, glibc v2.11.1 and later, and FreeBSD 9.1 and later.
-MachO targets support it, but with slightly 
diff erent semantics: the resolver is
-run at first call, instead of at load time by the runtime linker. Targets other
-than ELF and MachO currently do not support this attribute.
+Mach-O targets support it, but with slightly 
diff erent semantics: the resolver
+is run at first call, instead of at load time by the runtime linker. Targets
+other than ELF and Mach-O currently do not support this attribute.
   }];
 }
 

diff  --git a/clang/test/CodeGen/ifunc.c b/clang/test/CodeGen/ifunc.c
index 99d60dc0ea85dbd..a29b500e80bd50b 100644
--- a/clang/test/CodeGen/ifunc.c
+++ b/clang/test/CodeGen/ifunc.c
@@ -3,9 +3,13 @@
 // RUN: %clang_cc1 -triple i386-unknown-linux-gnu -fsanitize=thread -O2 
-emit-llvm -o - %s | FileCheck %s --check-prefix=SAN
 // RUN: %clang_cc1 -triple i386-unknown-linux-gnu -fsanitize=address -O2 
-emit-llvm -o - %s | FileCheck %s --check-prefix=SAN
 // RUN: %clang_cc1 -triple i386-unknown-linux-gnu -fsanitize=memory -O2 
-emit-llvm -o - %s | FileCheck %s --check-prefix=SAN
+// RUN: %clang_cc1 -triple arm64-apple-macosx -emit-llvm -o - %s | FileCheck %s
 // RUN: %clang_cc1 -triple x86_64-apple-macosx -emit-llvm -o - %s | FileCheck 
%s
+// RUN: %clang_cc1 -triple arm64-apple-macosx -O2 -emit-llvm -o - %s | 
FileCheck %s
 // RUN: %clang_cc1 -triple x86_64-apple-macosx -O2 -emit-llvm -o - %s | 
FileCheck %s
+// RUN: %clang_cc1 -triple arm64-apple-macosx -fsanitize=thread -O2 -emit-llvm 
-o - %s | FileCheck %s --check-prefix=MACSAN
 // RUN: %clang_cc1 -triple x86_64-apple-macosx -fsanitize=thread -O2 
-emit-llvm -o - %s | FileCheck %s --check-prefix=MACSAN
+// RUN: %clang_cc1 -triple arm64-apple-macosx -fsanitize=address -O2 
-emit-llvm -o - %s | FileCheck %s --check-prefix=MACSAN
 // RUN: %clang_cc1 -triple x86_64-apple-macosx -fsanitize=address -O2 
-emit-llvm -o - %s | FileCheck %s --check-prefix=MACSAN
 
 int foo(int) __attribute__ ((ifunc("foo_ifunc")));

diff  --git a/llvm/docs/LangRef.rst b/llvm/docs/LangRef.rst
index cb222e979db29d4..fece4ac7f127d6b 100644
--- a/llvm/docs/LangRef.rst
+++ b/llvm/docs/LangRef.rst
@@ -937,7 +937,7 @@ IFuncs, like as aliases, don't create any new data or func. 
They are just a new
 symbol that is resolved at runtime by calling a resolver function.
 
 On ELF platforms, IFuncs are resolved by the dynamic linker at load time. On
-MachO platforms, they are lowered in terms of ``.symbol_resolver``s, which
+Mach-O platforms, they are lowered in terms of ``.symbol_resolver``s, which
 lazily resolve the callee the first time they are called.
 
 IFunc may have an optional :ref:`linkage type ` and an optional

diff  --git a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp 
b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
index b4ac0a70e7fde9c..aaa7693c61f0e85 100644
--- a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
@@ -2321,7 +2321,7 @@ bool AsmPrinter::doFinalization(Module &M) {
   }
 
   // IFuncs must come before deubginfo in case the backend decides to emit them
-  // as actual functions, since on MachO targets, we cannot create regular
+  // as actual functions, since on Mach-O targets, we cannot create regular
   // sections after DWARF.
   for (const auto &IFunc : M.ifuncs())
 emitGlobalIFunc(M, IFunc);



___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [llvm] [clang] [clang] Support __attribute__((ifunc(...))) on Darwin platforms (PR #73687)

2023-11-29 Thread Jon Roelofs via llvm-branch-commits

https://github.com/jroelofs updated 
https://github.com/llvm/llvm-project/pull/73687

>From aeb39b92bbd7670fb8c6b9e76a456a92199691b3 Mon Sep 17 00:00:00 2001
From: Jon Roelofs 
Date: Wed, 29 Nov 2023 12:23:46 -0800
Subject: [PATCH] adjust tests per review feedback

Created using spr 1.3.4
---
 clang/test/CodeGen/attr-ifunc.c   | 20 +++
 clang/test/CodeGen/attr-ifunc.cpp |  4 
 .../CodeGenCXX/externc-ifunc-resolver.cpp |  2 ++
 clang/test/SemaCXX/externc-ifunc-resolver.cpp |  4 
 4 files changed, 30 insertions(+)

diff --git a/clang/test/CodeGen/attr-ifunc.c b/clang/test/CodeGen/attr-ifunc.c
index 4f8fe13530fdb7b..2ad41edf20dfa01 100644
--- a/clang/test/CodeGen/attr-ifunc.c
+++ b/clang/test/CodeGen/attr-ifunc.c
@@ -1,6 +1,7 @@
 // RUN: %clang_cc1 -triple x86_64-windows -fsyntax-only -verify %s
 // RUN: %clang_cc1 -triple x86_64-linux -fsyntax-only -verify -emit-llvm-only 
-DCHECK_ALIASES %s
 // RUN: %clang_cc1 -triple x86_64-linux -fsyntax-only -verify -emit-llvm-only 
%s
+// RUN: %clang_cc1 -triple x86_64-apple-macosx -fsyntax-only -verify 
-emit-llvm-only %s
 
 #if defined(_WIN32)
 void foo(void) {}
@@ -36,6 +37,25 @@ void *f6_resolver(void) 
__attribute__((ifunc("f6_resolver_resolver")));
 void f6(void) __attribute__((ifunc("f6_resolver")));
 // expected-error@-1 {{ifunc must point to a defined function}}
 
+#elif defined(__APPLE__)
+
+// NOTE: aliases are not supported on Darwin, so the above tests are not 
relevant.
+
+#define STR2(X) #X
+#define STR(X) STR2(X)
+#define PREFIX STR(__USER_LABEL_PREFIX__)
+
+void f1a(void) __asm("f1");
+void f1a(void) {}
+// expected-note@-1 {{previous definition is here}}
+void f1(void) __attribute__((ifunc(PREFIX "f1_ifunc"))) __asm("f1");
+// expected-error@-1 {{definition with same mangled name 'f1' as 
another definition}}
+void *f1_ifunc(void) { return 0; }
+
+void *f6_ifunc(int i);
+void __attribute__((ifunc(PREFIX "f6_ifunc"))) f6(void) {}
+// expected-error@-1 {{definition 'f6' cannot also be an ifunc}}
+
 #else
 void f1a(void) __asm("f1");
 void f1a(void) {}
diff --git a/clang/test/CodeGen/attr-ifunc.cpp 
b/clang/test/CodeGen/attr-ifunc.cpp
index 5b5b2c14b4074b7..b6e342df46eb583 100644
--- a/clang/test/CodeGen/attr-ifunc.cpp
+++ b/clang/test/CodeGen/attr-ifunc.cpp
@@ -1,5 +1,9 @@
 // RUN: %clang_cc1 -triple x86_64-linux -fsyntax-only -verify -emit-llvm-only 
%s
+// RUN: %clang_cc1 -triple x86_64-apple-macosx -fsyntax-only -verify 
-emit-llvm-only %s
+// RUN: %clang_cc1 -triple arm64-apple-macosx -fsyntax-only -verify 
-emit-llvm-only %s
 // RUN: not %clang_cc1 -triple x86_64-linux -emit-llvm-only 
-fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s
+// RUN: not %clang_cc1 -triple x86_64-apple-macosx -emit-llvm-only 
-fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s
+// RUN: not %clang_cc1 -triple arm64-apple-macosx -emit-llvm-only 
-fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s
 
 void *f1_ifunc(void) { return nullptr; }
 void f1(void) __attribute__((ifunc("f1_ifunc")));
diff --git a/clang/test/CodeGenCXX/externc-ifunc-resolver.cpp 
b/clang/test/CodeGenCXX/externc-ifunc-resolver.cpp
index 0518a8dcc831dd4..be4453ae7eb08ce 100644
--- a/clang/test/CodeGenCXX/externc-ifunc-resolver.cpp
+++ b/clang/test/CodeGenCXX/externc-ifunc-resolver.cpp
@@ -1,4 +1,6 @@
 // RUN: %clang_cc1 -triple x86_64-linux-gnu -emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -triple x86_64-apple-macosx -emit-llvm -o - %s | FileCheck 
%s
+// RUN: %clang_cc1 -triple arm64-apple-macosx -emit-llvm -o - %s | FileCheck %s
 
 extern "C" {
 __attribute__((used)) static void *resolve_foo() { return 0; }
diff --git a/clang/test/SemaCXX/externc-ifunc-resolver.cpp 
b/clang/test/SemaCXX/externc-ifunc-resolver.cpp
index aa44525bde2cae1..6c6c262c5f09d8e 100644
--- a/clang/test/SemaCXX/externc-ifunc-resolver.cpp
+++ b/clang/test/SemaCXX/externc-ifunc-resolver.cpp
@@ -1,5 +1,9 @@
 // RUN: %clang_cc1 -emit-llvm-only -triple x86_64-linux-gnu -verify %s
+// RUN: %clang_cc1 -emit-llvm-only -triple x86_64-apple-macosx -verify %s
+// RUN: %clang_cc1 -emit-llvm-only -triple arm64-apple-macosx -verify %s
 // RUN: not %clang_cc1 -triple x86_64-linux -emit-llvm-only 
-fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s
+// RUN: not %clang_cc1 -triple x86_64-apple-macosx -emit-llvm-only 
-fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s
+// RUN: not %clang_cc1 -triple arm64-apple-macosx -emit-llvm-only 
-fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s
 
 extern "C" {
 __attribute__((used)) static void *resolve_foo() { return 0; }

___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [llvm] 6329152 - review feedback

2023-11-29 Thread Jon Roelofs via llvm-branch-commits

Author: Jon Roelofs
Date: 2023-11-29T13:57:05-08:00
New Revision: 6329152b1afd30cc065ccb2e4d3a1e6f11040b7f

URL: 
https://github.com/llvm/llvm-project/commit/6329152b1afd30cc065ccb2e4d3a1e6f11040b7f
DIFF: 
https://github.com/llvm/llvm-project/commit/6329152b1afd30cc065ccb2e4d3a1e6f11040b7f.diff

LOG: review feedback

Created using spr 1.3.4

Added: 


Modified: 
clang/include/clang/Basic/AttrDocs.td
clang/test/CodeGen/ifunc.c
llvm/docs/LangRef.rst
llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp

Removed: 




diff  --git a/clang/include/clang/Basic/AttrDocs.td 
b/clang/include/clang/Basic/AttrDocs.td
index 4c4c4eb606fb0dc..5e85ec52a4634e5 100644
--- a/clang/include/clang/Basic/AttrDocs.td
+++ b/clang/include/clang/Basic/AttrDocs.td
@@ -5408,9 +5408,9 @@ considered inline.
 Not all targets support this attribute. ELF target support depends on both the
 linker and runtime linker, and is available in at least lld 4.0 and later,
 binutils 2.20.1 and later, glibc v2.11.1 and later, and FreeBSD 9.1 and later.
-MachO targets support it, but with slightly 
diff erent semantics: the resolver is
-run at first call, instead of at load time by the runtime linker. Targets other
-than ELF and MachO currently do not support this attribute.
+Mach-O targets support it, but with slightly 
diff erent semantics: the resolver
+is run at first call, instead of at load time by the runtime linker. Targets
+other than ELF and Mach-O currently do not support this attribute.
   }];
 }
 

diff  --git a/clang/test/CodeGen/ifunc.c b/clang/test/CodeGen/ifunc.c
index 99d60dc0ea85dbd..a29b500e80bd50b 100644
--- a/clang/test/CodeGen/ifunc.c
+++ b/clang/test/CodeGen/ifunc.c
@@ -3,9 +3,13 @@
 // RUN: %clang_cc1 -triple i386-unknown-linux-gnu -fsanitize=thread -O2 
-emit-llvm -o - %s | FileCheck %s --check-prefix=SAN
 // RUN: %clang_cc1 -triple i386-unknown-linux-gnu -fsanitize=address -O2 
-emit-llvm -o - %s | FileCheck %s --check-prefix=SAN
 // RUN: %clang_cc1 -triple i386-unknown-linux-gnu -fsanitize=memory -O2 
-emit-llvm -o - %s | FileCheck %s --check-prefix=SAN
+// RUN: %clang_cc1 -triple arm64-apple-macosx -emit-llvm -o - %s | FileCheck %s
 // RUN: %clang_cc1 -triple x86_64-apple-macosx -emit-llvm -o - %s | FileCheck 
%s
+// RUN: %clang_cc1 -triple arm64-apple-macosx -O2 -emit-llvm -o - %s | 
FileCheck %s
 // RUN: %clang_cc1 -triple x86_64-apple-macosx -O2 -emit-llvm -o - %s | 
FileCheck %s
+// RUN: %clang_cc1 -triple arm64-apple-macosx -fsanitize=thread -O2 -emit-llvm 
-o - %s | FileCheck %s --check-prefix=MACSAN
 // RUN: %clang_cc1 -triple x86_64-apple-macosx -fsanitize=thread -O2 
-emit-llvm -o - %s | FileCheck %s --check-prefix=MACSAN
+// RUN: %clang_cc1 -triple arm64-apple-macosx -fsanitize=address -O2 
-emit-llvm -o - %s | FileCheck %s --check-prefix=MACSAN
 // RUN: %clang_cc1 -triple x86_64-apple-macosx -fsanitize=address -O2 
-emit-llvm -o - %s | FileCheck %s --check-prefix=MACSAN
 
 int foo(int) __attribute__ ((ifunc("foo_ifunc")));

diff  --git a/llvm/docs/LangRef.rst b/llvm/docs/LangRef.rst
index cb222e979db29d4..fece4ac7f127d6b 100644
--- a/llvm/docs/LangRef.rst
+++ b/llvm/docs/LangRef.rst
@@ -937,7 +937,7 @@ IFuncs, like as aliases, don't create any new data or func. 
They are just a new
 symbol that is resolved at runtime by calling a resolver function.
 
 On ELF platforms, IFuncs are resolved by the dynamic linker at load time. On
-MachO platforms, they are lowered in terms of ``.symbol_resolver``s, which
+Mach-O platforms, they are lowered in terms of ``.symbol_resolver``s, which
 lazily resolve the callee the first time they are called.
 
 IFunc may have an optional :ref:`linkage type ` and an optional

diff  --git a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp 
b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
index b4ac0a70e7fde9c..aaa7693c61f0e85 100644
--- a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
@@ -2321,7 +2321,7 @@ bool AsmPrinter::doFinalization(Module &M) {
   }
 
   // IFuncs must come before deubginfo in case the backend decides to emit them
-  // as actual functions, since on MachO targets, we cannot create regular
+  // as actual functions, since on Mach-O targets, we cannot create regular
   // sections after DWARF.
   for (const auto &IFunc : M.ifuncs())
 emitGlobalIFunc(M, IFunc);



___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [llvm] [clang] [clang] Support __attribute__((ifunc(...))) on Darwin platforms (PR #73687)

2023-11-29 Thread Jon Roelofs via llvm-branch-commits

https://github.com/jroelofs updated 
https://github.com/llvm/llvm-project/pull/73687

>From aeb39b92bbd7670fb8c6b9e76a456a92199691b3 Mon Sep 17 00:00:00 2001
From: Jon Roelofs 
Date: Wed, 29 Nov 2023 12:23:46 -0800
Subject: [PATCH] adjust tests per review feedback

Created using spr 1.3.4
---
 clang/test/CodeGen/attr-ifunc.c   | 20 +++
 clang/test/CodeGen/attr-ifunc.cpp |  4 
 .../CodeGenCXX/externc-ifunc-resolver.cpp |  2 ++
 clang/test/SemaCXX/externc-ifunc-resolver.cpp |  4 
 4 files changed, 30 insertions(+)

diff --git a/clang/test/CodeGen/attr-ifunc.c b/clang/test/CodeGen/attr-ifunc.c
index 4f8fe13530fdb7b..2ad41edf20dfa01 100644
--- a/clang/test/CodeGen/attr-ifunc.c
+++ b/clang/test/CodeGen/attr-ifunc.c
@@ -1,6 +1,7 @@
 // RUN: %clang_cc1 -triple x86_64-windows -fsyntax-only -verify %s
 // RUN: %clang_cc1 -triple x86_64-linux -fsyntax-only -verify -emit-llvm-only 
-DCHECK_ALIASES %s
 // RUN: %clang_cc1 -triple x86_64-linux -fsyntax-only -verify -emit-llvm-only 
%s
+// RUN: %clang_cc1 -triple x86_64-apple-macosx -fsyntax-only -verify 
-emit-llvm-only %s
 
 #if defined(_WIN32)
 void foo(void) {}
@@ -36,6 +37,25 @@ void *f6_resolver(void) 
__attribute__((ifunc("f6_resolver_resolver")));
 void f6(void) __attribute__((ifunc("f6_resolver")));
 // expected-error@-1 {{ifunc must point to a defined function}}
 
+#elif defined(__APPLE__)
+
+// NOTE: aliases are not supported on Darwin, so the above tests are not 
relevant.
+
+#define STR2(X) #X
+#define STR(X) STR2(X)
+#define PREFIX STR(__USER_LABEL_PREFIX__)
+
+void f1a(void) __asm("f1");
+void f1a(void) {}
+// expected-note@-1 {{previous definition is here}}
+void f1(void) __attribute__((ifunc(PREFIX "f1_ifunc"))) __asm("f1");
+// expected-error@-1 {{definition with same mangled name 'f1' as 
another definition}}
+void *f1_ifunc(void) { return 0; }
+
+void *f6_ifunc(int i);
+void __attribute__((ifunc(PREFIX "f6_ifunc"))) f6(void) {}
+// expected-error@-1 {{definition 'f6' cannot also be an ifunc}}
+
 #else
 void f1a(void) __asm("f1");
 void f1a(void) {}
diff --git a/clang/test/CodeGen/attr-ifunc.cpp 
b/clang/test/CodeGen/attr-ifunc.cpp
index 5b5b2c14b4074b7..b6e342df46eb583 100644
--- a/clang/test/CodeGen/attr-ifunc.cpp
+++ b/clang/test/CodeGen/attr-ifunc.cpp
@@ -1,5 +1,9 @@
 // RUN: %clang_cc1 -triple x86_64-linux -fsyntax-only -verify -emit-llvm-only 
%s
+// RUN: %clang_cc1 -triple x86_64-apple-macosx -fsyntax-only -verify 
-emit-llvm-only %s
+// RUN: %clang_cc1 -triple arm64-apple-macosx -fsyntax-only -verify 
-emit-llvm-only %s
 // RUN: not %clang_cc1 -triple x86_64-linux -emit-llvm-only 
-fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s
+// RUN: not %clang_cc1 -triple x86_64-apple-macosx -emit-llvm-only 
-fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s
+// RUN: not %clang_cc1 -triple arm64-apple-macosx -emit-llvm-only 
-fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s
 
 void *f1_ifunc(void) { return nullptr; }
 void f1(void) __attribute__((ifunc("f1_ifunc")));
diff --git a/clang/test/CodeGenCXX/externc-ifunc-resolver.cpp 
b/clang/test/CodeGenCXX/externc-ifunc-resolver.cpp
index 0518a8dcc831dd4..be4453ae7eb08ce 100644
--- a/clang/test/CodeGenCXX/externc-ifunc-resolver.cpp
+++ b/clang/test/CodeGenCXX/externc-ifunc-resolver.cpp
@@ -1,4 +1,6 @@
 // RUN: %clang_cc1 -triple x86_64-linux-gnu -emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -triple x86_64-apple-macosx -emit-llvm -o - %s | FileCheck 
%s
+// RUN: %clang_cc1 -triple arm64-apple-macosx -emit-llvm -o - %s | FileCheck %s
 
 extern "C" {
 __attribute__((used)) static void *resolve_foo() { return 0; }
diff --git a/clang/test/SemaCXX/externc-ifunc-resolver.cpp 
b/clang/test/SemaCXX/externc-ifunc-resolver.cpp
index aa44525bde2cae1..6c6c262c5f09d8e 100644
--- a/clang/test/SemaCXX/externc-ifunc-resolver.cpp
+++ b/clang/test/SemaCXX/externc-ifunc-resolver.cpp
@@ -1,5 +1,9 @@
 // RUN: %clang_cc1 -emit-llvm-only -triple x86_64-linux-gnu -verify %s
+// RUN: %clang_cc1 -emit-llvm-only -triple x86_64-apple-macosx -verify %s
+// RUN: %clang_cc1 -emit-llvm-only -triple arm64-apple-macosx -verify %s
 // RUN: not %clang_cc1 -triple x86_64-linux -emit-llvm-only 
-fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s
+// RUN: not %clang_cc1 -triple x86_64-apple-macosx -emit-llvm-only 
-fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s
+// RUN: not %clang_cc1 -triple arm64-apple-macosx -emit-llvm-only 
-fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s
 
 extern "C" {
 __attribute__((used)) static void *resolve_foo() { return 0; }

___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [llvm] [clang] [clang] Function Multi Versioning supports IFunc lowerings on Darwin platforms (PR #73688)

2023-11-29 Thread Jon Roelofs via llvm-branch-commits

https://github.com/jroelofs updated 
https://github.com/llvm/llvm-project/pull/73688


___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [llvm] [clang] [clang] Function Multi Versioning supports IFunc lowerings on Darwin platforms (PR #73688)

2023-11-29 Thread Jon Roelofs via llvm-branch-commits

https://github.com/jroelofs updated 
https://github.com/llvm/llvm-project/pull/73688


___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [llvm] 63df438 - review feedback

2023-11-29 Thread Jon Roelofs via llvm-branch-commits

Author: Jon Roelofs
Date: 2023-11-29T13:57:14-08:00
New Revision: 63df4386d435230e93175d8c73254f65cfe173fa

URL: 
https://github.com/llvm/llvm-project/commit/63df4386d435230e93175d8c73254f65cfe173fa
DIFF: 
https://github.com/llvm/llvm-project/commit/63df4386d435230e93175d8c73254f65cfe173fa.diff

LOG: review feedback

Created using spr 1.3.4

Added: 


Modified: 
clang/include/clang/Basic/AttrDocs.td
clang/test/CodeGen/ifunc.c
compiler-rt/lib/builtins/cpu_model.c
llvm/docs/LangRef.rst
llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp

Removed: 




diff  --git a/clang/include/clang/Basic/AttrDocs.td 
b/clang/include/clang/Basic/AttrDocs.td
index 4c4c4eb606fb0dc..5e85ec52a4634e5 100644
--- a/clang/include/clang/Basic/AttrDocs.td
+++ b/clang/include/clang/Basic/AttrDocs.td
@@ -5408,9 +5408,9 @@ considered inline.
 Not all targets support this attribute. ELF target support depends on both the
 linker and runtime linker, and is available in at least lld 4.0 and later,
 binutils 2.20.1 and later, glibc v2.11.1 and later, and FreeBSD 9.1 and later.
-MachO targets support it, but with slightly 
diff erent semantics: the resolver is
-run at first call, instead of at load time by the runtime linker. Targets other
-than ELF and MachO currently do not support this attribute.
+Mach-O targets support it, but with slightly 
diff erent semantics: the resolver
+is run at first call, instead of at load time by the runtime linker. Targets
+other than ELF and Mach-O currently do not support this attribute.
   }];
 }
 

diff  --git a/clang/test/CodeGen/ifunc.c b/clang/test/CodeGen/ifunc.c
index 99d60dc0ea85dbd..a29b500e80bd50b 100644
--- a/clang/test/CodeGen/ifunc.c
+++ b/clang/test/CodeGen/ifunc.c
@@ -3,9 +3,13 @@
 // RUN: %clang_cc1 -triple i386-unknown-linux-gnu -fsanitize=thread -O2 
-emit-llvm -o - %s | FileCheck %s --check-prefix=SAN
 // RUN: %clang_cc1 -triple i386-unknown-linux-gnu -fsanitize=address -O2 
-emit-llvm -o - %s | FileCheck %s --check-prefix=SAN
 // RUN: %clang_cc1 -triple i386-unknown-linux-gnu -fsanitize=memory -O2 
-emit-llvm -o - %s | FileCheck %s --check-prefix=SAN
+// RUN: %clang_cc1 -triple arm64-apple-macosx -emit-llvm -o - %s | FileCheck %s
 // RUN: %clang_cc1 -triple x86_64-apple-macosx -emit-llvm -o - %s | FileCheck 
%s
+// RUN: %clang_cc1 -triple arm64-apple-macosx -O2 -emit-llvm -o - %s | 
FileCheck %s
 // RUN: %clang_cc1 -triple x86_64-apple-macosx -O2 -emit-llvm -o - %s | 
FileCheck %s
+// RUN: %clang_cc1 -triple arm64-apple-macosx -fsanitize=thread -O2 -emit-llvm 
-o - %s | FileCheck %s --check-prefix=MACSAN
 // RUN: %clang_cc1 -triple x86_64-apple-macosx -fsanitize=thread -O2 
-emit-llvm -o - %s | FileCheck %s --check-prefix=MACSAN
+// RUN: %clang_cc1 -triple arm64-apple-macosx -fsanitize=address -O2 
-emit-llvm -o - %s | FileCheck %s --check-prefix=MACSAN
 // RUN: %clang_cc1 -triple x86_64-apple-macosx -fsanitize=address -O2 
-emit-llvm -o - %s | FileCheck %s --check-prefix=MACSAN
 
 int foo(int) __attribute__ ((ifunc("foo_ifunc")));

diff  --git a/compiler-rt/lib/builtins/cpu_model.c 
b/compiler-rt/lib/builtins/cpu_model.c
index b0306f5f36baabf..5f5182859080c49 100644
--- a/compiler-rt/lib/builtins/cpu_model.c
+++ b/compiler-rt/lib/builtins/cpu_model.c
@@ -1291,7 +1291,7 @@ void __init_cpu_features_resolver(void) {
 static struct {
   const char *sysctl_name;
   enum CPUFeatures feature;
-} Features[] = {
+} features[] = {
 {"hw.optional.arm.FEAT_FlagM", FEAT_FLAGM},
 {"hw.optional.arm.FEAT_FlagM2", FEAT_FLAGM2},
 {"hw.optional.arm.FEAT_FHM", FEAT_FP16FML},
@@ -1319,9 +1319,9 @@ void __init_cpu_features_resolver(void) {
 {"hw.optional.arm.FEAT_BTI", FEAT_BTI},
 };
 
-for (size_t I = 0, E = sizeof(Features) / sizeof(Features[0]); I != E; ++I)
-  if (isKnownAndSupported(Features[I].sysctl_name))
-__aarch64_cpu_features.features |= (1ULL << Features[I].feature);
+for (size_t I = 0, E = sizeof(features) / sizeof(features[0]); I != E; ++I)
+  if (isKnownAndSupported(features[I].sysctl_name))
+__aarch64_cpu_features.features |= (1ULL << features[I].feature);
 
 __aarch64_cpu_features.features |= (1ULL << FEAT_INIT);
   });

diff  --git a/llvm/docs/LangRef.rst b/llvm/docs/LangRef.rst
index cb222e979db29d4..fece4ac7f127d6b 100644
--- a/llvm/docs/LangRef.rst
+++ b/llvm/docs/LangRef.rst
@@ -937,7 +937,7 @@ IFuncs, like as aliases, don't create any new data or func. 
They are just a new
 symbol that is resolved at runtime by calling a resolver function.
 
 On ELF platforms, IFuncs are resolved by the dynamic linker at load time. On
-MachO platforms, they are lowered in terms of ``.symbol_resolver``s, which
+Mach-O platforms, they are lowered in terms of ``.symbol_resolver``s, which
 lazily resolve the callee the first time they are called.
 
 IFunc may have an optional :ref:`linkage type ` and an optional

di

[llvm-branch-commits] [llvm] 97e7926 - [𝘀𝗽𝗿] changes introduced through rebase

2023-11-29 Thread Jon Roelofs via llvm-branch-commits

Author: Jon Roelofs
Date: 2023-11-29T13:57:10-08:00
New Revision: 97e7926f25d81fb6c6d87202f721c2e2cf6198f5

URL: 
https://github.com/llvm/llvm-project/commit/97e7926f25d81fb6c6d87202f721c2e2cf6198f5
DIFF: 
https://github.com/llvm/llvm-project/commit/97e7926f25d81fb6c6d87202f721c2e2cf6198f5.diff

LOG: [𝘀𝗽𝗿] changes introduced through rebase

Created using spr 1.3.4

[skip ci]

Added: 


Modified: 
clang/include/clang/Basic/AttrDocs.td
clang/test/CodeGen/ifunc.c
llvm/docs/LangRef.rst
llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp

Removed: 




diff  --git a/clang/include/clang/Basic/AttrDocs.td 
b/clang/include/clang/Basic/AttrDocs.td
index 4c4c4eb606fb0dc..5e85ec52a4634e5 100644
--- a/clang/include/clang/Basic/AttrDocs.td
+++ b/clang/include/clang/Basic/AttrDocs.td
@@ -5408,9 +5408,9 @@ considered inline.
 Not all targets support this attribute. ELF target support depends on both the
 linker and runtime linker, and is available in at least lld 4.0 and later,
 binutils 2.20.1 and later, glibc v2.11.1 and later, and FreeBSD 9.1 and later.
-MachO targets support it, but with slightly 
diff erent semantics: the resolver is
-run at first call, instead of at load time by the runtime linker. Targets other
-than ELF and MachO currently do not support this attribute.
+Mach-O targets support it, but with slightly 
diff erent semantics: the resolver
+is run at first call, instead of at load time by the runtime linker. Targets
+other than ELF and Mach-O currently do not support this attribute.
   }];
 }
 

diff  --git a/clang/test/CodeGen/ifunc.c b/clang/test/CodeGen/ifunc.c
index 99d60dc0ea85dbd..a29b500e80bd50b 100644
--- a/clang/test/CodeGen/ifunc.c
+++ b/clang/test/CodeGen/ifunc.c
@@ -3,9 +3,13 @@
 // RUN: %clang_cc1 -triple i386-unknown-linux-gnu -fsanitize=thread -O2 
-emit-llvm -o - %s | FileCheck %s --check-prefix=SAN
 // RUN: %clang_cc1 -triple i386-unknown-linux-gnu -fsanitize=address -O2 
-emit-llvm -o - %s | FileCheck %s --check-prefix=SAN
 // RUN: %clang_cc1 -triple i386-unknown-linux-gnu -fsanitize=memory -O2 
-emit-llvm -o - %s | FileCheck %s --check-prefix=SAN
+// RUN: %clang_cc1 -triple arm64-apple-macosx -emit-llvm -o - %s | FileCheck %s
 // RUN: %clang_cc1 -triple x86_64-apple-macosx -emit-llvm -o - %s | FileCheck 
%s
+// RUN: %clang_cc1 -triple arm64-apple-macosx -O2 -emit-llvm -o - %s | 
FileCheck %s
 // RUN: %clang_cc1 -triple x86_64-apple-macosx -O2 -emit-llvm -o - %s | 
FileCheck %s
+// RUN: %clang_cc1 -triple arm64-apple-macosx -fsanitize=thread -O2 -emit-llvm 
-o - %s | FileCheck %s --check-prefix=MACSAN
 // RUN: %clang_cc1 -triple x86_64-apple-macosx -fsanitize=thread -O2 
-emit-llvm -o - %s | FileCheck %s --check-prefix=MACSAN
+// RUN: %clang_cc1 -triple arm64-apple-macosx -fsanitize=address -O2 
-emit-llvm -o - %s | FileCheck %s --check-prefix=MACSAN
 // RUN: %clang_cc1 -triple x86_64-apple-macosx -fsanitize=address -O2 
-emit-llvm -o - %s | FileCheck %s --check-prefix=MACSAN
 
 int foo(int) __attribute__ ((ifunc("foo_ifunc")));

diff  --git a/llvm/docs/LangRef.rst b/llvm/docs/LangRef.rst
index cb222e979db29d4..fece4ac7f127d6b 100644
--- a/llvm/docs/LangRef.rst
+++ b/llvm/docs/LangRef.rst
@@ -937,7 +937,7 @@ IFuncs, like as aliases, don't create any new data or func. 
They are just a new
 symbol that is resolved at runtime by calling a resolver function.
 
 On ELF platforms, IFuncs are resolved by the dynamic linker at load time. On
-MachO platforms, they are lowered in terms of ``.symbol_resolver``s, which
+Mach-O platforms, they are lowered in terms of ``.symbol_resolver``s, which
 lazily resolve the callee the first time they are called.
 
 IFunc may have an optional :ref:`linkage type ` and an optional

diff  --git a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp 
b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
index b4ac0a70e7fde9c..aaa7693c61f0e85 100644
--- a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
@@ -2321,7 +2321,7 @@ bool AsmPrinter::doFinalization(Module &M) {
   }
 
   // IFuncs must come before deubginfo in case the backend decides to emit them
-  // as actual functions, since on MachO targets, we cannot create regular
+  // as actual functions, since on Mach-O targets, we cannot create regular
   // sections after DWARF.
   for (const auto &IFunc : M.ifuncs())
 emitGlobalIFunc(M, IFunc);



___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [compiler-rt] [llvm] [clang] [builtins][arm64] Build __init_cpu_features_resolver on Apple platforms (PR #73685)

2023-11-29 Thread Jon Roelofs via llvm-branch-commits

https://github.com/jroelofs updated 
https://github.com/llvm/llvm-project/pull/73685


___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [llvm] [compiler-rt] [clang] [builtins][arm64] Build __init_cpu_features_resolver on Apple platforms (PR #73685)

2023-11-29 Thread Jon Roelofs via llvm-branch-commits

https://github.com/jroelofs updated 
https://github.com/llvm/llvm-project/pull/73685


___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [llvm] e6af9ea - fix docs build

2023-11-29 Thread Jon Roelofs via llvm-branch-commits

Author: Jon Roelofs
Date: 2023-11-29T14:07:49-08:00
New Revision: e6af9eaa469fa0f2cf3b1df7ec80bed3c2354cbe

URL: 
https://github.com/llvm/llvm-project/commit/e6af9eaa469fa0f2cf3b1df7ec80bed3c2354cbe
DIFF: 
https://github.com/llvm/llvm-project/commit/e6af9eaa469fa0f2cf3b1df7ec80bed3c2354cbe.diff

LOG: fix docs build

Created using spr 1.3.4

Added: 


Modified: 
llvm/docs/LangRef.rst

Removed: 




diff  --git a/llvm/docs/LangRef.rst b/llvm/docs/LangRef.rst
index fece4ac7f127d6b..51c60ecf5ac6586 100644
--- a/llvm/docs/LangRef.rst
+++ b/llvm/docs/LangRef.rst
@@ -937,8 +937,8 @@ IFuncs, like as aliases, don't create any new data or func. 
They are just a new
 symbol that is resolved at runtime by calling a resolver function.
 
 On ELF platforms, IFuncs are resolved by the dynamic linker at load time. On
-Mach-O platforms, they are lowered in terms of ``.symbol_resolver``s, which
-lazily resolve the callee the first time they are called.
+Mach-O platforms, they are lowered in terms of ``.symbol_resolver`` functions,
+which lazily resolve the callee the first time they are called.
 
 IFunc may have an optional :ref:`linkage type ` and an optional
 :ref:`visibility style `.



___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [llvm] 8825586 - [𝘀𝗽𝗿] changes introduced through rebase

2023-11-29 Thread Jon Roelofs via llvm-branch-commits

Author: Jon Roelofs
Date: 2023-11-29T14:07:53-08:00
New Revision: 88255861a604165f81a29c8f69b3e16e6c0b74a3

URL: 
https://github.com/llvm/llvm-project/commit/88255861a604165f81a29c8f69b3e16e6c0b74a3
DIFF: 
https://github.com/llvm/llvm-project/commit/88255861a604165f81a29c8f69b3e16e6c0b74a3.diff

LOG: [𝘀𝗽𝗿] changes introduced through rebase

Created using spr 1.3.4

[skip ci]

Added: 


Modified: 
llvm/docs/LangRef.rst

Removed: 




diff  --git a/llvm/docs/LangRef.rst b/llvm/docs/LangRef.rst
index fece4ac7f127d6b..51c60ecf5ac6586 100644
--- a/llvm/docs/LangRef.rst
+++ b/llvm/docs/LangRef.rst
@@ -937,8 +937,8 @@ IFuncs, like as aliases, don't create any new data or func. 
They are just a new
 symbol that is resolved at runtime by calling a resolver function.
 
 On ELF platforms, IFuncs are resolved by the dynamic linker at load time. On
-Mach-O platforms, they are lowered in terms of ``.symbol_resolver``s, which
-lazily resolve the callee the first time they are called.
+Mach-O platforms, they are lowered in terms of ``.symbol_resolver`` functions,
+which lazily resolve the callee the first time they are called.
 
 IFunc may have an optional :ref:`linkage type ` and an optional
 :ref:`visibility style `.



___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [llvm] 2b76795 - [𝘀𝗽𝗿] changes introduced through rebase

2023-11-29 Thread Jon Roelofs via llvm-branch-commits

Author: Jon Roelofs
Date: 2023-11-29T14:08:00-08:00
New Revision: 2b7679544836b2c0ef98f07395a6bfc9e0a5c202

URL: 
https://github.com/llvm/llvm-project/commit/2b7679544836b2c0ef98f07395a6bfc9e0a5c202
DIFF: 
https://github.com/llvm/llvm-project/commit/2b7679544836b2c0ef98f07395a6bfc9e0a5c202.diff

LOG: [𝘀𝗽𝗿] changes introduced through rebase

Created using spr 1.3.4

[skip ci]

Added: 


Modified: 
llvm/docs/LangRef.rst

Removed: 




diff  --git a/llvm/docs/LangRef.rst b/llvm/docs/LangRef.rst
index fece4ac7f127d6b..51c60ecf5ac6586 100644
--- a/llvm/docs/LangRef.rst
+++ b/llvm/docs/LangRef.rst
@@ -937,8 +937,8 @@ IFuncs, like as aliases, don't create any new data or func. 
They are just a new
 symbol that is resolved at runtime by calling a resolver function.
 
 On ELF platforms, IFuncs are resolved by the dynamic linker at load time. On
-Mach-O platforms, they are lowered in terms of ``.symbol_resolver``s, which
-lazily resolve the callee the first time they are called.
+Mach-O platforms, they are lowered in terms of ``.symbol_resolver`` functions,
+which lazily resolve the callee the first time they are called.
 
 IFunc may have an optional :ref:`linkage type ` and an optional
 :ref:`visibility style `.



___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [llvm] 80f3bd6 - rebase

2023-11-29 Thread Jon Roelofs via llvm-branch-commits

Author: Jon Roelofs
Date: 2023-11-29T14:07:56-08:00
New Revision: 80f3bd69873471d40beef116a694d19a133b4959

URL: 
https://github.com/llvm/llvm-project/commit/80f3bd69873471d40beef116a694d19a133b4959
DIFF: 
https://github.com/llvm/llvm-project/commit/80f3bd69873471d40beef116a694d19a133b4959.diff

LOG: rebase

Created using spr 1.3.4

Added: 


Modified: 
llvm/docs/LangRef.rst

Removed: 




diff  --git a/llvm/docs/LangRef.rst b/llvm/docs/LangRef.rst
index fece4ac7f127d6b..51c60ecf5ac6586 100644
--- a/llvm/docs/LangRef.rst
+++ b/llvm/docs/LangRef.rst
@@ -937,8 +937,8 @@ IFuncs, like as aliases, don't create any new data or func. 
They are just a new
 symbol that is resolved at runtime by calling a resolver function.
 
 On ELF platforms, IFuncs are resolved by the dynamic linker at load time. On
-Mach-O platforms, they are lowered in terms of ``.symbol_resolver``s, which
-lazily resolve the callee the first time they are called.
+Mach-O platforms, they are lowered in terms of ``.symbol_resolver`` functions,
+which lazily resolve the callee the first time they are called.
 
 IFunc may have an optional :ref:`linkage type ` and an optional
 :ref:`visibility style `.



___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [llvm] ad2f207 - rebase

2023-11-29 Thread Jon Roelofs via llvm-branch-commits

Author: Jon Roelofs
Date: 2023-11-29T14:08:01-08:00
New Revision: ad2f207e251797ba1ac0abc945589dff4228ce8f

URL: 
https://github.com/llvm/llvm-project/commit/ad2f207e251797ba1ac0abc945589dff4228ce8f
DIFF: 
https://github.com/llvm/llvm-project/commit/ad2f207e251797ba1ac0abc945589dff4228ce8f.diff

LOG: rebase

Created using spr 1.3.4

Added: 


Modified: 
llvm/docs/LangRef.rst

Removed: 




diff  --git a/llvm/docs/LangRef.rst b/llvm/docs/LangRef.rst
index fece4ac7f127d6b..51c60ecf5ac6586 100644
--- a/llvm/docs/LangRef.rst
+++ b/llvm/docs/LangRef.rst
@@ -937,8 +937,8 @@ IFuncs, like as aliases, don't create any new data or func. 
They are just a new
 symbol that is resolved at runtime by calling a resolver function.
 
 On ELF platforms, IFuncs are resolved by the dynamic linker at load time. On
-Mach-O platforms, they are lowered in terms of ``.symbol_resolver``s, which
-lazily resolve the callee the first time they are called.
+Mach-O platforms, they are lowered in terms of ``.symbol_resolver`` functions,
+which lazily resolve the callee the first time they are called.
 
 IFunc may have an optional :ref:`linkage type ` and an optional
 :ref:`visibility style `.



___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [llvm] b3ed2e9 - [𝘀𝗽𝗿] changes introduced through rebase

2023-11-29 Thread Jon Roelofs via llvm-branch-commits

Author: Jon Roelofs
Date: 2023-11-29T14:08:05-08:00
New Revision: b3ed2e9abc371f37b35f77d4d7f93d4673e5f333

URL: 
https://github.com/llvm/llvm-project/commit/b3ed2e9abc371f37b35f77d4d7f93d4673e5f333
DIFF: 
https://github.com/llvm/llvm-project/commit/b3ed2e9abc371f37b35f77d4d7f93d4673e5f333.diff

LOG: [𝘀𝗽𝗿] changes introduced through rebase

Created using spr 1.3.4

[skip ci]

Added: 


Modified: 
llvm/docs/LangRef.rst

Removed: 




diff  --git a/llvm/docs/LangRef.rst b/llvm/docs/LangRef.rst
index fece4ac7f127d6b..51c60ecf5ac6586 100644
--- a/llvm/docs/LangRef.rst
+++ b/llvm/docs/LangRef.rst
@@ -937,8 +937,8 @@ IFuncs, like as aliases, don't create any new data or func. 
They are just a new
 symbol that is resolved at runtime by calling a resolver function.
 
 On ELF platforms, IFuncs are resolved by the dynamic linker at load time. On
-Mach-O platforms, they are lowered in terms of ``.symbol_resolver``s, which
-lazily resolve the callee the first time they are called.
+Mach-O platforms, they are lowered in terms of ``.symbol_resolver`` functions,
+which lazily resolve the callee the first time they are called.
 
 IFunc may have an optional :ref:`linkage type ` and an optional
 :ref:`visibility style `.



___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [clang] [llvm] [clang] Support __attribute__((ifunc(...))) on Darwin platforms (PR #73687)

2023-11-29 Thread Jon Roelofs via llvm-branch-commits

https://github.com/jroelofs updated 
https://github.com/llvm/llvm-project/pull/73687

>From aeb39b92bbd7670fb8c6b9e76a456a92199691b3 Mon Sep 17 00:00:00 2001
From: Jon Roelofs 
Date: Wed, 29 Nov 2023 12:23:46 -0800
Subject: [PATCH] adjust tests per review feedback

Created using spr 1.3.4
---
 clang/test/CodeGen/attr-ifunc.c   | 20 +++
 clang/test/CodeGen/attr-ifunc.cpp |  4 
 .../CodeGenCXX/externc-ifunc-resolver.cpp |  2 ++
 clang/test/SemaCXX/externc-ifunc-resolver.cpp |  4 
 4 files changed, 30 insertions(+)

diff --git a/clang/test/CodeGen/attr-ifunc.c b/clang/test/CodeGen/attr-ifunc.c
index 4f8fe13530fdb7b..2ad41edf20dfa01 100644
--- a/clang/test/CodeGen/attr-ifunc.c
+++ b/clang/test/CodeGen/attr-ifunc.c
@@ -1,6 +1,7 @@
 // RUN: %clang_cc1 -triple x86_64-windows -fsyntax-only -verify %s
 // RUN: %clang_cc1 -triple x86_64-linux -fsyntax-only -verify -emit-llvm-only 
-DCHECK_ALIASES %s
 // RUN: %clang_cc1 -triple x86_64-linux -fsyntax-only -verify -emit-llvm-only 
%s
+// RUN: %clang_cc1 -triple x86_64-apple-macosx -fsyntax-only -verify 
-emit-llvm-only %s
 
 #if defined(_WIN32)
 void foo(void) {}
@@ -36,6 +37,25 @@ void *f6_resolver(void) 
__attribute__((ifunc("f6_resolver_resolver")));
 void f6(void) __attribute__((ifunc("f6_resolver")));
 // expected-error@-1 {{ifunc must point to a defined function}}
 
+#elif defined(__APPLE__)
+
+// NOTE: aliases are not supported on Darwin, so the above tests are not 
relevant.
+
+#define STR2(X) #X
+#define STR(X) STR2(X)
+#define PREFIX STR(__USER_LABEL_PREFIX__)
+
+void f1a(void) __asm("f1");
+void f1a(void) {}
+// expected-note@-1 {{previous definition is here}}
+void f1(void) __attribute__((ifunc(PREFIX "f1_ifunc"))) __asm("f1");
+// expected-error@-1 {{definition with same mangled name 'f1' as 
another definition}}
+void *f1_ifunc(void) { return 0; }
+
+void *f6_ifunc(int i);
+void __attribute__((ifunc(PREFIX "f6_ifunc"))) f6(void) {}
+// expected-error@-1 {{definition 'f6' cannot also be an ifunc}}
+
 #else
 void f1a(void) __asm("f1");
 void f1a(void) {}
diff --git a/clang/test/CodeGen/attr-ifunc.cpp 
b/clang/test/CodeGen/attr-ifunc.cpp
index 5b5b2c14b4074b7..b6e342df46eb583 100644
--- a/clang/test/CodeGen/attr-ifunc.cpp
+++ b/clang/test/CodeGen/attr-ifunc.cpp
@@ -1,5 +1,9 @@
 // RUN: %clang_cc1 -triple x86_64-linux -fsyntax-only -verify -emit-llvm-only 
%s
+// RUN: %clang_cc1 -triple x86_64-apple-macosx -fsyntax-only -verify 
-emit-llvm-only %s
+// RUN: %clang_cc1 -triple arm64-apple-macosx -fsyntax-only -verify 
-emit-llvm-only %s
 // RUN: not %clang_cc1 -triple x86_64-linux -emit-llvm-only 
-fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s
+// RUN: not %clang_cc1 -triple x86_64-apple-macosx -emit-llvm-only 
-fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s
+// RUN: not %clang_cc1 -triple arm64-apple-macosx -emit-llvm-only 
-fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s
 
 void *f1_ifunc(void) { return nullptr; }
 void f1(void) __attribute__((ifunc("f1_ifunc")));
diff --git a/clang/test/CodeGenCXX/externc-ifunc-resolver.cpp 
b/clang/test/CodeGenCXX/externc-ifunc-resolver.cpp
index 0518a8dcc831dd4..be4453ae7eb08ce 100644
--- a/clang/test/CodeGenCXX/externc-ifunc-resolver.cpp
+++ b/clang/test/CodeGenCXX/externc-ifunc-resolver.cpp
@@ -1,4 +1,6 @@
 // RUN: %clang_cc1 -triple x86_64-linux-gnu -emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -triple x86_64-apple-macosx -emit-llvm -o - %s | FileCheck 
%s
+// RUN: %clang_cc1 -triple arm64-apple-macosx -emit-llvm -o - %s | FileCheck %s
 
 extern "C" {
 __attribute__((used)) static void *resolve_foo() { return 0; }
diff --git a/clang/test/SemaCXX/externc-ifunc-resolver.cpp 
b/clang/test/SemaCXX/externc-ifunc-resolver.cpp
index aa44525bde2cae1..6c6c262c5f09d8e 100644
--- a/clang/test/SemaCXX/externc-ifunc-resolver.cpp
+++ b/clang/test/SemaCXX/externc-ifunc-resolver.cpp
@@ -1,5 +1,9 @@
 // RUN: %clang_cc1 -emit-llvm-only -triple x86_64-linux-gnu -verify %s
+// RUN: %clang_cc1 -emit-llvm-only -triple x86_64-apple-macosx -verify %s
+// RUN: %clang_cc1 -emit-llvm-only -triple arm64-apple-macosx -verify %s
 // RUN: not %clang_cc1 -triple x86_64-linux -emit-llvm-only 
-fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s
+// RUN: not %clang_cc1 -triple x86_64-apple-macosx -emit-llvm-only 
-fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s
+// RUN: not %clang_cc1 -triple arm64-apple-macosx -emit-llvm-only 
-fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s
 
 extern "C" {
 __attribute__((used)) static void *resolve_foo() { return 0; }

___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [llvm] [clang] [clang] Function Multi Versioning supports IFunc lowerings on Darwin platforms (PR #73688)

2023-11-29 Thread Jon Roelofs via llvm-branch-commits

https://github.com/jroelofs updated 
https://github.com/llvm/llvm-project/pull/73688


___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [llvm] [clang] [clang] Function Multi Versioning supports IFunc lowerings on Darwin platforms (PR #73688)

2023-11-29 Thread Jon Roelofs via llvm-branch-commits

https://github.com/jroelofs updated 
https://github.com/llvm/llvm-project/pull/73688


___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [llvm] ee558d7 - rebase

2023-11-29 Thread Jon Roelofs via llvm-branch-commits

Author: Jon Roelofs
Date: 2023-11-29T14:08:06-08:00
New Revision: ee558d7441ec003979409071f2968fbbb6b0c173

URL: 
https://github.com/llvm/llvm-project/commit/ee558d7441ec003979409071f2968fbbb6b0c173
DIFF: 
https://github.com/llvm/llvm-project/commit/ee558d7441ec003979409071f2968fbbb6b0c173.diff

LOG: rebase

Created using spr 1.3.4

Added: 


Modified: 
llvm/docs/LangRef.rst

Removed: 




diff  --git a/llvm/docs/LangRef.rst b/llvm/docs/LangRef.rst
index fece4ac7f127d6b..51c60ecf5ac6586 100644
--- a/llvm/docs/LangRef.rst
+++ b/llvm/docs/LangRef.rst
@@ -937,8 +937,8 @@ IFuncs, like as aliases, don't create any new data or func. 
They are just a new
 symbol that is resolved at runtime by calling a resolver function.
 
 On ELF platforms, IFuncs are resolved by the dynamic linker at load time. On
-Mach-O platforms, they are lowered in terms of ``.symbol_resolver``s, which
-lazily resolve the callee the first time they are called.
+Mach-O platforms, they are lowered in terms of ``.symbol_resolver`` functions,
+which lazily resolve the callee the first time they are called.
 
 IFunc may have an optional :ref:`linkage type ` and an optional
 :ref:`visibility style `.



___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [compiler-rt] [clang] [llvm] [builtins][arm64] Build __init_cpu_features_resolver on Apple platforms (PR #73685)

2023-11-29 Thread Jon Roelofs via llvm-branch-commits

https://github.com/jroelofs updated 
https://github.com/llvm/llvm-project/pull/73685


___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [clang] [llvm] [compiler-rt] [builtins][arm64] Build __init_cpu_features_resolver on Apple platforms (PR #73685)

2023-11-29 Thread Jon Roelofs via llvm-branch-commits

https://github.com/jroelofs updated 
https://github.com/llvm/llvm-project/pull/73685


___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [clang] [llvm] [compiler-rt] [builtins][arm64] Build __init_cpu_features_resolver on Apple platforms (PR #73685)

2023-11-29 Thread Fangrui Song via llvm-branch-commits


@@ -1259,6 +1270,64 @@ struct {
   // As features grows new fields could be added
 } __aarch64_cpu_features __attribute__((visibility("hidden"), nocommon));
 
+#if defined(__APPLE__)
+#include 
+#if TARGET_OS_OSX || TARGET_OS_IPHONE
+#include 
+#include 
+
+static bool isKnownAndSupported(const char *name) {
+  int32_t val = 0;
+  size_t size = sizeof(val);
+  if (sysctlbyname(name, &val, &size, NULL, 0))
+return false;
+  return val;
+}
+
+void __init_cpu_features_resolver(void) {
+  static dispatch_once_t onceToken = 0;
+  dispatch_once(&onceToken, ^{

MaskRay wrote:

Thanks for the explanation. If `__init_cpu_features_resolver` can be called 
concurrently, I think it is worth a comment, since the other `__init_*` 
functions are guaranteed to be very early in the program startup sequence and 
is serial.

https://github.com/llvm/llvm-project/pull/73685
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [llvm] [compiler-rt] [clang] fixup! [builtins][arm64] Build __init_cpu_features_resolver on Apple platforms (PR #73862)

2023-11-29 Thread Jon Roelofs via llvm-branch-commits

https://github.com/jroelofs created 
https://github.com/llvm/llvm-project/pull/73862

None


___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [compiler-rt] 603983e - add a note about the dispatch_once block

2023-11-29 Thread Jon Roelofs via llvm-branch-commits

Author: Jon Roelofs
Date: 2023-11-29T14:21:54-08:00
New Revision: 603983e237e73b2d939bf9ee12e39ecc7983f7f1

URL: 
https://github.com/llvm/llvm-project/commit/603983e237e73b2d939bf9ee12e39ecc7983f7f1
DIFF: 
https://github.com/llvm/llvm-project/commit/603983e237e73b2d939bf9ee12e39ecc7983f7f1.diff

LOG: add a note about the dispatch_once block

Created using spr 1.3.4

Added: 


Modified: 
compiler-rt/lib/builtins/cpu_model.c

Removed: 




diff  --git a/compiler-rt/lib/builtins/cpu_model.c 
b/compiler-rt/lib/builtins/cpu_model.c
index 5f5182859080c49..001467a9f7ff511 100644
--- a/compiler-rt/lib/builtins/cpu_model.c
+++ b/compiler-rt/lib/builtins/cpu_model.c
@@ -1285,6 +1285,14 @@ static bool isKnownAndSupported(const char *name) {
 }
 
 void __init_cpu_features_resolver(void) {
+  // On Darwin platforms, this may be called concurrently by multiple threads
+  // because the resolvers that use it are called lazily at runtime (unlike on
+  // ELF platforms, where IFuncs are resolved serially at load time).  This
+  // function's effect on __aarch64_cpu_features should be idempotent, but even
+  // so we need dispatch_once to resolve the race condition.  Dispatch is
+  // available through libSystem, which we need anyway for the sysctl, so this
+  // does not add a new dependency.
+
   static dispatch_once_t onceToken = 0;
   dispatch_once(&onceToken, ^{
 // 
https://developer.apple.com/documentation/kernel/1387446-sysctlbyname/determining_instruction_set_characteristics



___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [llvm] [compiler-rt] [clang] [builtins][arm64] Build __init_cpu_features_resolver on Apple platforms (PR #73685)

2023-11-29 Thread Jon Roelofs via llvm-branch-commits

https://github.com/jroelofs updated 
https://github.com/llvm/llvm-project/pull/73685

>From 603983e237e73b2d939bf9ee12e39ecc7983f7f1 Mon Sep 17 00:00:00 2001
From: Jon Roelofs 
Date: Wed, 29 Nov 2023 14:21:54 -0800
Subject: [PATCH] add a note about the dispatch_once block

Created using spr 1.3.4
---
 compiler-rt/lib/builtins/cpu_model.c | 8 
 1 file changed, 8 insertions(+)

diff --git a/compiler-rt/lib/builtins/cpu_model.c 
b/compiler-rt/lib/builtins/cpu_model.c
index 5f5182859080c49..001467a9f7ff511 100644
--- a/compiler-rt/lib/builtins/cpu_model.c
+++ b/compiler-rt/lib/builtins/cpu_model.c
@@ -1285,6 +1285,14 @@ static bool isKnownAndSupported(const char *name) {
 }
 
 void __init_cpu_features_resolver(void) {
+  // On Darwin platforms, this may be called concurrently by multiple threads
+  // because the resolvers that use it are called lazily at runtime (unlike on
+  // ELF platforms, where IFuncs are resolved serially at load time).  This
+  // function's effect on __aarch64_cpu_features should be idempotent, but even
+  // so we need dispatch_once to resolve the race condition.  Dispatch is
+  // available through libSystem, which we need anyway for the sysctl, so this
+  // does not add a new dependency.
+
   static dispatch_once_t onceToken = 0;
   dispatch_once(&onceToken, ^{
 // 
https://developer.apple.com/documentation/kernel/1387446-sysctlbyname/determining_instruction_set_characteristics

___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [clang] [llvm] [compiler-rt] fixup! [builtins][arm64] Build __init_cpu_features_resolver on Apple platforms (PR #73862)

2023-11-29 Thread Jon Roelofs via llvm-branch-commits

https://github.com/jroelofs closed 
https://github.com/llvm/llvm-project/pull/73862
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [llvm] [compiler-rt] [clang] fixup! [builtins][arm64] Build __init_cpu_features_resolver on Apple platforms (PR #73862)

2023-11-29 Thread Jon Roelofs via llvm-branch-commits

jroelofs wrote:

Oops. Didn't mean to open this as a PR.

https://github.com/llvm/llvm-project/pull/73862
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [llvm] a9cc93c - align data pointer

2023-11-29 Thread Jon Roelofs via llvm-branch-commits

Author: Jon Roelofs
Date: 2023-11-29T15:19:14-08:00
New Revision: a9cc93c37fba9e40df0d983f1990908cc31dfe76

URL: 
https://github.com/llvm/llvm-project/commit/a9cc93c37fba9e40df0d983f1990908cc31dfe76
DIFF: 
https://github.com/llvm/llvm-project/commit/a9cc93c37fba9e40df0d983f1990908cc31dfe76.diff

LOG: align data pointer

Created using spr 1.3.4

Added: 


Modified: 
llvm/lib/Target/AArch64/AArch64AsmPrinter.cpp
llvm/lib/Target/X86/X86AsmPrinter.cpp
llvm/test/CodeGen/AArch64/ifunc-asm.ll
llvm/test/CodeGen/X86/ifunc-asm.ll

Removed: 




diff  --git a/llvm/lib/Target/AArch64/AArch64AsmPrinter.cpp 
b/llvm/lib/Target/AArch64/AArch64AsmPrinter.cpp
index 1b5b7c556c79f6b..a3513ca439ac261 100644
--- a/llvm/lib/Target/AArch64/AArch64AsmPrinter.cpp
+++ b/llvm/lib/Target/AArch64/AArch64AsmPrinter.cpp
@@ -1905,6 +1905,7 @@ void AArch64AsmPrinter::emitManualSymbolResolver(Module 
&M,
   //   .quad _ifunc.stub_helper
 
   EmitLinkage(LazyPointer);
+  OutStreamer->emitValueToAlignment(Align(8), /*Value=*/0);
   OutStreamer->emitLabel(LazyPointer);
   emitVisibility(LazyPointer, GI.getVisibility());
   OutStreamer->emitValue(MCSymbolRefExpr::create(StubHelper, OutContext), 8);

diff  --git a/llvm/lib/Target/X86/X86AsmPrinter.cpp 
b/llvm/lib/Target/X86/X86AsmPrinter.cpp
index b0f4b9d98437284..a490d775abd551e 100644
--- a/llvm/lib/Target/X86/X86AsmPrinter.cpp
+++ b/llvm/lib/Target/X86/X86AsmPrinter.cpp
@@ -558,6 +558,7 @@ void X86AsmPrinter::emitGlobalIFunc(Module &M, const 
GlobalIFunc &GI) {
   //  .quad _ifunc.stub_helper
 
   EmitLinkage(LazyPointer);
+  OutStreamer->emitValueToAlignment(Align(8), /*Value=*/0);
   OutStreamer->emitLabel(LazyPointer);
   emitVisibility(LazyPointer, GI.getVisibility());
   OutStreamer->emitValue(MCSymbolRefExpr::create(StubHelper, OutContext), 8);

diff  --git a/llvm/test/CodeGen/AArch64/ifunc-asm.ll 
b/llvm/test/CodeGen/AArch64/ifunc-asm.ll
index ede669aa52703f7..7eff692da83ff90 100644
--- a/llvm/test/CodeGen/AArch64/ifunc-asm.ll
+++ b/llvm/test/CodeGen/AArch64/ifunc-asm.ll
@@ -35,6 +35,7 @@ entry:
 
 ; MACHO-MANUAL:   .section __DATA,__data
 ; MACHO-MANUAL-NEXT:  .globl _global_ifunc.lazy_pointer
+; MACHO-MANUAL-NEXT:  .p2align 3, 0x0
 ; MACHO-MANUAL-NEXT:  _global_ifunc.lazy_pointer:
 ; MACHO-MANUAL-NEXT:  .quad _global_ifunc.stub_helper
 

diff  --git a/llvm/test/CodeGen/X86/ifunc-asm.ll 
b/llvm/test/CodeGen/X86/ifunc-asm.ll
index 0f66febbe95b2da..39c326bc6b6c37c 100644
--- a/llvm/test/CodeGen/X86/ifunc-asm.ll
+++ b/llvm/test/CodeGen/X86/ifunc-asm.ll
@@ -19,6 +19,7 @@ entry:
 
 ; MACHO:   .section __DATA,__data
 ; MACHO-NEXT:  .globl _foo_ifunc.lazy_pointer
+; MACHO-NEXT:  .p2align 3, 0x0
 ; MACHO-NEXT:  _foo_ifunc.lazy_pointer:
 ; MACHO-NEXT:  .quad _foo_ifunc.stub_helper
 ; MACHO-NEXT:  .section __TEXT,__text,regular,pure_instructions



___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [llvm] 520912e - [𝘀𝗽𝗿] changes introduced through rebase

2023-11-29 Thread Jon Roelofs via llvm-branch-commits

Author: Jon Roelofs
Date: 2023-11-29T15:19:17-08:00
New Revision: 520912ee41aa82e60b69034f2fc76f78b39649b2

URL: 
https://github.com/llvm/llvm-project/commit/520912ee41aa82e60b69034f2fc76f78b39649b2
DIFF: 
https://github.com/llvm/llvm-project/commit/520912ee41aa82e60b69034f2fc76f78b39649b2.diff

LOG: [𝘀𝗽𝗿] changes introduced through rebase

Created using spr 1.3.4

[skip ci]

Added: 


Modified: 
llvm/lib/Target/AArch64/AArch64AsmPrinter.cpp
llvm/lib/Target/X86/X86AsmPrinter.cpp
llvm/test/CodeGen/AArch64/ifunc-asm.ll
llvm/test/CodeGen/X86/ifunc-asm.ll

Removed: 




diff  --git a/llvm/lib/Target/AArch64/AArch64AsmPrinter.cpp 
b/llvm/lib/Target/AArch64/AArch64AsmPrinter.cpp
index 1b5b7c556c79f6b..a3513ca439ac261 100644
--- a/llvm/lib/Target/AArch64/AArch64AsmPrinter.cpp
+++ b/llvm/lib/Target/AArch64/AArch64AsmPrinter.cpp
@@ -1905,6 +1905,7 @@ void AArch64AsmPrinter::emitManualSymbolResolver(Module 
&M,
   //   .quad _ifunc.stub_helper
 
   EmitLinkage(LazyPointer);
+  OutStreamer->emitValueToAlignment(Align(8), /*Value=*/0);
   OutStreamer->emitLabel(LazyPointer);
   emitVisibility(LazyPointer, GI.getVisibility());
   OutStreamer->emitValue(MCSymbolRefExpr::create(StubHelper, OutContext), 8);

diff  --git a/llvm/lib/Target/X86/X86AsmPrinter.cpp 
b/llvm/lib/Target/X86/X86AsmPrinter.cpp
index b0f4b9d98437284..a490d775abd551e 100644
--- a/llvm/lib/Target/X86/X86AsmPrinter.cpp
+++ b/llvm/lib/Target/X86/X86AsmPrinter.cpp
@@ -558,6 +558,7 @@ void X86AsmPrinter::emitGlobalIFunc(Module &M, const 
GlobalIFunc &GI) {
   //  .quad _ifunc.stub_helper
 
   EmitLinkage(LazyPointer);
+  OutStreamer->emitValueToAlignment(Align(8), /*Value=*/0);
   OutStreamer->emitLabel(LazyPointer);
   emitVisibility(LazyPointer, GI.getVisibility());
   OutStreamer->emitValue(MCSymbolRefExpr::create(StubHelper, OutContext), 8);

diff  --git a/llvm/test/CodeGen/AArch64/ifunc-asm.ll 
b/llvm/test/CodeGen/AArch64/ifunc-asm.ll
index ede669aa52703f7..7eff692da83ff90 100644
--- a/llvm/test/CodeGen/AArch64/ifunc-asm.ll
+++ b/llvm/test/CodeGen/AArch64/ifunc-asm.ll
@@ -35,6 +35,7 @@ entry:
 
 ; MACHO-MANUAL:   .section __DATA,__data
 ; MACHO-MANUAL-NEXT:  .globl _global_ifunc.lazy_pointer
+; MACHO-MANUAL-NEXT:  .p2align 3, 0x0
 ; MACHO-MANUAL-NEXT:  _global_ifunc.lazy_pointer:
 ; MACHO-MANUAL-NEXT:  .quad _global_ifunc.stub_helper
 

diff  --git a/llvm/test/CodeGen/X86/ifunc-asm.ll 
b/llvm/test/CodeGen/X86/ifunc-asm.ll
index 0f66febbe95b2da..39c326bc6b6c37c 100644
--- a/llvm/test/CodeGen/X86/ifunc-asm.ll
+++ b/llvm/test/CodeGen/X86/ifunc-asm.ll
@@ -19,6 +19,7 @@ entry:
 
 ; MACHO:   .section __DATA,__data
 ; MACHO-NEXT:  .globl _foo_ifunc.lazy_pointer
+; MACHO-NEXT:  .p2align 3, 0x0
 ; MACHO-NEXT:  _foo_ifunc.lazy_pointer:
 ; MACHO-NEXT:  .quad _foo_ifunc.stub_helper
 ; MACHO-NEXT:  .section __TEXT,__text,regular,pure_instructions



___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [llvm] ed97a63 - rebase

2023-11-29 Thread Jon Roelofs via llvm-branch-commits

Author: Jon Roelofs
Date: 2023-11-29T15:19:22-08:00
New Revision: ed97a63ab3f75a9701817ff30d87dedde05e7ee1

URL: 
https://github.com/llvm/llvm-project/commit/ed97a63ab3f75a9701817ff30d87dedde05e7ee1
DIFF: 
https://github.com/llvm/llvm-project/commit/ed97a63ab3f75a9701817ff30d87dedde05e7ee1.diff

LOG: rebase

Created using spr 1.3.4

Added: 


Modified: 
llvm/lib/Target/AArch64/AArch64AsmPrinter.cpp
llvm/lib/Target/X86/X86AsmPrinter.cpp
llvm/test/CodeGen/AArch64/ifunc-asm.ll
llvm/test/CodeGen/X86/ifunc-asm.ll

Removed: 




diff  --git a/llvm/lib/Target/AArch64/AArch64AsmPrinter.cpp 
b/llvm/lib/Target/AArch64/AArch64AsmPrinter.cpp
index 1b5b7c556c79f6b..a3513ca439ac261 100644
--- a/llvm/lib/Target/AArch64/AArch64AsmPrinter.cpp
+++ b/llvm/lib/Target/AArch64/AArch64AsmPrinter.cpp
@@ -1905,6 +1905,7 @@ void AArch64AsmPrinter::emitManualSymbolResolver(Module 
&M,
   //   .quad _ifunc.stub_helper
 
   EmitLinkage(LazyPointer);
+  OutStreamer->emitValueToAlignment(Align(8), /*Value=*/0);
   OutStreamer->emitLabel(LazyPointer);
   emitVisibility(LazyPointer, GI.getVisibility());
   OutStreamer->emitValue(MCSymbolRefExpr::create(StubHelper, OutContext), 8);

diff  --git a/llvm/lib/Target/X86/X86AsmPrinter.cpp 
b/llvm/lib/Target/X86/X86AsmPrinter.cpp
index b0f4b9d98437284..a490d775abd551e 100644
--- a/llvm/lib/Target/X86/X86AsmPrinter.cpp
+++ b/llvm/lib/Target/X86/X86AsmPrinter.cpp
@@ -558,6 +558,7 @@ void X86AsmPrinter::emitGlobalIFunc(Module &M, const 
GlobalIFunc &GI) {
   //  .quad _ifunc.stub_helper
 
   EmitLinkage(LazyPointer);
+  OutStreamer->emitValueToAlignment(Align(8), /*Value=*/0);
   OutStreamer->emitLabel(LazyPointer);
   emitVisibility(LazyPointer, GI.getVisibility());
   OutStreamer->emitValue(MCSymbolRefExpr::create(StubHelper, OutContext), 8);

diff  --git a/llvm/test/CodeGen/AArch64/ifunc-asm.ll 
b/llvm/test/CodeGen/AArch64/ifunc-asm.ll
index ede669aa52703f7..7eff692da83ff90 100644
--- a/llvm/test/CodeGen/AArch64/ifunc-asm.ll
+++ b/llvm/test/CodeGen/AArch64/ifunc-asm.ll
@@ -35,6 +35,7 @@ entry:
 
 ; MACHO-MANUAL:   .section __DATA,__data
 ; MACHO-MANUAL-NEXT:  .globl _global_ifunc.lazy_pointer
+; MACHO-MANUAL-NEXT:  .p2align 3, 0x0
 ; MACHO-MANUAL-NEXT:  _global_ifunc.lazy_pointer:
 ; MACHO-MANUAL-NEXT:  .quad _global_ifunc.stub_helper
 

diff  --git a/llvm/test/CodeGen/X86/ifunc-asm.ll 
b/llvm/test/CodeGen/X86/ifunc-asm.ll
index 0f66febbe95b2da..39c326bc6b6c37c 100644
--- a/llvm/test/CodeGen/X86/ifunc-asm.ll
+++ b/llvm/test/CodeGen/X86/ifunc-asm.ll
@@ -19,6 +19,7 @@ entry:
 
 ; MACHO:   .section __DATA,__data
 ; MACHO-NEXT:  .globl _foo_ifunc.lazy_pointer
+; MACHO-NEXT:  .p2align 3, 0x0
 ; MACHO-NEXT:  _foo_ifunc.lazy_pointer:
 ; MACHO-NEXT:  .quad _foo_ifunc.stub_helper
 ; MACHO-NEXT:  .section __TEXT,__text,regular,pure_instructions



___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [llvm] 71fc16e - rebase

2023-11-29 Thread Jon Roelofs via llvm-branch-commits

Author: Jon Roelofs
Date: 2023-11-29T15:19:26-08:00
New Revision: 71fc16ef873360f6460b05cd5a13b0e6e6c248ab

URL: 
https://github.com/llvm/llvm-project/commit/71fc16ef873360f6460b05cd5a13b0e6e6c248ab
DIFF: 
https://github.com/llvm/llvm-project/commit/71fc16ef873360f6460b05cd5a13b0e6e6c248ab.diff

LOG: rebase

Created using spr 1.3.4

Added: 


Modified: 
llvm/lib/Target/AArch64/AArch64AsmPrinter.cpp
llvm/lib/Target/X86/X86AsmPrinter.cpp
llvm/test/CodeGen/AArch64/ifunc-asm.ll
llvm/test/CodeGen/X86/ifunc-asm.ll

Removed: 




diff  --git a/llvm/lib/Target/AArch64/AArch64AsmPrinter.cpp 
b/llvm/lib/Target/AArch64/AArch64AsmPrinter.cpp
index 1b5b7c556c79f6b..a3513ca439ac261 100644
--- a/llvm/lib/Target/AArch64/AArch64AsmPrinter.cpp
+++ b/llvm/lib/Target/AArch64/AArch64AsmPrinter.cpp
@@ -1905,6 +1905,7 @@ void AArch64AsmPrinter::emitManualSymbolResolver(Module 
&M,
   //   .quad _ifunc.stub_helper
 
   EmitLinkage(LazyPointer);
+  OutStreamer->emitValueToAlignment(Align(8), /*Value=*/0);
   OutStreamer->emitLabel(LazyPointer);
   emitVisibility(LazyPointer, GI.getVisibility());
   OutStreamer->emitValue(MCSymbolRefExpr::create(StubHelper, OutContext), 8);

diff  --git a/llvm/lib/Target/X86/X86AsmPrinter.cpp 
b/llvm/lib/Target/X86/X86AsmPrinter.cpp
index b0f4b9d98437284..a490d775abd551e 100644
--- a/llvm/lib/Target/X86/X86AsmPrinter.cpp
+++ b/llvm/lib/Target/X86/X86AsmPrinter.cpp
@@ -558,6 +558,7 @@ void X86AsmPrinter::emitGlobalIFunc(Module &M, const 
GlobalIFunc &GI) {
   //  .quad _ifunc.stub_helper
 
   EmitLinkage(LazyPointer);
+  OutStreamer->emitValueToAlignment(Align(8), /*Value=*/0);
   OutStreamer->emitLabel(LazyPointer);
   emitVisibility(LazyPointer, GI.getVisibility());
   OutStreamer->emitValue(MCSymbolRefExpr::create(StubHelper, OutContext), 8);

diff  --git a/llvm/test/CodeGen/AArch64/ifunc-asm.ll 
b/llvm/test/CodeGen/AArch64/ifunc-asm.ll
index ede669aa52703f7..7eff692da83ff90 100644
--- a/llvm/test/CodeGen/AArch64/ifunc-asm.ll
+++ b/llvm/test/CodeGen/AArch64/ifunc-asm.ll
@@ -35,6 +35,7 @@ entry:
 
 ; MACHO-MANUAL:   .section __DATA,__data
 ; MACHO-MANUAL-NEXT:  .globl _global_ifunc.lazy_pointer
+; MACHO-MANUAL-NEXT:  .p2align 3, 0x0
 ; MACHO-MANUAL-NEXT:  _global_ifunc.lazy_pointer:
 ; MACHO-MANUAL-NEXT:  .quad _global_ifunc.stub_helper
 

diff  --git a/llvm/test/CodeGen/X86/ifunc-asm.ll 
b/llvm/test/CodeGen/X86/ifunc-asm.ll
index 0f66febbe95b2da..39c326bc6b6c37c 100644
--- a/llvm/test/CodeGen/X86/ifunc-asm.ll
+++ b/llvm/test/CodeGen/X86/ifunc-asm.ll
@@ -19,6 +19,7 @@ entry:
 
 ; MACHO:   .section __DATA,__data
 ; MACHO-NEXT:  .globl _foo_ifunc.lazy_pointer
+; MACHO-NEXT:  .p2align 3, 0x0
 ; MACHO-NEXT:  _foo_ifunc.lazy_pointer:
 ; MACHO-NEXT:  .quad _foo_ifunc.stub_helper
 ; MACHO-NEXT:  .section __TEXT,__text,regular,pure_instructions



___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [clang] [llvm] [clang] Support __attribute__((ifunc(...))) on Darwin platforms (PR #73687)

2023-11-29 Thread Jon Roelofs via llvm-branch-commits

https://github.com/jroelofs updated 
https://github.com/llvm/llvm-project/pull/73687

>From aeb39b92bbd7670fb8c6b9e76a456a92199691b3 Mon Sep 17 00:00:00 2001
From: Jon Roelofs 
Date: Wed, 29 Nov 2023 12:23:46 -0800
Subject: [PATCH] adjust tests per review feedback

Created using spr 1.3.4
---
 clang/test/CodeGen/attr-ifunc.c   | 20 +++
 clang/test/CodeGen/attr-ifunc.cpp |  4 
 .../CodeGenCXX/externc-ifunc-resolver.cpp |  2 ++
 clang/test/SemaCXX/externc-ifunc-resolver.cpp |  4 
 4 files changed, 30 insertions(+)

diff --git a/clang/test/CodeGen/attr-ifunc.c b/clang/test/CodeGen/attr-ifunc.c
index 4f8fe13530fdb7b..2ad41edf20dfa01 100644
--- a/clang/test/CodeGen/attr-ifunc.c
+++ b/clang/test/CodeGen/attr-ifunc.c
@@ -1,6 +1,7 @@
 // RUN: %clang_cc1 -triple x86_64-windows -fsyntax-only -verify %s
 // RUN: %clang_cc1 -triple x86_64-linux -fsyntax-only -verify -emit-llvm-only 
-DCHECK_ALIASES %s
 // RUN: %clang_cc1 -triple x86_64-linux -fsyntax-only -verify -emit-llvm-only 
%s
+// RUN: %clang_cc1 -triple x86_64-apple-macosx -fsyntax-only -verify 
-emit-llvm-only %s
 
 #if defined(_WIN32)
 void foo(void) {}
@@ -36,6 +37,25 @@ void *f6_resolver(void) 
__attribute__((ifunc("f6_resolver_resolver")));
 void f6(void) __attribute__((ifunc("f6_resolver")));
 // expected-error@-1 {{ifunc must point to a defined function}}
 
+#elif defined(__APPLE__)
+
+// NOTE: aliases are not supported on Darwin, so the above tests are not 
relevant.
+
+#define STR2(X) #X
+#define STR(X) STR2(X)
+#define PREFIX STR(__USER_LABEL_PREFIX__)
+
+void f1a(void) __asm("f1");
+void f1a(void) {}
+// expected-note@-1 {{previous definition is here}}
+void f1(void) __attribute__((ifunc(PREFIX "f1_ifunc"))) __asm("f1");
+// expected-error@-1 {{definition with same mangled name 'f1' as 
another definition}}
+void *f1_ifunc(void) { return 0; }
+
+void *f6_ifunc(int i);
+void __attribute__((ifunc(PREFIX "f6_ifunc"))) f6(void) {}
+// expected-error@-1 {{definition 'f6' cannot also be an ifunc}}
+
 #else
 void f1a(void) __asm("f1");
 void f1a(void) {}
diff --git a/clang/test/CodeGen/attr-ifunc.cpp 
b/clang/test/CodeGen/attr-ifunc.cpp
index 5b5b2c14b4074b7..b6e342df46eb583 100644
--- a/clang/test/CodeGen/attr-ifunc.cpp
+++ b/clang/test/CodeGen/attr-ifunc.cpp
@@ -1,5 +1,9 @@
 // RUN: %clang_cc1 -triple x86_64-linux -fsyntax-only -verify -emit-llvm-only 
%s
+// RUN: %clang_cc1 -triple x86_64-apple-macosx -fsyntax-only -verify 
-emit-llvm-only %s
+// RUN: %clang_cc1 -triple arm64-apple-macosx -fsyntax-only -verify 
-emit-llvm-only %s
 // RUN: not %clang_cc1 -triple x86_64-linux -emit-llvm-only 
-fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s
+// RUN: not %clang_cc1 -triple x86_64-apple-macosx -emit-llvm-only 
-fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s
+// RUN: not %clang_cc1 -triple arm64-apple-macosx -emit-llvm-only 
-fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s
 
 void *f1_ifunc(void) { return nullptr; }
 void f1(void) __attribute__((ifunc("f1_ifunc")));
diff --git a/clang/test/CodeGenCXX/externc-ifunc-resolver.cpp 
b/clang/test/CodeGenCXX/externc-ifunc-resolver.cpp
index 0518a8dcc831dd4..be4453ae7eb08ce 100644
--- a/clang/test/CodeGenCXX/externc-ifunc-resolver.cpp
+++ b/clang/test/CodeGenCXX/externc-ifunc-resolver.cpp
@@ -1,4 +1,6 @@
 // RUN: %clang_cc1 -triple x86_64-linux-gnu -emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -triple x86_64-apple-macosx -emit-llvm -o - %s | FileCheck 
%s
+// RUN: %clang_cc1 -triple arm64-apple-macosx -emit-llvm -o - %s | FileCheck %s
 
 extern "C" {
 __attribute__((used)) static void *resolve_foo() { return 0; }
diff --git a/clang/test/SemaCXX/externc-ifunc-resolver.cpp 
b/clang/test/SemaCXX/externc-ifunc-resolver.cpp
index aa44525bde2cae1..6c6c262c5f09d8e 100644
--- a/clang/test/SemaCXX/externc-ifunc-resolver.cpp
+++ b/clang/test/SemaCXX/externc-ifunc-resolver.cpp
@@ -1,5 +1,9 @@
 // RUN: %clang_cc1 -emit-llvm-only -triple x86_64-linux-gnu -verify %s
+// RUN: %clang_cc1 -emit-llvm-only -triple x86_64-apple-macosx -verify %s
+// RUN: %clang_cc1 -emit-llvm-only -triple arm64-apple-macosx -verify %s
 // RUN: not %clang_cc1 -triple x86_64-linux -emit-llvm-only 
-fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s
+// RUN: not %clang_cc1 -triple x86_64-apple-macosx -emit-llvm-only 
-fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s
+// RUN: not %clang_cc1 -triple arm64-apple-macosx -emit-llvm-only 
-fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s
 
 extern "C" {
 __attribute__((used)) static void *resolve_foo() { return 0; }

___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [clang] [llvm] [clang] Support __attribute__((ifunc(...))) on Darwin platforms (PR #73687)

2023-11-29 Thread Jon Roelofs via llvm-branch-commits

https://github.com/jroelofs updated 
https://github.com/llvm/llvm-project/pull/73687

>From aeb39b92bbd7670fb8c6b9e76a456a92199691b3 Mon Sep 17 00:00:00 2001
From: Jon Roelofs 
Date: Wed, 29 Nov 2023 12:23:46 -0800
Subject: [PATCH] adjust tests per review feedback

Created using spr 1.3.4
---
 clang/test/CodeGen/attr-ifunc.c   | 20 +++
 clang/test/CodeGen/attr-ifunc.cpp |  4 
 .../CodeGenCXX/externc-ifunc-resolver.cpp |  2 ++
 clang/test/SemaCXX/externc-ifunc-resolver.cpp |  4 
 4 files changed, 30 insertions(+)

diff --git a/clang/test/CodeGen/attr-ifunc.c b/clang/test/CodeGen/attr-ifunc.c
index 4f8fe13530fdb7b..2ad41edf20dfa01 100644
--- a/clang/test/CodeGen/attr-ifunc.c
+++ b/clang/test/CodeGen/attr-ifunc.c
@@ -1,6 +1,7 @@
 // RUN: %clang_cc1 -triple x86_64-windows -fsyntax-only -verify %s
 // RUN: %clang_cc1 -triple x86_64-linux -fsyntax-only -verify -emit-llvm-only 
-DCHECK_ALIASES %s
 // RUN: %clang_cc1 -triple x86_64-linux -fsyntax-only -verify -emit-llvm-only 
%s
+// RUN: %clang_cc1 -triple x86_64-apple-macosx -fsyntax-only -verify 
-emit-llvm-only %s
 
 #if defined(_WIN32)
 void foo(void) {}
@@ -36,6 +37,25 @@ void *f6_resolver(void) 
__attribute__((ifunc("f6_resolver_resolver")));
 void f6(void) __attribute__((ifunc("f6_resolver")));
 // expected-error@-1 {{ifunc must point to a defined function}}
 
+#elif defined(__APPLE__)
+
+// NOTE: aliases are not supported on Darwin, so the above tests are not 
relevant.
+
+#define STR2(X) #X
+#define STR(X) STR2(X)
+#define PREFIX STR(__USER_LABEL_PREFIX__)
+
+void f1a(void) __asm("f1");
+void f1a(void) {}
+// expected-note@-1 {{previous definition is here}}
+void f1(void) __attribute__((ifunc(PREFIX "f1_ifunc"))) __asm("f1");
+// expected-error@-1 {{definition with same mangled name 'f1' as 
another definition}}
+void *f1_ifunc(void) { return 0; }
+
+void *f6_ifunc(int i);
+void __attribute__((ifunc(PREFIX "f6_ifunc"))) f6(void) {}
+// expected-error@-1 {{definition 'f6' cannot also be an ifunc}}
+
 #else
 void f1a(void) __asm("f1");
 void f1a(void) {}
diff --git a/clang/test/CodeGen/attr-ifunc.cpp 
b/clang/test/CodeGen/attr-ifunc.cpp
index 5b5b2c14b4074b7..b6e342df46eb583 100644
--- a/clang/test/CodeGen/attr-ifunc.cpp
+++ b/clang/test/CodeGen/attr-ifunc.cpp
@@ -1,5 +1,9 @@
 // RUN: %clang_cc1 -triple x86_64-linux -fsyntax-only -verify -emit-llvm-only 
%s
+// RUN: %clang_cc1 -triple x86_64-apple-macosx -fsyntax-only -verify 
-emit-llvm-only %s
+// RUN: %clang_cc1 -triple arm64-apple-macosx -fsyntax-only -verify 
-emit-llvm-only %s
 // RUN: not %clang_cc1 -triple x86_64-linux -emit-llvm-only 
-fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s
+// RUN: not %clang_cc1 -triple x86_64-apple-macosx -emit-llvm-only 
-fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s
+// RUN: not %clang_cc1 -triple arm64-apple-macosx -emit-llvm-only 
-fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s
 
 void *f1_ifunc(void) { return nullptr; }
 void f1(void) __attribute__((ifunc("f1_ifunc")));
diff --git a/clang/test/CodeGenCXX/externc-ifunc-resolver.cpp 
b/clang/test/CodeGenCXX/externc-ifunc-resolver.cpp
index 0518a8dcc831dd4..be4453ae7eb08ce 100644
--- a/clang/test/CodeGenCXX/externc-ifunc-resolver.cpp
+++ b/clang/test/CodeGenCXX/externc-ifunc-resolver.cpp
@@ -1,4 +1,6 @@
 // RUN: %clang_cc1 -triple x86_64-linux-gnu -emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -triple x86_64-apple-macosx -emit-llvm -o - %s | FileCheck 
%s
+// RUN: %clang_cc1 -triple arm64-apple-macosx -emit-llvm -o - %s | FileCheck %s
 
 extern "C" {
 __attribute__((used)) static void *resolve_foo() { return 0; }
diff --git a/clang/test/SemaCXX/externc-ifunc-resolver.cpp 
b/clang/test/SemaCXX/externc-ifunc-resolver.cpp
index aa44525bde2cae1..6c6c262c5f09d8e 100644
--- a/clang/test/SemaCXX/externc-ifunc-resolver.cpp
+++ b/clang/test/SemaCXX/externc-ifunc-resolver.cpp
@@ -1,5 +1,9 @@
 // RUN: %clang_cc1 -emit-llvm-only -triple x86_64-linux-gnu -verify %s
+// RUN: %clang_cc1 -emit-llvm-only -triple x86_64-apple-macosx -verify %s
+// RUN: %clang_cc1 -emit-llvm-only -triple arm64-apple-macosx -verify %s
 // RUN: not %clang_cc1 -triple x86_64-linux -emit-llvm-only 
-fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s
+// RUN: not %clang_cc1 -triple x86_64-apple-macosx -emit-llvm-only 
-fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s
+// RUN: not %clang_cc1 -triple arm64-apple-macosx -emit-llvm-only 
-fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s
 
 extern "C" {
 __attribute__((used)) static void *resolve_foo() { return 0; }

___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [llvm] cbb1611 - [𝘀𝗽𝗿] changes introduced through rebase

2023-11-29 Thread Jon Roelofs via llvm-branch-commits

Author: Jon Roelofs
Date: 2023-11-29T15:19:31-08:00
New Revision: cbb161112cf62e0cd0b67d9be8b02f640d6178b4

URL: 
https://github.com/llvm/llvm-project/commit/cbb161112cf62e0cd0b67d9be8b02f640d6178b4
DIFF: 
https://github.com/llvm/llvm-project/commit/cbb161112cf62e0cd0b67d9be8b02f640d6178b4.diff

LOG: [𝘀𝗽𝗿] changes introduced through rebase

Created using spr 1.3.4

[skip ci]

Added: 


Modified: 
llvm/lib/Target/AArch64/AArch64AsmPrinter.cpp
llvm/lib/Target/X86/X86AsmPrinter.cpp
llvm/test/CodeGen/AArch64/ifunc-asm.ll
llvm/test/CodeGen/X86/ifunc-asm.ll

Removed: 




diff  --git a/llvm/lib/Target/AArch64/AArch64AsmPrinter.cpp 
b/llvm/lib/Target/AArch64/AArch64AsmPrinter.cpp
index 1b5b7c556c79f6b..a3513ca439ac261 100644
--- a/llvm/lib/Target/AArch64/AArch64AsmPrinter.cpp
+++ b/llvm/lib/Target/AArch64/AArch64AsmPrinter.cpp
@@ -1905,6 +1905,7 @@ void AArch64AsmPrinter::emitManualSymbolResolver(Module 
&M,
   //   .quad _ifunc.stub_helper
 
   EmitLinkage(LazyPointer);
+  OutStreamer->emitValueToAlignment(Align(8), /*Value=*/0);
   OutStreamer->emitLabel(LazyPointer);
   emitVisibility(LazyPointer, GI.getVisibility());
   OutStreamer->emitValue(MCSymbolRefExpr::create(StubHelper, OutContext), 8);

diff  --git a/llvm/lib/Target/X86/X86AsmPrinter.cpp 
b/llvm/lib/Target/X86/X86AsmPrinter.cpp
index b0f4b9d98437284..a490d775abd551e 100644
--- a/llvm/lib/Target/X86/X86AsmPrinter.cpp
+++ b/llvm/lib/Target/X86/X86AsmPrinter.cpp
@@ -558,6 +558,7 @@ void X86AsmPrinter::emitGlobalIFunc(Module &M, const 
GlobalIFunc &GI) {
   //  .quad _ifunc.stub_helper
 
   EmitLinkage(LazyPointer);
+  OutStreamer->emitValueToAlignment(Align(8), /*Value=*/0);
   OutStreamer->emitLabel(LazyPointer);
   emitVisibility(LazyPointer, GI.getVisibility());
   OutStreamer->emitValue(MCSymbolRefExpr::create(StubHelper, OutContext), 8);

diff  --git a/llvm/test/CodeGen/AArch64/ifunc-asm.ll 
b/llvm/test/CodeGen/AArch64/ifunc-asm.ll
index ede669aa52703f7..7eff692da83ff90 100644
--- a/llvm/test/CodeGen/AArch64/ifunc-asm.ll
+++ b/llvm/test/CodeGen/AArch64/ifunc-asm.ll
@@ -35,6 +35,7 @@ entry:
 
 ; MACHO-MANUAL:   .section __DATA,__data
 ; MACHO-MANUAL-NEXT:  .globl _global_ifunc.lazy_pointer
+; MACHO-MANUAL-NEXT:  .p2align 3, 0x0
 ; MACHO-MANUAL-NEXT:  _global_ifunc.lazy_pointer:
 ; MACHO-MANUAL-NEXT:  .quad _global_ifunc.stub_helper
 

diff  --git a/llvm/test/CodeGen/X86/ifunc-asm.ll 
b/llvm/test/CodeGen/X86/ifunc-asm.ll
index 0f66febbe95b2da..39c326bc6b6c37c 100644
--- a/llvm/test/CodeGen/X86/ifunc-asm.ll
+++ b/llvm/test/CodeGen/X86/ifunc-asm.ll
@@ -19,6 +19,7 @@ entry:
 
 ; MACHO:   .section __DATA,__data
 ; MACHO-NEXT:  .globl _foo_ifunc.lazy_pointer
+; MACHO-NEXT:  .p2align 3, 0x0
 ; MACHO-NEXT:  _foo_ifunc.lazy_pointer:
 ; MACHO-NEXT:  .quad _foo_ifunc.stub_helper
 ; MACHO-NEXT:  .section __TEXT,__text,regular,pure_instructions



___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [llvm] 9f6c80e - rebase

2023-11-29 Thread Jon Roelofs via llvm-branch-commits

Author: Jon Roelofs
Date: 2023-11-29T15:19:32-08:00
New Revision: 9f6c80efe90ef0ad4c4ec3b2b83bfb678cf9b591

URL: 
https://github.com/llvm/llvm-project/commit/9f6c80efe90ef0ad4c4ec3b2b83bfb678cf9b591
DIFF: 
https://github.com/llvm/llvm-project/commit/9f6c80efe90ef0ad4c4ec3b2b83bfb678cf9b591.diff

LOG: rebase

Created using spr 1.3.4

Added: 


Modified: 
llvm/lib/Target/AArch64/AArch64AsmPrinter.cpp
llvm/lib/Target/X86/X86AsmPrinter.cpp
llvm/test/CodeGen/AArch64/ifunc-asm.ll
llvm/test/CodeGen/X86/ifunc-asm.ll

Removed: 




diff  --git a/llvm/lib/Target/AArch64/AArch64AsmPrinter.cpp 
b/llvm/lib/Target/AArch64/AArch64AsmPrinter.cpp
index 1b5b7c556c79f6b..a3513ca439ac261 100644
--- a/llvm/lib/Target/AArch64/AArch64AsmPrinter.cpp
+++ b/llvm/lib/Target/AArch64/AArch64AsmPrinter.cpp
@@ -1905,6 +1905,7 @@ void AArch64AsmPrinter::emitManualSymbolResolver(Module 
&M,
   //   .quad _ifunc.stub_helper
 
   EmitLinkage(LazyPointer);
+  OutStreamer->emitValueToAlignment(Align(8), /*Value=*/0);
   OutStreamer->emitLabel(LazyPointer);
   emitVisibility(LazyPointer, GI.getVisibility());
   OutStreamer->emitValue(MCSymbolRefExpr::create(StubHelper, OutContext), 8);

diff  --git a/llvm/lib/Target/X86/X86AsmPrinter.cpp 
b/llvm/lib/Target/X86/X86AsmPrinter.cpp
index b0f4b9d98437284..a490d775abd551e 100644
--- a/llvm/lib/Target/X86/X86AsmPrinter.cpp
+++ b/llvm/lib/Target/X86/X86AsmPrinter.cpp
@@ -558,6 +558,7 @@ void X86AsmPrinter::emitGlobalIFunc(Module &M, const 
GlobalIFunc &GI) {
   //  .quad _ifunc.stub_helper
 
   EmitLinkage(LazyPointer);
+  OutStreamer->emitValueToAlignment(Align(8), /*Value=*/0);
   OutStreamer->emitLabel(LazyPointer);
   emitVisibility(LazyPointer, GI.getVisibility());
   OutStreamer->emitValue(MCSymbolRefExpr::create(StubHelper, OutContext), 8);

diff  --git a/llvm/test/CodeGen/AArch64/ifunc-asm.ll 
b/llvm/test/CodeGen/AArch64/ifunc-asm.ll
index ede669aa52703f7..7eff692da83ff90 100644
--- a/llvm/test/CodeGen/AArch64/ifunc-asm.ll
+++ b/llvm/test/CodeGen/AArch64/ifunc-asm.ll
@@ -35,6 +35,7 @@ entry:
 
 ; MACHO-MANUAL:   .section __DATA,__data
 ; MACHO-MANUAL-NEXT:  .globl _global_ifunc.lazy_pointer
+; MACHO-MANUAL-NEXT:  .p2align 3, 0x0
 ; MACHO-MANUAL-NEXT:  _global_ifunc.lazy_pointer:
 ; MACHO-MANUAL-NEXT:  .quad _global_ifunc.stub_helper
 

diff  --git a/llvm/test/CodeGen/X86/ifunc-asm.ll 
b/llvm/test/CodeGen/X86/ifunc-asm.ll
index 0f66febbe95b2da..39c326bc6b6c37c 100644
--- a/llvm/test/CodeGen/X86/ifunc-asm.ll
+++ b/llvm/test/CodeGen/X86/ifunc-asm.ll
@@ -19,6 +19,7 @@ entry:
 
 ; MACHO:   .section __DATA,__data
 ; MACHO-NEXT:  .globl _foo_ifunc.lazy_pointer
+; MACHO-NEXT:  .p2align 3, 0x0
 ; MACHO-NEXT:  _foo_ifunc.lazy_pointer:
 ; MACHO-NEXT:  .quad _foo_ifunc.stub_helper
 ; MACHO-NEXT:  .section __TEXT,__text,regular,pure_instructions



___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [llvm] 212063d - [𝘀𝗽𝗿] changes introduced through rebase

2023-11-29 Thread Jon Roelofs via llvm-branch-commits

Author: Jon Roelofs
Date: 2023-11-29T15:19:25-08:00
New Revision: 212063d15788e8147c045b054934381c723ae145

URL: 
https://github.com/llvm/llvm-project/commit/212063d15788e8147c045b054934381c723ae145
DIFF: 
https://github.com/llvm/llvm-project/commit/212063d15788e8147c045b054934381c723ae145.diff

LOG: [𝘀𝗽𝗿] changes introduced through rebase

Created using spr 1.3.4

[skip ci]

Added: 


Modified: 
llvm/lib/Target/AArch64/AArch64AsmPrinter.cpp
llvm/lib/Target/X86/X86AsmPrinter.cpp
llvm/test/CodeGen/AArch64/ifunc-asm.ll
llvm/test/CodeGen/X86/ifunc-asm.ll

Removed: 




diff  --git a/llvm/lib/Target/AArch64/AArch64AsmPrinter.cpp 
b/llvm/lib/Target/AArch64/AArch64AsmPrinter.cpp
index 1b5b7c556c79f6b..a3513ca439ac261 100644
--- a/llvm/lib/Target/AArch64/AArch64AsmPrinter.cpp
+++ b/llvm/lib/Target/AArch64/AArch64AsmPrinter.cpp
@@ -1905,6 +1905,7 @@ void AArch64AsmPrinter::emitManualSymbolResolver(Module 
&M,
   //   .quad _ifunc.stub_helper
 
   EmitLinkage(LazyPointer);
+  OutStreamer->emitValueToAlignment(Align(8), /*Value=*/0);
   OutStreamer->emitLabel(LazyPointer);
   emitVisibility(LazyPointer, GI.getVisibility());
   OutStreamer->emitValue(MCSymbolRefExpr::create(StubHelper, OutContext), 8);

diff  --git a/llvm/lib/Target/X86/X86AsmPrinter.cpp 
b/llvm/lib/Target/X86/X86AsmPrinter.cpp
index b0f4b9d98437284..a490d775abd551e 100644
--- a/llvm/lib/Target/X86/X86AsmPrinter.cpp
+++ b/llvm/lib/Target/X86/X86AsmPrinter.cpp
@@ -558,6 +558,7 @@ void X86AsmPrinter::emitGlobalIFunc(Module &M, const 
GlobalIFunc &GI) {
   //  .quad _ifunc.stub_helper
 
   EmitLinkage(LazyPointer);
+  OutStreamer->emitValueToAlignment(Align(8), /*Value=*/0);
   OutStreamer->emitLabel(LazyPointer);
   emitVisibility(LazyPointer, GI.getVisibility());
   OutStreamer->emitValue(MCSymbolRefExpr::create(StubHelper, OutContext), 8);

diff  --git a/llvm/test/CodeGen/AArch64/ifunc-asm.ll 
b/llvm/test/CodeGen/AArch64/ifunc-asm.ll
index ede669aa52703f7..7eff692da83ff90 100644
--- a/llvm/test/CodeGen/AArch64/ifunc-asm.ll
+++ b/llvm/test/CodeGen/AArch64/ifunc-asm.ll
@@ -35,6 +35,7 @@ entry:
 
 ; MACHO-MANUAL:   .section __DATA,__data
 ; MACHO-MANUAL-NEXT:  .globl _global_ifunc.lazy_pointer
+; MACHO-MANUAL-NEXT:  .p2align 3, 0x0
 ; MACHO-MANUAL-NEXT:  _global_ifunc.lazy_pointer:
 ; MACHO-MANUAL-NEXT:  .quad _global_ifunc.stub_helper
 

diff  --git a/llvm/test/CodeGen/X86/ifunc-asm.ll 
b/llvm/test/CodeGen/X86/ifunc-asm.ll
index 0f66febbe95b2da..39c326bc6b6c37c 100644
--- a/llvm/test/CodeGen/X86/ifunc-asm.ll
+++ b/llvm/test/CodeGen/X86/ifunc-asm.ll
@@ -19,6 +19,7 @@ entry:
 
 ; MACHO:   .section __DATA,__data
 ; MACHO-NEXT:  .globl _foo_ifunc.lazy_pointer
+; MACHO-NEXT:  .p2align 3, 0x0
 ; MACHO-NEXT:  _foo_ifunc.lazy_pointer:
 ; MACHO-NEXT:  .quad _foo_ifunc.stub_helper
 ; MACHO-NEXT:  .section __TEXT,__text,regular,pure_instructions



___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [clang] [llvm] [clang] Function Multi Versioning supports IFunc lowerings on Darwin platforms (PR #73688)

2023-11-29 Thread Jon Roelofs via llvm-branch-commits

https://github.com/jroelofs updated 
https://github.com/llvm/llvm-project/pull/73688


___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [clang] [llvm] [compiler-rt] [builtins][arm64] Build __init_cpu_features_resolver on Apple platforms (PR #73685)

2023-11-29 Thread Jon Roelofs via llvm-branch-commits

https://github.com/jroelofs updated 
https://github.com/llvm/llvm-project/pull/73685

>From 603983e237e73b2d939bf9ee12e39ecc7983f7f1 Mon Sep 17 00:00:00 2001
From: Jon Roelofs 
Date: Wed, 29 Nov 2023 14:21:54 -0800
Subject: [PATCH] add a note about the dispatch_once block

Created using spr 1.3.4
---
 compiler-rt/lib/builtins/cpu_model.c | 8 
 1 file changed, 8 insertions(+)

diff --git a/compiler-rt/lib/builtins/cpu_model.c 
b/compiler-rt/lib/builtins/cpu_model.c
index 5f5182859080c49..001467a9f7ff511 100644
--- a/compiler-rt/lib/builtins/cpu_model.c
+++ b/compiler-rt/lib/builtins/cpu_model.c
@@ -1285,6 +1285,14 @@ static bool isKnownAndSupported(const char *name) {
 }
 
 void __init_cpu_features_resolver(void) {
+  // On Darwin platforms, this may be called concurrently by multiple threads
+  // because the resolvers that use it are called lazily at runtime (unlike on
+  // ELF platforms, where IFuncs are resolved serially at load time).  This
+  // function's effect on __aarch64_cpu_features should be idempotent, but even
+  // so we need dispatch_once to resolve the race condition.  Dispatch is
+  // available through libSystem, which we need anyway for the sysctl, so this
+  // does not add a new dependency.
+
   static dispatch_once_t onceToken = 0;
   dispatch_once(&onceToken, ^{
 // 
https://developer.apple.com/documentation/kernel/1387446-sysctlbyname/determining_instruction_set_characteristics

___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [compiler-rt] [clang] [llvm] [builtins][arm64] Build __init_cpu_features_resolver on Apple platforms (PR #73685)

2023-11-29 Thread Jon Roelofs via llvm-branch-commits

https://github.com/jroelofs updated 
https://github.com/llvm/llvm-project/pull/73685

>From 603983e237e73b2d939bf9ee12e39ecc7983f7f1 Mon Sep 17 00:00:00 2001
From: Jon Roelofs 
Date: Wed, 29 Nov 2023 14:21:54 -0800
Subject: [PATCH] add a note about the dispatch_once block

Created using spr 1.3.4
---
 compiler-rt/lib/builtins/cpu_model.c | 8 
 1 file changed, 8 insertions(+)

diff --git a/compiler-rt/lib/builtins/cpu_model.c 
b/compiler-rt/lib/builtins/cpu_model.c
index 5f5182859080c49..001467a9f7ff511 100644
--- a/compiler-rt/lib/builtins/cpu_model.c
+++ b/compiler-rt/lib/builtins/cpu_model.c
@@ -1285,6 +1285,14 @@ static bool isKnownAndSupported(const char *name) {
 }
 
 void __init_cpu_features_resolver(void) {
+  // On Darwin platforms, this may be called concurrently by multiple threads
+  // because the resolvers that use it are called lazily at runtime (unlike on
+  // ELF platforms, where IFuncs are resolved serially at load time).  This
+  // function's effect on __aarch64_cpu_features should be idempotent, but even
+  // so we need dispatch_once to resolve the race condition.  Dispatch is
+  // available through libSystem, which we need anyway for the sysctl, so this
+  // does not add a new dependency.
+
   static dispatch_once_t onceToken = 0;
   dispatch_once(&onceToken, ^{
 // 
https://developer.apple.com/documentation/kernel/1387446-sysctlbyname/determining_instruction_set_characteristics

___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [clang] [llvm] [clang] Function Multi Versioning supports IFunc lowerings on Darwin platforms (PR #73688)

2023-11-29 Thread Jon Roelofs via llvm-branch-commits

https://github.com/jroelofs updated 
https://github.com/llvm/llvm-project/pull/73688


___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [clang] 5237193 - [NFC] Fix typos in comments

2023-11-29 Thread Phoebe Wang via llvm-branch-commits

Author: Phoebe Wang
Date: 2023-11-19T10:14:34+08:00
New Revision: 5237193b87721134541f228e28edfd544a9c8ac8

URL: 
https://github.com/llvm/llvm-project/commit/5237193b87721134541f228e28edfd544a9c8ac8
DIFF: 
https://github.com/llvm/llvm-project/commit/5237193b87721134541f228e28edfd544a9c8ac8.diff

LOG: [NFC] Fix typos in comments

Added: 


Modified: 
clang/lib/CodeGen/CodeGenFunction.cpp

Removed: 




diff  --git a/clang/lib/CodeGen/CodeGenFunction.cpp 
b/clang/lib/CodeGen/CodeGenFunction.cpp
index 64521ce7182eee6..2199d7b58fb96e6 100644
--- a/clang/lib/CodeGen/CodeGenFunction.cpp
+++ b/clang/lib/CodeGen/CodeGenFunction.cpp
@@ -495,12 +495,12 @@ void CodeGenFunction::FinishFunction(SourceLocation 
EndLoc) {
   if (CurFnInfo->getMaxVectorWidth() > LargestVectorWidth)
 LargestVectorWidth = CurFnInfo->getMaxVectorWidth();
 
-  // Add the required-vector-width attribute. This contains the max width from:
+  // Add the min-legal-vector-width attribute. This contains the max width 
from:
   // 1. min-vector-width attribute used in the source program.
   // 2. Any builtins used that have a vector width specified.
   // 3. Values passed in and out of inline assembly.
   // 4. Width of vector arguments and return types for this function.
-  // 5. Width of vector aguments and return types for functions called by this
+  // 5. Width of vector arguments and return types for functions called by this
   //function.
   if (getContext().getTargetInfo().getTriple().isX86())
 CurFn->addFnAttr("min-legal-vector-width",



___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [llvm] [clang] [clang-tools-extra] [HLSL] RWBuffer should not have a default parameter (PR #71265)

2023-11-29 Thread Justin Bogner via llvm-branch-commits

https://github.com/bogner updated 
https://github.com/llvm/llvm-project/pull/71265


___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits