[clang] [llvm] [X86][CodeGen] security check cookie execute only when needed (PR #95904)

2024-06-28 Thread via cfe-commits


@@ -82,6 +94,8 @@ define void @tailcall_unrelated_frame() sspreq {
 ; LINUX-NEXT:  .LBB1_2: # %CallStackCheckFailBlk
 ; LINUX-NEXT:.cfi_def_cfa_offset 16
 ; LINUX-NEXT:callq __stack_chk_fail@PLT
+
+

mahesh-attarde wrote:

done.

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


[clang] [llvm] [RISCV][FMV] Support target_clones (PR #85786)

2024-06-28 Thread Piyou Chen via cfe-commits

https://github.com/BeMg updated https://github.com/llvm/llvm-project/pull/85786

>From 937fecdd1a95baf99ca42ea832efac885aef720e Mon Sep 17 00:00:00 2001
From: Piyou Chen 
Date: Wed, 5 Jun 2024 01:17:03 -0700
Subject: [PATCH 1/2] [RISCV] Add groupid/bitmask for RISC-V extension

---
 .../llvm/TargetParser/RISCVTargetParser.h |   8 +
 llvm/lib/Target/RISCV/RISCVFeatures.td| 155 --
 llvm/lib/TargetParser/RISCVTargetParser.cpp   |  32 
 llvm/test/TableGen/riscv-target-def.td|  26 ++-
 llvm/utils/TableGen/RISCVTargetDefEmitter.cpp |  37 +
 5 files changed, 205 insertions(+), 53 deletions(-)

diff --git a/llvm/include/llvm/TargetParser/RISCVTargetParser.h 
b/llvm/include/llvm/TargetParser/RISCVTargetParser.h
index 5b1494efe7bdc..e998bc4ca59ee 100644
--- a/llvm/include/llvm/TargetParser/RISCVTargetParser.h
+++ b/llvm/include/llvm/TargetParser/RISCVTargetParser.h
@@ -24,6 +24,14 @@ class Triple;
 
 namespace RISCV {
 
+namespace RISCVExtensionBitmaskTable {
+struct RISCVExtensionBitmask {
+  const char *Name;
+  unsigned GroupID;
+  unsigned BitPosition;
+};
+} // namespace RISCVExtensionBitmaskTable
+
 // We use 64 bits as the known part in the scalable vector types.
 static constexpr unsigned RVVBitsPerBlock = 64;
 
diff --git a/llvm/lib/Target/RISCV/RISCVFeatures.td 
b/llvm/lib/Target/RISCV/RISCVFeatures.td
index 011edca019fd6..67615b9f76763 100644
--- a/llvm/lib/Target/RISCV/RISCVFeatures.td
+++ b/llvm/lib/Target/RISCV/RISCVFeatures.td
@@ -37,6 +37,15 @@ class RISCVExtension groupID, int bitmaskShift> {
+int GroupID = groupID;
+int BitPos = bitmaskShift;
+}
+
 // Version of RISCVExtension to be used for Experimental extensions. This
 // sets the Experimental flag and prepends experimental- to the -mattr name.
 class RISCVExperimentalExtension;
+ "'I' (Base Integer Instruction Set)">,
+  RISCVExtensionBitmask<0, 8>;
 
 def FeatureStdExtE
 : RISCVExtension<"e", 2, 0,
@@ -78,7 +88,8 @@ def HasStdExtZicbop : 
Predicate<"Subtarget->hasStdExtZicbop()">,
 
 def FeatureStdExtZicboz
 : RISCVExtension<"zicboz", 1, 0,
- "'Zicboz' (Cache-Block Zero Instructions)">;
+ "'Zicboz' (Cache-Block Zero Instructions)">,
+  RISCVExtensionBitmask<0, 26>;
 def HasStdExtZicboz : Predicate<"Subtarget->hasStdExtZicboz()">,
   AssemblerPredicate<(all_of FeatureStdExtZicboz),
   "'Zicboz' (Cache-Block Zero Instructions)">;
@@ -101,7 +112,8 @@ def FeatureStdExtZiccrse
 
 def FeatureStdExtZicsr
 : RISCVExtension<"zicsr", 2, 0,
- "'zicsr' (CSRs)">;
+ "'zicsr' (CSRs)">,
+  RISCVExtensionBitmask<0, 27>;
 def HasStdExtZicsr : Predicate<"Subtarget->hasStdExtZicsr()">,
  AssemblerPredicate<(all_of FeatureStdExtZicsr),
 "'Zicsr' (CSRs)">;
@@ -113,7 +125,8 @@ def FeatureStdExtZicntr
 
 def FeatureStdExtZicond
 : RISCVExtension<"zicond", 1, 0,
- "'Zicond' (Integer Conditional Operations)">;
+ "'Zicond' (Integer Conditional Operations)">,
+  RISCVExtensionBitmask<0, 28>;
 def HasStdExtZicond : Predicate<"Subtarget->hasStdExtZicond()">,
   AssemblerPredicate<(all_of FeatureStdExtZicond),
   "'Zicond' (Integer Conditional Operations)">;
@@ -134,7 +147,8 @@ def HasStdExtZihintpause : 
Predicate<"Subtarget->hasStdExtZihintpause()">,
 
 def FeatureStdExtZihintntl
 : RISCVExtension<"zihintntl", 1, 0,
- "'Zihintntl' (Non-Temporal Locality Hints)">;
+ "'Zihintntl' (Non-Temporal Locality Hints)">,
+  RISCVExtensionBitmask<0, 29>;
 def HasStdExtZihintntl : Predicate<"Subtarget->hasStdExtZihintntl()">,
  AssemblerPredicate<(all_of FeatureStdExtZihintntl),
  "'Zihintntl' (Non-Temporal Locality Hints)">;
@@ -173,7 +187,8 @@ def NoHasStdExtZicfiss : 
Predicate<"!Subtarget->hasStdExtZicfiss()">;
 
 def FeatureStdExtM
 : RISCVExtension<"m", 2, 0,
- "'M' (Integer Multiplication and Division)">;
+ "'M' (Integer Multiplication and Division)">,
+  RISCVExtensionBitmask<0, 12>;
 def HasStdExtM : Predicate<"Subtarget->hasStdExtM()">,
  AssemblerPredicate<(all_of FeatureStdExtM),
  "'M' (Integer Multiplication and Division)">;
@@ -192,14 +207,16 @@ def HasStdExtMOrZmmul
 
 def FeatureStdExtA
 : RISCVExtension<"a", 2, 1,
- "'A' (Atomic Instructions)">;
+ "'A' (Atomic Instructions)">,
+  RISCVExtensionBitmask<0, 0>;
 def HasStdExtA : Predicate<"Subtarget->hasStdExtA()">,
  AssemblerPredicate<(all_of FeatureStdExtA),
 "'A' (Atomic Instructions)">;
 
 def FeatureStdExtZtso
 : RISCVExperimentalExtension<"ztso", 0, 1,
-   

[clang] [Clang] Fix __is_trivially_equality_comparable returning true with ineligebile defaulted overloads (PR #93113)

2024-06-28 Thread Nikolas Klauser via cfe-commits

philnik777 wrote:

@ZequanWu Could you give me a reproducer? Ther CI failure looks pretty 
unrelated to me, since it complains about LeakSanitizer. The next build was 
also green.

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


[clang] 7934fce - [CLANG][LLVM][AArch64]Add SME2.1 intrinsics for MOVAZ tile to vector,… (#88499)

2024-06-28 Thread via cfe-commits

Author: CarolineConcatto
Date: 2024-06-28T09:02:01+01:00
New Revision: 7934fcef26c2e5e7d451bb9c36b5a344b342a015

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

LOG: [CLANG][LLVM][AArch64]Add SME2.1 intrinsics for MOVAZ tile to vector,… 
(#88499)

… single

According to the specification in
ARM-software/acle#309 this adds the intrinsics

// And similarly for u8.
svint8_t svreadz_hor_za8_s8(uint64_t tile, uint32_t slice)
__arm_streaming __arm_inout("za");

// And similarly for u16, bf16 and f16.
svint16_t svreadz_hor_za16_s16(uint64_t tile, uint32_t slice)
__arm_streaming __arm_inout("za");

// And similarly for u32 and f32.
svint32_t svreadz_hor_za32_s32(uint64_t tile, uint32_t slice)
__arm_streaming __arm_inout("za");

// And similarly for u64 and f64.
svint64_t svreadz_hor_za64_s64(uint64_t tile, uint32_t slice)
__arm_streaming __arm_inout("za");

// And similarly for s16, s32, s64, u8, u16, u32, u64, bf16, f16, f32,
f64 svint8_t svreadz_hor_za128_s8(uint64_t tile, uint32_t slice)
__arm_streaming __arm_inout("za");

Added: 
clang/test/Sema/aarch64-sme2p1-intrinsics/acle_sme2p1_imm.cpp

Modified: 
clang/include/clang/Basic/arm_sme.td
clang/test/CodeGen/aarch64-sme2p1-intrinsics/acle_sme2p1_movaz.c
llvm/include/llvm/IR/IntrinsicsAArch64.td
llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
llvm/lib/Target/AArch64/AArch64SMEInstrInfo.td
llvm/lib/Target/AArch64/SMEInstrFormats.td
llvm/test/CodeGen/AArch64/sme2p1-intrinsics-movaz.ll

Removed: 




diff  --git a/clang/include/clang/Basic/arm_sme.td 
b/clang/include/clang/Basic/arm_sme.td
index 5f757b40e8fd9..ce211f97d1c96 100644
--- a/clang/include/clang/Basic/arm_sme.td
+++ b/clang/include/clang/Basic/arm_sme.td
@@ -787,4 +787,22 @@ defm SVREADZ_ZA16_X4 : ZAReadz<"za16", "4", "sUshb", 
"aarch64_sme_readz", [ImmCh
 defm SVREADZ_ZA32_X4 : ZAReadz<"za32", "4", "iUif",  "aarch64_sme_readz", 
[ImmCheck<0, ImmCheck0_3>]>;
 defm SVREADZ_ZA64_X4 : ZAReadz<"za64", "4", "lUld",  "aarch64_sme_readz", 
[ImmCheck<0, ImmCheck0_7>]>;
 
+
+multiclass ZAReadzSingle ch> {
+  let SMETargetGuard = "sme2p1" in {
+def NAME # _H : SInst<"svreadz_hor_" # n_suffix # "_{d}", "dim", t,
+  MergeNone, i_prefix # "_horiz",
+  [IsStreaming, IsInOutZA], ch>;
+
+def NAME # _V : SInst<"svreadz_ver_" # n_suffix # "_{d}", "dim", t,
+  MergeNone, i_prefix # "_vert",
+  [IsStreaming, IsInOutZA], ch>;
+  }
+}
+
+defm SVREADZ_ZA8   : ZAReadzSingle<"za8", "cUc", "aarch64_sme_readz", 
[ImmCheck<0, ImmCheck0_0>]>;
+defm SVREADZ_ZA16  : ZAReadzSingle<"za16", "sUshb", "aarch64_sme_readz", 
[ImmCheck<0, ImmCheck0_1>]>;
+defm SVREADZ_ZA32  : ZAReadzSingle<"za32", "iUif", "aarch64_sme_readz", 
[ImmCheck<0, ImmCheck0_3>]>;
+defm SVREADZ_ZA64  : ZAReadzSingle<"za64", "lUld", "aarch64_sme_readz", 
[ImmCheck<0, ImmCheck0_7>]>;
+defm SVREADZ_ZA128 : ZAReadzSingle<"za128", "csilUcUiUsUlbhfd", 
"aarch64_sme_readz_q", [ImmCheck<0, ImmCheck0_15>]>;
 } // let SVETargetGuard = InvalidMode

diff  --git a/clang/test/CodeGen/aarch64-sme2p1-intrinsics/acle_sme2p1_movaz.c 
b/clang/test/CodeGen/aarch64-sme2p1-intrinsics/acle_sme2p1_movaz.c
index d0c7230ade761..7c9067a5ceece 100644
--- a/clang/test/CodeGen/aarch64-sme2p1-intrinsics/acle_sme2p1_movaz.c
+++ b/clang/test/CodeGen/aarch64-sme2p1-intrinsics/acle_sme2p1_movaz.c
@@ -1413,3 +1413,413 @@ svfloat64x4_t test_svreadz_ver_za64_f64_x4(uint32_t 
slice) __arm_streaming __arm
 {
return svreadz_ver_za64_f64_vg4(7, slice);
 }
+
+// CHECK-LABEL: define dso_local  @test_svreadz_hor_za8_s8(
+// CHECK-SAME: i32 noundef [[SLICE:%.*]]) #[[ATTR0:[0-9]+]] {
+// CHECK-NEXT:  entry:
+// CHECK-NEXT:[[TMP0:%.*]] = tail call  
@llvm.aarch64.sme.readz.horiz.nxv16i8(i32 0, i32 [[SLICE]])
+// CHECK-NEXT:ret  [[TMP0]]
+//
+// CPP-CHECK-LABEL: define dso_local  
@_Z23test_svreadz_hor_za8_s8j(
+// CPP-CHECK-SAME: i32 noundef [[SLICE:%.*]]) #[[ATTR0:[0-9]+]] {
+// CPP-CHECK-NEXT:  entry:
+// CPP-CHECK-NEXT:[[TMP0:%.*]] = tail call  
@llvm.aarch64.sme.readz.horiz.nxv16i8(i32 0, i32 [[SLICE]])
+// CPP-CHECK-NEXT:ret  [[TMP0]]
+//
+svint8_t test_svreadz_hor_za8_s8(uint32_t slice) __arm_streaming 
__arm_inout("za")
+{
+   return svreadz_hor_za8_s8(0, slice);
+}
+
+// CHECK-LABEL: define dso_local  @test_svreadz_hor_za8_u8(
+// CHECK-SAME: i32 noundef [[SLICE:%.*]]) #[[ATTR0]] {
+// CHECK-NEXT:  entry:
+// CHECK-NEXT:[[TMP0:%.*]] = tail call  
@llvm.aarch64.sme.readz.horiz.nxv16i8(i32 0, i32 [[SLICE]])
+// CHECK-NEXT:ret  [[TMP0]]
+//
+// CPP-CHECK-LABEL: define dso_local  
@_Z23test_svreadz_hor_za8_u8j(
+// CPP-CHECK-SAME: i32 noundef [[SLICE:%.*]]) #[[ATTR0]] {
+// CPP-CHECK-NEXT:  entry:
+// CPP-CHECK-NEXT:[[TMP0:%

[clang] [llvm] [CLANG][LLVM][AArch64]Add SME2.1 intrinsics for MOVAZ tile to vector,… (PR #88499)

2024-06-28 Thread via cfe-commits

https://github.com/CarolineConcatto closed 
https://github.com/llvm/llvm-project/pull/88499
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [llvm] [polly] [IR] Don't include Module.h in Analysis.h (NFC) (PR #97023)

2024-06-28 Thread Nikita Popov via cfe-commits

https://github.com/nikic created https://github.com/llvm/llvm-project/pull/97023

Replace it with a forward declaration instead. Analysis.h is pulled in by all 
passes, but not all passes need to access the module.

>From f21bee2d46446e9238992fde4e190ce8010ede7a Mon Sep 17 00:00:00 2001
From: Nikita Popov 
Date: Thu, 27 Jun 2024 17:05:54 +0200
Subject: [PATCH] [IR] Don't include Module.h in Analysis.h (NFC)

Replace it with a forward declaration instead. Analysis.h is
pulled in by all passes, but not all passes need to access the
module.
---
 clang/lib/Interpreter/DeviceOffload.cpp| 1 +
 llvm/include/llvm/Analysis/TargetTransformInfo.h   | 1 +
 llvm/include/llvm/Analysis/VectorUtils.h   | 1 +
 llvm/include/llvm/IR/Analysis.h| 4 +++-
 llvm/include/llvm/Transforms/IPO/Attributor.h  | 1 +
 llvm/include/llvm/Transforms/Utils/Debugify.h  | 3 ++-
 llvm/lib/Analysis/CallPrinter.cpp  | 1 +
 llvm/lib/Analysis/InlineAdvisor.cpp| 1 +
 llvm/lib/Analysis/LazyValueInfo.cpp| 1 +
 llvm/lib/Analysis/LoopInfo.cpp | 1 +
 llvm/lib/Analysis/LoopPass.cpp | 1 +
 llvm/lib/Analysis/MLInlineAdvisor.cpp  | 1 +
 llvm/lib/Analysis/StructuralHash.cpp   | 1 +
 llvm/lib/Analysis/TargetLibraryInfo.cpp| 1 +
 llvm/lib/Analysis/TypeBasedAliasAnalysis.cpp   | 1 +
 llvm/lib/CodeGen/AsmPrinter/AIXException.cpp   | 1 +
 llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp   | 1 +
 llvm/lib/CodeGen/AsmPrinter/WinCFGuard.cpp | 1 +
 llvm/lib/CodeGen/AssignmentTrackingAnalysis.cpp| 1 +
 llvm/lib/CodeGen/CFGuardLongjmp.cpp| 1 +
 llvm/lib/CodeGen/EHContGuardCatchret.cpp   | 1 +
 llvm/lib/CodeGen/GCMetadata.cpp| 1 +
 llvm/lib/CodeGen/KCFI.cpp  | 1 +
 llvm/lib/CodeGen/MachineCheckDebugify.cpp  | 1 +
 llvm/lib/CodeGen/MachineFunctionPass.cpp   | 1 +
 llvm/lib/CodeGen/MachineModuleSlotTracker.cpp  | 1 +
 llvm/lib/CodeGen/RegAllocBase.cpp  | 1 +
 llvm/lib/CodeGen/RegAllocEvictionAdvisor.cpp   | 1 +
 llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp | 1 +
 llvm/lib/CodeGen/WinEHPrepare.cpp  | 1 +
 llvm/lib/ExecutionEngine/Orc/JITTargetMachineBuilder.cpp   | 1 +
 llvm/lib/IR/PassManager.cpp| 1 +
 llvm/lib/LTO/UpdateCompilerUsed.cpp| 3 ++-
 llvm/lib/Target/AArch64/AArch64AsmPrinter.cpp  | 1 +
 llvm/lib/Target/AArch64/AArch64FastISel.cpp| 1 +
 llvm/lib/Target/AArch64/AArch64InstrInfo.cpp   | 1 +
 llvm/lib/Target/AArch64/AArch64TargetObjectFile.cpp| 1 +
 llvm/lib/Target/AMDGPU/AMDGPUAliasAnalysis.h   | 1 +
 llvm/lib/Target/AMDGPU/AMDGPUMachineModuleInfo.cpp | 1 +
 llvm/lib/Target/AMDGPU/R600OpenCLImageTypeLoweringPass.cpp | 1 +
 llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp   | 1 +
 llvm/lib/Target/ARM/ARMInstrInfo.cpp   | 1 +
 llvm/lib/Target/ARM/ARMMachineFunctionInfo.cpp | 1 +
 llvm/lib/Target/ARM/Thumb1InstrInfo.cpp| 1 +
 llvm/lib/Target/ARM/Thumb2InstrInfo.cpp| 1 +
 llvm/lib/Target/AVR/AVRAsmPrinter.cpp  | 1 +
 llvm/lib/Target/BPF/BPFAsmPrinter.cpp  | 1 +
 llvm/lib/Target/BPF/BPFMISimplifyPatchable.cpp | 1 +
 llvm/lib/Target/BPF/BTFDebug.cpp   | 1 +
 llvm/lib/Target/Hexagon/HexagonInstrInfo.cpp   | 1 +
 llvm/lib/Target/Mips/MipsAsmPrinter.cpp| 1 +
 llvm/lib/Target/Mips/MipsISelLowering.cpp  | 1 +
 llvm/lib/Target/PowerPC/PPCMCInstLower.cpp | 1 +
 llvm/lib/Target/PowerPC/PPCSubtarget.cpp   | 2 ++
 llvm/lib/Target/RISCV/RISCVAsmPrinter.cpp  | 1 +
 llvm/lib/Target/RISCV/RISCVInstrInfo.cpp   | 1 +
 llvm/lib/Target/RISCV/RISCVTargetObjectFile.cpp| 1 +
 llvm/lib/Target/SystemZ/SystemZAsmPrinter.cpp  | 1 +
 llvm/lib/Target/SystemZ/SystemZISelLowering.cpp| 1 +
 llvm/lib/Target/Target.cpp | 1 +
 llvm/lib/Target/TargetMachine.cpp  | 1 +
 llvm/lib/Target/WebAssembly/WebAssemblyAsmPrinter.cpp  | 1 +
 llvm/lib/Target/WebAssembly/WebAssemblyMCLowerPrePass.cpp  | 1 +
 llvm/lib/Target/WebAssembly/WebAssemblyRegStackify.cpp | 1 +
 llvm/lib/Target/X86/X86FrameLowering.cpp   | 1 +
 llvm/lib/Target/X86/X86ISelDAGToDAG.cpp| 1 +
 llvm/lib/Target/X86/X86IndirectBranchTracking.cpp  | 1 +
 llvm/lib/Target/X86

[clang] [llvm] [polly] [IR] Don't include Module.h in Analysis.h (NFC) (PR #97023)

2024-06-28 Thread via cfe-commits

llvmbot wrote:




@llvm/pr-subscribers-backend-amdgpu

Author: Nikita Popov (nikic)


Changes

Replace it with a forward declaration instead. Analysis.h is pulled in by all 
passes, but not all passes need to access the module.

---

Patch is 53.62 KiB, truncated to 20.00 KiB below, full version: 
https://github.com/llvm/llvm-project/pull/97023.diff


107 Files Affected:

- (modified) clang/lib/Interpreter/DeviceOffload.cpp (+1) 
- (modified) llvm/include/llvm/Analysis/TargetTransformInfo.h (+1) 
- (modified) llvm/include/llvm/Analysis/VectorUtils.h (+1) 
- (modified) llvm/include/llvm/IR/Analysis.h (+3-1) 
- (modified) llvm/include/llvm/Transforms/IPO/Attributor.h (+1) 
- (modified) llvm/include/llvm/Transforms/Utils/Debugify.h (+2-1) 
- (modified) llvm/lib/Analysis/CallPrinter.cpp (+1) 
- (modified) llvm/lib/Analysis/InlineAdvisor.cpp (+1) 
- (modified) llvm/lib/Analysis/LazyValueInfo.cpp (+1) 
- (modified) llvm/lib/Analysis/LoopInfo.cpp (+1) 
- (modified) llvm/lib/Analysis/LoopPass.cpp (+1) 
- (modified) llvm/lib/Analysis/MLInlineAdvisor.cpp (+1) 
- (modified) llvm/lib/Analysis/StructuralHash.cpp (+1) 
- (modified) llvm/lib/Analysis/TargetLibraryInfo.cpp (+1) 
- (modified) llvm/lib/Analysis/TypeBasedAliasAnalysis.cpp (+1) 
- (modified) llvm/lib/CodeGen/AsmPrinter/AIXException.cpp (+1) 
- (modified) llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp (+1) 
- (modified) llvm/lib/CodeGen/AsmPrinter/WinCFGuard.cpp (+1) 
- (modified) llvm/lib/CodeGen/AssignmentTrackingAnalysis.cpp (+1) 
- (modified) llvm/lib/CodeGen/CFGuardLongjmp.cpp (+1) 
- (modified) llvm/lib/CodeGen/EHContGuardCatchret.cpp (+1) 
- (modified) llvm/lib/CodeGen/GCMetadata.cpp (+1) 
- (modified) llvm/lib/CodeGen/KCFI.cpp (+1) 
- (modified) llvm/lib/CodeGen/MachineCheckDebugify.cpp (+1) 
- (modified) llvm/lib/CodeGen/MachineFunctionPass.cpp (+1) 
- (modified) llvm/lib/CodeGen/MachineModuleSlotTracker.cpp (+1) 
- (modified) llvm/lib/CodeGen/RegAllocBase.cpp (+1) 
- (modified) llvm/lib/CodeGen/RegAllocEvictionAdvisor.cpp (+1) 
- (modified) llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp (+1) 
- (modified) llvm/lib/CodeGen/WinEHPrepare.cpp (+1) 
- (modified) llvm/lib/ExecutionEngine/Orc/JITTargetMachineBuilder.cpp (+1) 
- (modified) llvm/lib/IR/PassManager.cpp (+1) 
- (modified) llvm/lib/LTO/UpdateCompilerUsed.cpp (+2-1) 
- (modified) llvm/lib/Target/AArch64/AArch64AsmPrinter.cpp (+1) 
- (modified) llvm/lib/Target/AArch64/AArch64FastISel.cpp (+1) 
- (modified) llvm/lib/Target/AArch64/AArch64InstrInfo.cpp (+1) 
- (modified) llvm/lib/Target/AArch64/AArch64TargetObjectFile.cpp (+1) 
- (modified) llvm/lib/Target/AMDGPU/AMDGPUAliasAnalysis.h (+1) 
- (modified) llvm/lib/Target/AMDGPU/AMDGPUMachineModuleInfo.cpp (+1) 
- (modified) llvm/lib/Target/AMDGPU/R600OpenCLImageTypeLoweringPass.cpp (+1) 
- (modified) llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp (+1) 
- (modified) llvm/lib/Target/ARM/ARMInstrInfo.cpp (+1) 
- (modified) llvm/lib/Target/ARM/ARMMachineFunctionInfo.cpp (+1) 
- (modified) llvm/lib/Target/ARM/Thumb1InstrInfo.cpp (+1) 
- (modified) llvm/lib/Target/ARM/Thumb2InstrInfo.cpp (+1) 
- (modified) llvm/lib/Target/AVR/AVRAsmPrinter.cpp (+1) 
- (modified) llvm/lib/Target/BPF/BPFAsmPrinter.cpp (+1) 
- (modified) llvm/lib/Target/BPF/BPFMISimplifyPatchable.cpp (+1) 
- (modified) llvm/lib/Target/BPF/BTFDebug.cpp (+1) 
- (modified) llvm/lib/Target/Hexagon/HexagonInstrInfo.cpp (+1) 
- (modified) llvm/lib/Target/Mips/MipsAsmPrinter.cpp (+1) 
- (modified) llvm/lib/Target/Mips/MipsISelLowering.cpp (+1) 
- (modified) llvm/lib/Target/PowerPC/PPCMCInstLower.cpp (+1) 
- (modified) llvm/lib/Target/PowerPC/PPCSubtarget.cpp (+2) 
- (modified) llvm/lib/Target/RISCV/RISCVAsmPrinter.cpp (+1) 
- (modified) llvm/lib/Target/RISCV/RISCVInstrInfo.cpp (+1) 
- (modified) llvm/lib/Target/RISCV/RISCVTargetObjectFile.cpp (+1) 
- (modified) llvm/lib/Target/SystemZ/SystemZAsmPrinter.cpp (+1) 
- (modified) llvm/lib/Target/SystemZ/SystemZISelLowering.cpp (+1) 
- (modified) llvm/lib/Target/Target.cpp (+1) 
- (modified) llvm/lib/Target/TargetMachine.cpp (+1) 
- (modified) llvm/lib/Target/WebAssembly/WebAssemblyAsmPrinter.cpp (+1) 
- (modified) llvm/lib/Target/WebAssembly/WebAssemblyMCLowerPrePass.cpp (+1) 
- (modified) llvm/lib/Target/WebAssembly/WebAssemblyRegStackify.cpp (+1) 
- (modified) llvm/lib/Target/X86/X86FrameLowering.cpp (+1) 
- (modified) llvm/lib/Target/X86/X86ISelDAGToDAG.cpp (+1) 
- (modified) llvm/lib/Target/X86/X86IndirectBranchTracking.cpp (+1) 
- (modified) llvm/lib/Target/X86/X86InsertPrefetch.cpp (+1) 
- (modified) llvm/lib/Target/X86/X86InstrInfo.cpp (+1) 
- (modified) llvm/lib/Target/X86/X86PreTileConfig.cpp (+1) 
- (modified) llvm/lib/Target/X86/X86ReturnThunks.cpp (+1) 
- (modified) llvm/lib/Target/X86/X86Subtarget.cpp (+1) 
- (modified) llvm/lib/Transforms/IPO/CalledValuePropagation.cpp (+1) 
- (modified) llvm/lib/Transforms/Instrumentation/LowerAllowCheckPass.cpp (+1) 
- (modified) llvm/lib/Transforms/Instrumentation/PGOForceFunctionAttrs.cpp (+1) 
- (modi

[clang] 76864e6 - [C++20] [Modules] Don't find module for linkage for decls in global

2024-06-28 Thread Chuanqi Xu via cfe-commits

Author: Chuanqi Xu
Date: 2024-06-28T16:12:50+08:00
New Revision: 76864e6af134aa240069d42ba15e0b89fd7d6b4c

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

LOG: [C++20] [Modules] Don't find module for linkage for decls in global
module

Possibly fix https://github.com/llvm/llvm-project/issues/96693

The direct reason is that we are calculating the linkage for the
declaration too early so that the linkage got calculated incorrectly.

And after I look into the problem, I found it is completely not
necessary to calculate the linkage there. It is for ModulesTS. So I
simply removes that legacy experimental code and fix the issue.

Added: 
clang/test/Modules/forward-friend.cppm

Modified: 
clang/include/clang/AST/DeclBase.h
clang/lib/AST/Decl.cpp
clang/lib/Sema/SemaLookup.cpp

Removed: 




diff  --git a/clang/include/clang/AST/DeclBase.h 
b/clang/include/clang/AST/DeclBase.h
index 3310f57acc683..45dac82e54077 100644
--- a/clang/include/clang/AST/DeclBase.h
+++ b/clang/include/clang/AST/DeclBase.h
@@ -835,10 +835,7 @@ class alignas(8) Decl {
 
   /// Get the module that owns this declaration for linkage purposes.
   /// There only ever is such a standard C++ module.
-  ///
-  /// \param IgnoreLinkage Ignore the linkage of the entity; assume that
-  /// all declarations in a global module fragment are unowned.
-  Module *getOwningModuleForLinkage(bool IgnoreLinkage = false) const;
+  Module *getOwningModuleForLinkage() const;
 
   /// Determine whether this declaration is definitely visible to name lookup,
   /// independent of whether the owning module is visible.

diff  --git a/clang/lib/AST/Decl.cpp b/clang/lib/AST/Decl.cpp
index 9d0a835a12c45..16ed6d88d1cb1 100644
--- a/clang/lib/AST/Decl.cpp
+++ b/clang/lib/AST/Decl.cpp
@@ -1614,7 +1614,7 @@ LinkageInfo 
LinkageComputer::getDeclLinkageAndVisibility(const NamedDecl *D) {
  : CK);
 }
 
-Module *Decl::getOwningModuleForLinkage(bool IgnoreLinkage) const {
+Module *Decl::getOwningModuleForLinkage() const {
   if (isa(this))
 // Namespaces never have module linkage.  It is the entities within them
 // that [may] do.
@@ -1637,24 +1637,9 @@ Module *Decl::getOwningModuleForLinkage(bool 
IgnoreLinkage) const {
 
   case Module::ModuleHeaderUnit:
   case Module::ExplicitGlobalModuleFragment:
-  case Module::ImplicitGlobalModuleFragment: {
-// External linkage declarations in the global module have no owning module
-// for linkage purposes. But internal linkage declarations in the global
-// module fragment of a particular module are owned by that module for
-// linkage purposes.
-// FIXME: p1815 removes the need for this distinction -- there are no
-// internal linkage declarations that need to be referred to from outside
-// this TU.
-if (IgnoreLinkage)
-  return nullptr;
-bool InternalLinkage;
-if (auto *ND = dyn_cast(this))
-  InternalLinkage = !ND->hasExternalFormalLinkage();
-else
-  InternalLinkage = isInAnonymousNamespace();
-return InternalLinkage ? M->Kind == Module::ModuleHeaderUnit ? M : 
M->Parent
-   : nullptr;
-  }
+  case Module::ImplicitGlobalModuleFragment:
+// The global module shouldn't change the linkage.
+return nullptr;
 
   case Module::PrivateModuleFragment:
 // The private module fragment is part of its containing module for linkage

diff  --git a/clang/lib/Sema/SemaLookup.cpp b/clang/lib/Sema/SemaLookup.cpp
index 12b13eb8683ac..9a3fabc5933ee 100644
--- a/clang/lib/Sema/SemaLookup.cpp
+++ b/clang/lib/Sema/SemaLookup.cpp
@@ -5965,7 +5965,7 @@ RedeclarationKind Sema::forRedeclarationInCurContext() 
const {
   // anything that is not visible. We don't need to check linkage here; if
   // the context has internal linkage, redeclaration lookup won't find things
   // from other TUs, and we can't safely compute linkage yet in general.
-  if (cast(CurContext)->getOwningModuleForLinkage(/*IgnoreLinkage*/ 
true))
+  if (cast(CurContext)->getOwningModuleForLinkage())
 return RedeclarationKind::ForVisibleRedeclaration;
   return RedeclarationKind::ForExternalRedeclaration;
 }

diff  --git a/clang/test/Modules/forward-friend.cppm 
b/clang/test/Modules/forward-friend.cppm
new file mode 100644
index 0..dfadf4fcc1dae
--- /dev/null
+++ b/clang/test/Modules/forward-friend.cppm
@@ -0,0 +1,22 @@
+// RUN: rm -rf %t
+// RUN: split-file %s %t
+// RUN: cd %t
+//
+// RUN: %clang_cc1 -std=c++20 %t/m.cppm -fsyntax-only -verify
+
+//--- foo.h
+
+template 
+static void foo(U...) noexcept;
+
+class A {
+  template 
+  friend void foo(U...) noexcept;
+};
+
+//--- m.cppm
+// expected-no-diagnostics
+module;
+#include "foo.h"
+export module m;
+export using ::A;



_

[clang] 2341316 - [clang][analyzer] Improve documentation of checker 'cplusplus.Move' (NFC) (#96295)

2024-06-28 Thread via cfe-commits

Author: Balázs Kéri
Date: 2024-06-28T10:17:27+02:00
New Revision: 23413169299b872a9d0a9b947c2d27172b5f4cb0

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

LOG: [clang][analyzer] Improve documentation of checker 'cplusplus.Move' (NFC) 
(#96295)

Added: 


Modified: 
clang/docs/analyzer/checkers.rst
clang/include/clang/StaticAnalyzer/Checkers/Checkers.td
clang/test/Analysis/analyzer-checker-option-help.c

Removed: 




diff  --git a/clang/docs/analyzer/checkers.rst 
b/clang/docs/analyzer/checkers.rst
index b8d5f372bdf61..42c097d973d53 100644
--- a/clang/docs/analyzer/checkers.rst
+++ b/clang/docs/analyzer/checkers.rst
@@ -420,21 +420,56 @@ around, such as ``std::string_view``.
 
 cplusplus.Move (C++)
 
-Method calls on a moved-from object and copying a moved-from object will be 
reported.
-
+Find use-after-move bugs in C++. This includes method calls on moved-from
+objects, assignment of a moved-from object, and repeated move of a moved-from
+object.
 
 .. code-block:: cpp
 
-  struct A {
+ struct A {
void foo() {}
  };
 
- void f() {
+ void f1() {
A a;
A b = std::move(a); // note: 'a' became 'moved-from' here
a.foo();// warn: method call on a 'moved-from' object 'a'
  }
 
+ void f2() {
+   A a;
+   A b = std::move(a);
+   A c(std::move(a)); // warn: move of an already moved-from object
+ }
+
+ void f3() {
+   A a;
+   A b = std::move(a);
+   b = a; // warn: copy of moved-from object
+ }
+
+The checker option ``WarnOn`` controls on what objects the use-after-move is
+checked:
+
+* The most strict value is ``KnownsOnly``, in this mode only objects are
+  checked whose type is known to be move-unsafe. These include most STL objects
+  (but excluding move-safe ones) and smart pointers.
+* With option value ``KnownsAndLocals`` local variables (of any type) are
+  additionally checked. The idea behind this is that local variables are
+  usually not tempting to be re-used so an use after move is more likely a bug
+  than with member variables.
+* With option value ``All`` any use-after move condition is checked on all
+  kinds of variables, excluding global variables and known move-safe cases.
+
+Default value is ``KnownsAndLocals``.
+
+Calls of methods named ``empty()`` or ``isEmpty()`` are allowed on moved-from
+objects because these methods are considered as move-safe. Functions called
+``reset()``, ``destroy()``, ``clear()``, ``assign``, ``resize``,  ``shrink`` 
are
+treated as state-reset functions and are allowed on moved-from objects, these
+make the object valid again. This applies to any type of object (not only STL
+ones).
+
 .. _cplusplus-NewDelete:
 
 cplusplus.NewDelete (C++)

diff  --git a/clang/include/clang/StaticAnalyzer/Checkers/Checkers.td 
b/clang/include/clang/StaticAnalyzer/Checkers/Checkers.td
index 429c334a0b24b..6e224a4e098ad 100644
--- a/clang/include/clang/StaticAnalyzer/Checkers/Checkers.td
+++ b/clang/include/clang/StaticAnalyzer/Checkers/Checkers.td
@@ -686,22 +686,11 @@ def MoveChecker: Checker<"Move">,
   CheckerOptions<[
 CmdLineOption
   ]>,

diff  --git a/clang/test/Analysis/analyzer-checker-option-help.c 
b/clang/test/Analysis/analyzer-checker-option-help.c
index 5f95569e58498..c95b8e7064c5f 100644
--- a/clang/test/Analysis/analyzer-checker-option-help.c
+++ b/clang/test/Analysis/analyzer-checker-option-help.c
@@ -34,27 +34,7 @@
 // CHECK-STABLE: OPTIONS:
 //
 // CHECK-STABLE:   cplusplus.Move:WarnOn
-// CHECK-STABLE-SAME:  (string) In non-aggressive mode, only warn
-// CHECK-STABLLE:  on use-after-move of local variables (or
-// CHECK-STABLLE:  local rvalue references) and of STL objects.
-// CHECK-STABLLE:  The former is possible because local variables
-// CHECK-STABLLE:  (or local rvalue references) are not tempting
-// CHECK-STABLLE:  their user to re-use the storage. The latter
-// CHECK-STABLLE:  is possible because STL objects are known
-// CHECK-STABLLE:  to end up in a valid but unspecified state
-// CHECK-STABLLE:  after the move and their state-reset methods
-// CHECK-STABLLE:  are also known, which allows us to predict
-// CHECK-STABLLE:  precisely when use-after-move is invalid.
-// CHECK-STABLLE:  Some STL objects are known to conform to
-// CHECK-STABLLE:  additional contracts after move, so they
-// CHECK-STABLLE:  are not tracked. However, smart pointers
-// CHECK-STABLLE:  specifically are tracked because we can
-// CHECK-STABLLE:  perform extra checking over them. In aggressive
-// CHECK-STABLLE:  mode, warn on any use-after-move because
-// CHECK-STABLLE:  the 

[clang] [clang][analyzer] Improve documentation of checker 'cplusplus.Move' (NFC) (PR #96295)

2024-06-28 Thread Balázs Kéri via cfe-commits

https://github.com/balazske closed 
https://github.com/llvm/llvm-project/pull/96295
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [flang] [llvm] Re-land: "[AArch64] Add ability to list extensions enabled for a target" (#95805) (PR #96795)

2024-06-28 Thread Lucas Duarte Prates via cfe-commits

https://github.com/pratlucas closed 
https://github.com/llvm/llvm-project/pull/96795
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [llvm] [MC,llvm-readobj,yaml2obj] Support CREL relocation format (PR #91280)

2024-06-28 Thread James Henderson via cfe-commits

https://github.com/jh7370 commented:

Just noting that I've taken another look through the whole thing and I have no 
new comments.

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


[clang] e379629 - [clang][NFC] Use provided stream in APValue::dump()

2024-06-28 Thread Timm Bäder via cfe-commits

Author: Timm Bäder
Date: 2024-06-28T10:41:25+02:00
New Revision: e3796291abd83012762c832ec37ac4ecd9aba5ad

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

LOG: [clang][NFC] Use provided stream in APValue::dump()

I assume this is a copy/paste error.

Added: 


Modified: 
clang/lib/AST/ASTDumper.cpp

Removed: 




diff  --git a/clang/lib/AST/ASTDumper.cpp b/clang/lib/AST/ASTDumper.cpp
index f0603880c32dd..864d0393f9a78 100644
--- a/clang/lib/AST/ASTDumper.cpp
+++ b/clang/lib/AST/ASTDumper.cpp
@@ -342,8 +342,7 @@ LLVM_DUMP_METHOD void APValue::dump() const {
 
 LLVM_DUMP_METHOD void APValue::dump(raw_ostream &OS,
 const ASTContext &Context) const {
-  ASTDumper Dumper(llvm::errs(), Context,
-   Context.getDiagnostics().getShowColors());
+  ASTDumper Dumper(OS, Context, Context.getDiagnostics().getShowColors());
   Dumper.Visit(*this, /*Ty=*/Context.getPointerType(Context.CharTy));
 }
 



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


[clang] c50ef30 - [ParserHLSL] Attempt to parse HLSL annotations on Field Decls. (#96346)

2024-06-28 Thread via cfe-commits

Author: Joshua Batista
Date: 2024-06-28T01:53:54-07:00
New Revision: c50ef30cce32b8e864b90a4ca27c68882d46a19c

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

LOG: [ParserHLSL] Attempt to parse HLSL annotations on Field Decls. (#96346)

`MaybeParseHLSLAnnotations` should be run on Field Decls instead of just
assuming that any colon after a field decl is a bitfield. In the case
that HLSL is the language, the code after the colon may be an
annotation. This PR gives the parser a chance to parse the subsequent
text as if it was an HLSL annotation.

The burden of parsing is now on the HLSL parser, but the actual work
needs to be done in handling every case of an hlsl annotation on a field
decl. SV_DispatchThreadID was straightforward enough to implement in
this PR, and tests have been added that the annotation appears as an
attribute in the AST.

Previously, the `hlsl_annotations_on_struct_members.hlsl` test would
result in an error shown below on the line that declares variable `a` in
struct Eg9:
error: use of undeclared identifier
 'SV_DispatchThreadID'
This is because the annotation is parsed as if it was a c++ bit field,
and an identifier
that represents an integer is expected, but not found.

This test ensures that hlsl annotations are parsed when parsing struct
decls.
This test not only ensures we make progress by moving the validation
error from the realm of
C++ and expecting bitfields, to HLSL and a specialized error for the
recognized annotation, but also
validates that the parser does parse the annotation and adds an
attribute to the field decl in the AST.

Fixes https://github.com/llvm/llvm-project/issues/57889

Added: 
clang/test/ParserHLSL/bitfields.hlsl
clang/test/ParserHLSL/hlsl_annotations_on_struct_members.hlsl

Modified: 
clang/include/clang/Parse/Parser.h
clang/lib/Parse/ParseDeclCXX.cpp
clang/lib/Parse/ParseHLSL.cpp
clang/lib/Sema/SemaHLSL.cpp
clang/test/SemaHLSL/Semantics/invalid_entry_parameter.hlsl
clang/test/SemaHLSL/resource_binding_attr_error.hlsl

Removed: 




diff  --git a/clang/include/clang/Parse/Parser.h 
b/clang/include/clang/Parse/Parser.h
index 39b17f7f9bd7c..6880fa4bb0b03 100644
--- a/clang/include/clang/Parse/Parser.h
+++ b/clang/include/clang/Parse/Parser.h
@@ -3017,11 +3017,12 @@ class Parser : public CodeCompletionHandler {
   const IdentifierInfo *EnclosingScope = nullptr);
 
   void MaybeParseHLSLAnnotations(Declarator &D,
- SourceLocation *EndLoc = nullptr) {
+ SourceLocation *EndLoc = nullptr,
+ bool CouldBeBitField = false) {
 assert(getLangOpts().HLSL && "MaybeParseHLSLAnnotations is for HLSL only");
 if (Tok.is(tok::colon)) {
   ParsedAttributes Attrs(AttrFactory);
-  ParseHLSLAnnotations(Attrs, EndLoc);
+  ParseHLSLAnnotations(Attrs, EndLoc, CouldBeBitField);
   D.takeAttributes(Attrs);
 }
   }
@@ -3029,12 +3030,13 @@ class Parser : public CodeCompletionHandler {
   void MaybeParseHLSLAnnotations(ParsedAttributes &Attrs,
  SourceLocation *EndLoc = nullptr) {
 assert(getLangOpts().HLSL && "MaybeParseHLSLAnnotations is for HLSL only");
-if (getLangOpts().HLSL && Tok.is(tok::colon))
+if (Tok.is(tok::colon))
   ParseHLSLAnnotations(Attrs, EndLoc);
   }
 
   void ParseHLSLAnnotations(ParsedAttributes &Attrs,
-SourceLocation *EndLoc = nullptr);
+SourceLocation *EndLoc = nullptr,
+bool CouldBeBitField = false);
   Decl *ParseHLSLBuffer(SourceLocation &DeclEnd);
 
   void MaybeParseMicrosoftAttributes(ParsedAttributes &Attrs) {

diff  --git a/clang/lib/Parse/ParseDeclCXX.cpp 
b/clang/lib/Parse/ParseDeclCXX.cpp
index 5e3ee5f0579aa..2fc43a7e7926b 100644
--- a/clang/lib/Parse/ParseDeclCXX.cpp
+++ b/clang/lib/Parse/ParseDeclCXX.cpp
@@ -2681,6 +2681,10 @@ bool Parser::ParseCXXMemberDeclaratorBeforeInitializer(
   else
 DeclaratorInfo.SetIdentifier(nullptr, Tok.getLocation());
 
+  if (getLangOpts().HLSL)
+MaybeParseHLSLAnnotations(DeclaratorInfo, nullptr,
+  /*CouldBeBitField*/ true);
+
   if (!DeclaratorInfo.isFunctionDeclarator() && TryConsumeToken(tok::colon)) {
 assert(DeclaratorInfo.isPastIdentifier() &&
"don't know where identifier would go yet?");

diff  --git a/clang/lib/Parse/ParseHLSL.cpp b/clang/lib/Parse/ParseHLSL.cpp
index 4b72afe9986e5..b36ea4012c26e 100644
--- a/clang/lib/Parse/ParseHLSL.cpp
+++ b/clang/lib/Parse/ParseHLSL.cpp
@@ -119,9 +119,11 @@ static void fixSeparateAttrArgAndNumber(StringRef ArgStr, 
SourceLocation ArgLoc,
 }
 
 void Parser::ParseHLSLAnnotations(ParsedAttributes &Attrs,
-  

[clang] [ParserHLSL] Attempt to parse HLSL annotations on Field Decls. (PR #96346)

2024-06-28 Thread Joshua Batista via cfe-commits

https://github.com/bob80905 closed 
https://github.com/llvm/llvm-project/pull/96346
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang][analyzer] Improve PointerSubChecker (PR #96501)

2024-06-28 Thread Balázs Kéri via cfe-commits

balazske wrote:

If the array bounds checker does the same job then the array bounds check it is 
not needed in this checker. Specially if it makes no difference if the indexing 
is used at pointer subtraction.

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


[clang] [NFC] use appropriate castas (PR #95272)

2024-06-28 Thread Simon Pilgrim via cfe-commits


@@ -2834,7 +2834,7 @@ ABIArgInfo
 X86_64ABIInfo::classifyRegCallStructTypeImpl(QualType Ty, unsigned &NeededInt,
  unsigned &NeededSSE,
  unsigned &MaxVectorWidth) const {
-  auto RT = Ty->getAs();
+  auto RT = Ty->castAs();
   assert(RT && "classifyRegCallStructType only valid with struct types");

RKSimon wrote:

castAs has an internal assert so drop this one?

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


[clang] [Clang] Clarify diagnostic notes for implicitly generated deduction guides (PR #96084)

2024-06-28 Thread Younan Zhang via cfe-commits

https://github.com/zyn0217 updated 
https://github.com/llvm/llvm-project/pull/96084

>From 23844cd8b8fad07bce0c34f58430322090c5a793 Mon Sep 17 00:00:00 2001
From: Younan Zhang 
Date: Wed, 19 Jun 2024 23:25:13 +0800
Subject: [PATCH 01/11] [Clang] Add diagnostic notes for implcitly generated
 deduction guides

---
 clang/docs/ReleaseNotes.rst   |  3 ++
 .../clang/Basic/DiagnosticSemaKinds.td|  1 +
 clang/lib/Sema/SemaOverload.cpp   | 30 +++
 clang/test/CXX/drs/cwg26xx.cpp|  3 ++
 .../CXX/expr/expr.post/expr.type.conv/p1.cpp  |  2 +-
 .../over.match.class.deduct/p2.cpp|  2 +-
 .../temp.deduct/temp.deduct.call/p3-0x.cpp|  4 +--
 clang/test/Modules/template_name_lookup.cpp   |  2 ++
 clang/test/PCH/cxx-explicit-specifier.cpp |  2 +-
 clang/test/Sema/tls_alignment.cpp |  4 ++-
 ...xx1z-class-template-argument-deduction.cpp |  6 ++--
 clang/test/SemaCXX/cxx20-ctad-type-alias.cpp  | 17 +--
 clang/test/SemaCXX/cxx2a-explicit-bool.cpp|  2 ++
 clang/test/SemaCXX/gh65522.cpp|  3 +-
 ...deduction-guide-as-template-candidates.cpp |  4 ++-
 .../lookup-template-name-extern-CXX.cpp   |  6 ++--
 .../aggregate-deduction-candidate.cpp | 24 ---
 clang/test/SemaTemplate/class-template-id.cpp |  2 ++
 clang/test/SemaTemplate/ctad.cpp  |  6 ++--
 clang/test/SemaTemplate/deduction-crash.cpp   |  3 +-
 clang/test/SemaTemplate/deduction-guide.cpp   |  6 ++--
 .../nested-implicit-deduction-guides.cpp  |  3 ++
 clang/test/SemaTemplate/temp_arg.cpp  |  4 ++-
 23 files changed, 108 insertions(+), 31 deletions(-)

diff --git a/clang/docs/ReleaseNotes.rst b/clang/docs/ReleaseNotes.rst
index 69aea6c21ad39..423f1e9198948 100644
--- a/clang/docs/ReleaseNotes.rst
+++ b/clang/docs/ReleaseNotes.rst
@@ -580,6 +580,9 @@ Improvements to Clang's diagnostics
 - Clang no longer emits a "declared here" note for a builtin function that has 
no declaration in source.
   Fixes #GH93369.
 
+- Clang now emits implicit deduction guides corresponding to non-user-defined 
constructors while at a failure
+  of overload resolution.
+
 Improvements to Clang's time-trace
 --
 
diff --git a/clang/include/clang/Basic/DiagnosticSemaKinds.td 
b/clang/include/clang/Basic/DiagnosticSemaKinds.td
index ab223f2b806d5..a65491b0c4399 100644
--- a/clang/include/clang/Basic/DiagnosticSemaKinds.td
+++ b/clang/include/clang/Basic/DiagnosticSemaKinds.td
@@ -2405,6 +2405,7 @@ def err_selected_explicit_constructor : Error<
   "chosen constructor is explicit in copy-initialization">;
 def note_explicit_ctor_deduction_guide_here : Note<
   "explicit %select{constructor|deduction guide}0 declared here">;
+def note_implicit_deduction_guide : Note<"implicit deduction guide declared as 
'%0'">;
 
 // C++11 auto
 def warn_cxx98_compat_auto_type_specifier : Warning<
diff --git a/clang/lib/Sema/SemaOverload.cpp b/clang/lib/Sema/SemaOverload.cpp
index fb4ff72e42eb5..31b908eb3cc3c 100644
--- a/clang/lib/Sema/SemaOverload.cpp
+++ b/clang/lib/Sema/SemaOverload.cpp
@@ -40,6 +40,7 @@
 #include "llvm/ADT/DenseSet.h"
 #include "llvm/ADT/STLExtras.h"
 #include "llvm/ADT/STLForwardCompat.h"
+#include "llvm/ADT/ScopeExit.h"
 #include "llvm/ADT/SmallPtrSet.h"
 #include "llvm/ADT/SmallString.h"
 #include "llvm/ADT/SmallVector.h"
@@ -12114,6 +12115,35 @@ static void NoteFunctionCandidate(Sema &S, 
OverloadCandidate *Cand,
 return;
   }
 
+  // If this is an implicit deduction guide against a non-user-defined
+  // constructor, add a note for it. These deduction guides nor their
+  // corresponding constructors are not explicitly spelled in the source code,
+  // and simply producing a deduction failure note around the heading of the
+  // enclosing RecordDecl is confusing.
+  //
+  // We prefer adding such notes at the end of the last deduction failure
+  // reason because duplicate code snippets appearing in the diagnostic
+  // are likely becoming noisy.
+  auto _ = llvm::make_scope_exit([&] {
+auto *DG = dyn_cast(Fn);
+if (!DG || !DG->isImplicit() || DG->getCorrespondingConstructor())
+  return;
+std::string FunctionProto;
+llvm::raw_string_ostream OS(FunctionProto);
+FunctionTemplateDecl *Template = DG->getDescribedFunctionTemplate();
+// This also could be an instantiation. Find out the primary template.
+if (!Template) {
+  FunctionDecl *Pattern = DG->getTemplateInstantiationPattern();
+  assert(Pattern && Pattern->getDescribedFunctionTemplate() &&
+ "Cannot find the associated function template of "
+ "CXXDeductionGuideDecl?");
+  Template = Pattern->getDescribedFunctionTemplate();
+}
+Template->print(OS);
+S.Diag(DG->getLocation(), diag::note_implicit_deduction_guide)
+<< FunctionProto;
+  });
+
   switch (Cand->FailureKind) {
   case ovl_fail_too_many_arguments:
   case ovl_fail_too_few_arguments:
d

[clang] [CUDA][NFC] CudaArch to GpuArch rename (PR #97028)

2024-06-28 Thread Jakub Chlanda via cfe-commits

https://github.com/jchlanda created 
https://github.com/llvm/llvm-project/pull/97028

Rename `CudaArch` to `GpuArch` to better reflect its content and the use.
Apply a similar rename to helpers handling the enum.

>From 24603da293e82cdf2531283fb5f354c805ead1d6 Mon Sep 17 00:00:00 2001
From: Jakub Chlanda 
Date: Fri, 28 Jun 2024 09:25:56 +
Subject: [PATCH] [CUDA][NFC] CudaArch to GpuArch rename

Rename CudaArch to GpuArch to better reflect its content and the
use. Apply a similar rename to helpers handling the enum.
---
 clang/include/clang/Basic/Cuda.h |  28 +--
 clang/lib/Basic/Cuda.cpp | 106 ++--
 clang/lib/Basic/Targets/NVPTX.cpp| 160 -
 clang/lib/Basic/Targets/NVPTX.h  |  20 +--
 clang/lib/CodeGen/CGOpenMPRuntimeGPU.cpp | 173 +--
 clang/lib/Driver/Driver.cpp  |  38 ++--
 clang/lib/Driver/OffloadBundler.cpp  |   2 +-
 clang/lib/Driver/ToolChains/AMDGPUOpenMP.cpp |   2 +-
 clang/lib/Driver/ToolChains/Cuda.cpp |  32 ++--
 clang/lib/Driver/ToolChains/Cuda.h   |   4 +-
 clang/lib/Sema/SemaDeclAttr.cpp  |  14 +-
 11 files changed, 288 insertions(+), 291 deletions(-)

diff --git a/clang/include/clang/Basic/Cuda.h b/clang/include/clang/Basic/Cuda.h
index 01cfe286c491b..b0999d2c5d1ac 100644
--- a/clang/include/clang/Basic/Cuda.h
+++ b/clang/include/clang/Basic/Cuda.h
@@ -52,7 +52,7 @@ const char *CudaVersionToString(CudaVersion V);
 // Input is "Major.Minor"
 CudaVersion CudaStringToVersion(const llvm::Twine &S);
 
-enum class CudaArch {
+enum class GpuArch {
   UNUSED,
   UNKNOWN,
   // TODO: Deprecate and remove GPU architectures older than sm_52.
@@ -133,8 +133,8 @@ enum class CudaArch {
// public one.
   LAST,
 
-  CudaDefault = CudaArch::SM_52,
-  HIPDefault = CudaArch::GFX906,
+  CudaDefault = GpuArch::SM_52,
+  HIPDefault = GpuArch::GFX906,
 };
 
 enum class CUDAFunctionTarget {
@@ -145,26 +145,26 @@ enum class CUDAFunctionTarget {
   InvalidTarget
 };
 
-static inline bool IsNVIDIAGpuArch(CudaArch A) {
-  return A >= CudaArch::SM_20 && A < CudaArch::GFX600;
+static inline bool IsNVIDIAGpuArch(GpuArch A) {
+  return A >= GpuArch::SM_20 && A < GpuArch::GFX600;
 }
 
-static inline bool IsAMDGpuArch(CudaArch A) {
+static inline bool IsAMDGpuArch(GpuArch A) {
   // Generic processor model is for testing only.
-  return A >= CudaArch::GFX600 && A < CudaArch::Generic;
+  return A >= GpuArch::GFX600 && A < GpuArch::Generic;
 }
 
-const char *CudaArchToString(CudaArch A);
-const char *CudaArchToVirtualArchString(CudaArch A);
+const char *GpuArchToString(GpuArch A);
+const char *GpuArchToVirtualArchString(GpuArch A);
 
 // The input should have the form "sm_20".
-CudaArch StringToCudaArch(llvm::StringRef S);
+GpuArch StringToGpuArch(llvm::StringRef S);
 
-/// Get the earliest CudaVersion that supports the given CudaArch.
-CudaVersion MinVersionForCudaArch(CudaArch A);
+/// Get the earliest CudaVersion that supports the given GpuArch.
+CudaVersion MinVersionForGpuArch(GpuArch A);
 
-/// Get the latest CudaVersion that supports the given CudaArch.
-CudaVersion MaxVersionForCudaArch(CudaArch A);
+/// Get the latest CudaVersion that supports the given GpuArch.
+CudaVersion MaxVersionForGpuArch(GpuArch A);
 
 //  Various SDK-dependent features that affect CUDA compilation
 enum class CudaFeature {
diff --git a/clang/lib/Basic/Cuda.cpp b/clang/lib/Basic/Cuda.cpp
index af99c4d61021e..e31f09dce0f3a 100644
--- a/clang/lib/Basic/Cuda.cpp
+++ b/clang/lib/Basic/Cuda.cpp
@@ -72,23 +72,21 @@ CudaVersion ToCudaVersion(llvm::VersionTuple Version) {
 }
 
 namespace {
-struct CudaArchToStringMap {
-  CudaArch arch;
+struct GpuArchToStringMap {
+  GpuArch arch;
   const char *arch_name;
   const char *virtual_arch_name;
 };
 } // namespace
 
-#define SM2(sm, ca)
\
-  { CudaArch::SM_##sm, "sm_" #sm, ca }
+#define SM2(sm, ca) {GpuArch::SM_##sm, "sm_" #sm, ca}
 #define SM(sm) SM2(sm, "compute_" #sm)
-#define GFX(gpu)   
\
-  { CudaArch::GFX##gpu, "gfx" #gpu, "compute_amdgcn" }
-static const CudaArchToStringMap arch_names[] = {
+#define GFX(gpu) {GpuArch::GFX##gpu, "gfx" #gpu, "compute_amdgcn"}
+static const GpuArchToStringMap arch_names[] = {
 // clang-format off
-{CudaArch::UNUSED, "", ""},
+{GpuArch::UNUSED, "", ""},
 SM2(20, "compute_20"), SM2(21, "compute_20"), // Fermi
-SM(30), {CudaArch::SM_32_, "sm_32", "compute_32"}, SM(35), SM(37),  // 
Kepler
+SM(30), {GpuArch::SM_32_, "sm_32", "compute_32"}, SM(35), SM(37),  // 
Kepler
 SM(50), SM(52), SM(53),  // Maxwell
 SM(60), SM(61), SM(62),  // Pascal
 SM(70), SM(72),  // Volta
@@ -112,7 +110,7 @@ static const CudaArchToStringMap arch_names[] = {
 GFX(803),  // gfx803
 GFX(805),  // gfx805
 GFX(810),  // gfx810
-{CudaA

[clang] [CUDA][NFC] CudaArch to GpuArch rename (PR #97028)

2024-06-28 Thread via cfe-commits

llvmbot wrote:



@llvm/pr-subscribers-clang-codegen

@llvm/pr-subscribers-clang

Author: Jakub Chlanda (jchlanda)


Changes

Rename `CudaArch` to `GpuArch` to better reflect its content and the use.
Apply a similar rename to helpers handling the enum.

---

Patch is 39.03 KiB, truncated to 20.00 KiB below, full version: 
https://github.com/llvm/llvm-project/pull/97028.diff


11 Files Affected:

- (modified) clang/include/clang/Basic/Cuda.h (+14-14) 
- (modified) clang/lib/Basic/Cuda.cpp (+52-54) 
- (modified) clang/lib/Basic/Targets/NVPTX.cpp (+80-80) 
- (modified) clang/lib/Basic/Targets/NVPTX.h (+10-10) 
- (modified) clang/lib/CodeGen/CGOpenMPRuntimeGPU.cpp (+86-87) 
- (modified) clang/lib/Driver/Driver.cpp (+19-19) 
- (modified) clang/lib/Driver/OffloadBundler.cpp (+1-1) 
- (modified) clang/lib/Driver/ToolChains/AMDGPUOpenMP.cpp (+1-1) 
- (modified) clang/lib/Driver/ToolChains/Cuda.cpp (+16-16) 
- (modified) clang/lib/Driver/ToolChains/Cuda.h (+2-2) 
- (modified) clang/lib/Sema/SemaDeclAttr.cpp (+7-7) 


``diff
diff --git a/clang/include/clang/Basic/Cuda.h b/clang/include/clang/Basic/Cuda.h
index 01cfe286c491b..b0999d2c5d1ac 100644
--- a/clang/include/clang/Basic/Cuda.h
+++ b/clang/include/clang/Basic/Cuda.h
@@ -52,7 +52,7 @@ const char *CudaVersionToString(CudaVersion V);
 // Input is "Major.Minor"
 CudaVersion CudaStringToVersion(const llvm::Twine &S);
 
-enum class CudaArch {
+enum class GpuArch {
   UNUSED,
   UNKNOWN,
   // TODO: Deprecate and remove GPU architectures older than sm_52.
@@ -133,8 +133,8 @@ enum class CudaArch {
// public one.
   LAST,
 
-  CudaDefault = CudaArch::SM_52,
-  HIPDefault = CudaArch::GFX906,
+  CudaDefault = GpuArch::SM_52,
+  HIPDefault = GpuArch::GFX906,
 };
 
 enum class CUDAFunctionTarget {
@@ -145,26 +145,26 @@ enum class CUDAFunctionTarget {
   InvalidTarget
 };
 
-static inline bool IsNVIDIAGpuArch(CudaArch A) {
-  return A >= CudaArch::SM_20 && A < CudaArch::GFX600;
+static inline bool IsNVIDIAGpuArch(GpuArch A) {
+  return A >= GpuArch::SM_20 && A < GpuArch::GFX600;
 }
 
-static inline bool IsAMDGpuArch(CudaArch A) {
+static inline bool IsAMDGpuArch(GpuArch A) {
   // Generic processor model is for testing only.
-  return A >= CudaArch::GFX600 && A < CudaArch::Generic;
+  return A >= GpuArch::GFX600 && A < GpuArch::Generic;
 }
 
-const char *CudaArchToString(CudaArch A);
-const char *CudaArchToVirtualArchString(CudaArch A);
+const char *GpuArchToString(GpuArch A);
+const char *GpuArchToVirtualArchString(GpuArch A);
 
 // The input should have the form "sm_20".
-CudaArch StringToCudaArch(llvm::StringRef S);
+GpuArch StringToGpuArch(llvm::StringRef S);
 
-/// Get the earliest CudaVersion that supports the given CudaArch.
-CudaVersion MinVersionForCudaArch(CudaArch A);
+/// Get the earliest CudaVersion that supports the given GpuArch.
+CudaVersion MinVersionForGpuArch(GpuArch A);
 
-/// Get the latest CudaVersion that supports the given CudaArch.
-CudaVersion MaxVersionForCudaArch(CudaArch A);
+/// Get the latest CudaVersion that supports the given GpuArch.
+CudaVersion MaxVersionForGpuArch(GpuArch A);
 
 //  Various SDK-dependent features that affect CUDA compilation
 enum class CudaFeature {
diff --git a/clang/lib/Basic/Cuda.cpp b/clang/lib/Basic/Cuda.cpp
index af99c4d61021e..e31f09dce0f3a 100644
--- a/clang/lib/Basic/Cuda.cpp
+++ b/clang/lib/Basic/Cuda.cpp
@@ -72,23 +72,21 @@ CudaVersion ToCudaVersion(llvm::VersionTuple Version) {
 }
 
 namespace {
-struct CudaArchToStringMap {
-  CudaArch arch;
+struct GpuArchToStringMap {
+  GpuArch arch;
   const char *arch_name;
   const char *virtual_arch_name;
 };
 } // namespace
 
-#define SM2(sm, ca)
\
-  { CudaArch::SM_##sm, "sm_" #sm, ca }
+#define SM2(sm, ca) {GpuArch::SM_##sm, "sm_" #sm, ca}
 #define SM(sm) SM2(sm, "compute_" #sm)
-#define GFX(gpu)   
\
-  { CudaArch::GFX##gpu, "gfx" #gpu, "compute_amdgcn" }
-static const CudaArchToStringMap arch_names[] = {
+#define GFX(gpu) {GpuArch::GFX##gpu, "gfx" #gpu, "compute_amdgcn"}
+static const GpuArchToStringMap arch_names[] = {
 // clang-format off
-{CudaArch::UNUSED, "", ""},
+{GpuArch::UNUSED, "", ""},
 SM2(20, "compute_20"), SM2(21, "compute_20"), // Fermi
-SM(30), {CudaArch::SM_32_, "sm_32", "compute_32"}, SM(35), SM(37),  // 
Kepler
+SM(30), {GpuArch::SM_32_, "sm_32", "compute_32"}, SM(35), SM(37),  // 
Kepler
 SM(50), SM(52), SM(53),  // Maxwell
 SM(60), SM(61), SM(62),  // Pascal
 SM(70), SM(72),  // Volta
@@ -112,7 +110,7 @@ static const CudaArchToStringMap arch_names[] = {
 GFX(803),  // gfx803
 GFX(805),  // gfx805
 GFX(810),  // gfx810
-{CudaArch::GFX9_GENERIC, "gfx9-generic", "compute_amdgcn"},
+{GpuArch::GFX9_GENERIC, "gfx9-generic", "compute_amdgcn"},
 GFX(900),  // gfx900
 GFX(902),  // gfx902
 GFX(904),  // gfx903
@@ 

[clang] [CUDA][NFC] CudaArch to GpuArch rename (PR #97028)

2024-06-28 Thread Jakub Chlanda via cfe-commits

jchlanda wrote:

This originally was submitted as a ticket against a fork of llvm in here: 
https://github.com/intel/llvm/issues/4279

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


[clang] [Clang] Clarify diagnostic notes for implicitly generated deduction guides (PR #96084)

2024-06-28 Thread Younan Zhang via cfe-commits

zyn0217 wrote:

Thank you folks for the review & suggestion. I plan to merge this PR next week 
in case @AaronBallman or @cor3ntin has objections.

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


[clang] [CUDA][NFC] CudaArch to GpuArch rename (PR #97028)

2024-06-28 Thread Matt Arsenault via cfe-commits


@@ -52,7 +52,7 @@ const char *CudaVersionToString(CudaVersion V);
 // Input is "Major.Minor"
 CudaVersion CudaStringToVersion(const llvm::Twine &S);
 
-enum class CudaArch {
+enum class GpuArch {

arsenm wrote:

Probably should call this OffloadArch to match --offload-arch 

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


[clang] [clang][NFC] Use range-based for loops (PR #96831)

2024-06-28 Thread Vlad Serebrennikov via cfe-commits

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


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


[clang] [llvm] [CLANG][LLVM][AArch64]Add SME2.1 intrinsics for MOVAZ array to vector (PR #88901)

2024-06-28 Thread via cfe-commits

https://github.com/CarolineConcatto updated 
https://github.com/llvm/llvm-project/pull/88901

>From 4606329d0d1526cb19641b4762ca7805a9c854a2 Mon Sep 17 00:00:00 2001
From: Caroline Concatto 
Date: Tue, 16 Apr 2024 08:50:29 +
Subject: [PATCH 1/3] Movaz

---
 llvm/lib/Target/AArch64/AArch64SMEInstrInfo.td | 2 +-
 llvm/lib/Target/AArch64/SMEInstrFormats.td | 5 +
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/llvm/lib/Target/AArch64/AArch64SMEInstrInfo.td 
b/llvm/lib/Target/AArch64/AArch64SMEInstrInfo.td
index 833e6cfcaf6c5..0646a81017032 100644
--- a/llvm/lib/Target/AArch64/AArch64SMEInstrInfo.td
+++ b/llvm/lib/Target/AArch64/AArch64SMEInstrInfo.td
@@ -818,7 +818,7 @@ defm MOVAZ_ZMI  : sme2p1_movaz_tile_to_vec<"movaz", 
int_aarch64_sme_readz_horiz,
int_aarch64_sme_readz_q_horiz, 
int_aarch64_sme_readz_q_vert>;
 defm MOVAZ_2ZMI  : sme2p1_movaz_tile_to_vec_vg2<"movaz">;
 defm MOVAZ_4ZMI  : sme2p1_movaz_tile_to_vec_vg4<"movaz">;
-defm MOVAZ_VG2_2ZM : sme2_mova_array_to_vec_vg2_multi<0b010, "movaz">;
+defm MOVAZ_VG2_2ZM : sme2_movaz_array_to_vec_vg2_multi<"movaz">;
 defm MOVAZ_VG4_4ZM : sme2_mova_array_to_vec_vg4_multi<0b1100, "movaz">;
 
 defm ZERO_MXI :  sme2p1_zero_matrix<"zero">;
diff --git a/llvm/lib/Target/AArch64/SMEInstrFormats.td 
b/llvm/lib/Target/AArch64/SMEInstrFormats.td
index 5bd19a73f03ce..7aec46baf6fba 100644
--- a/llvm/lib/Target/AArch64/SMEInstrFormats.td
+++ b/llvm/lib/Target/AArch64/SMEInstrFormats.td
@@ -4359,6 +4359,11 @@ multiclass sme2_mova_array_to_vec_vg2_multi opc, 
string mnemonic> {
   }
 }
 
+multiclass sme2_movaz_array_to_vec_vg2_multi {
+  def NAME : sme2_mova_array_to_vec_vg2_multi<0b010, mnemonic>;
+  def NAME # _PSEUDO : sme2_movaz_to_tile_multi_pseudo
+}
+
 // move array to vector, four registers
 multiclass sme2_mova_array_to_vec_vg4_multi opc, string mnemonic> {
   def NAME : sme2_mova_array_to_vec_vg24_multiFrom 3ef0a7125efd189f3c930ddd08b5a66d367af6f7 Mon Sep 17 00:00:00 2001
From: Caroline Concatto 
Date: Tue, 16 Apr 2024 14:04:11 +
Subject: [PATCH 2/3] [CLANG][LLVM][AArch64]Add SME2.1 intrinsics for MOVAZ
 array to vector

According to the specification in
ARM-software/acle#309 this adds the intrinsics

Move and zero multiple ZA single-vector groups to vector registers

// Variants are also available for _za8_u8, _za16_s16, _za16_u16,
// _za16_f16, _za16_bf16, _za32_s32, _za32_u32, _za32_f32,
// _za64_s64, _za64_u64 and _za64_f64
svint8x2_t svreadz_za8_s8_vg1x2(uint32_t slice)
__arm_streaming __arm_inout("za");

// Variants are also available for _za8_u8, _za16_s16, _za16_u16,
// _za16_f16, _za16_bf16, _za32_s32, _za32_u32, _za32_f32,
// _za64_s64, _za64_u64 and _za64_f64
svint8x4_t svreadz_za8_s8_vg1x4(uint32_t slice)
__arm_streaming __arm_inout("za");
---
 clang/include/clang/Basic/arm_sme.td  |  12 +
 .../acle_sme2p1_movaz.c   | 705 ++
 llvm/include/llvm/IR/IntrinsicsAArch64.td |  10 +
 .../Target/AArch64/AArch64ISelDAGToDAG.cpp|  67 +-
 .../Target/AArch64/AArch64ISelLowering.cpp|  26 +
 llvm/lib/Target/AArch64/AArch64ISelLowering.h |   3 +
 .../lib/Target/AArch64/AArch64SMEInstrInfo.td |   4 +-
 llvm/lib/Target/AArch64/SMEInstrFormats.td|  24 +-
 .../AArch64/sme2p1-intrinsics-movaz.ll| 223 +-
 9 files changed, 1060 insertions(+), 14 deletions(-)

diff --git a/clang/include/clang/Basic/arm_sme.td 
b/clang/include/clang/Basic/arm_sme.td
index ce211f97d1c96..1c8212ea23e63 100644
--- a/clang/include/clang/Basic/arm_sme.td
+++ b/clang/include/clang/Basic/arm_sme.td
@@ -805,4 +805,16 @@ defm SVREADZ_ZA16  : ZAReadzSingle<"za16", "sUshb", 
"aarch64_sme_readz", [ImmChe
 defm SVREADZ_ZA32  : ZAReadzSingle<"za32", "iUif", "aarch64_sme_readz", 
[ImmCheck<0, ImmCheck0_3>]>;
 defm SVREADZ_ZA64  : ZAReadzSingle<"za64", "lUld", "aarch64_sme_readz", 
[ImmCheck<0, ImmCheck0_7>]>;
 defm SVREADZ_ZA128 : ZAReadzSingle<"za128", "csilUcUiUsUlbhfd", 
"aarch64_sme_readz_q", [ImmCheck<0, ImmCheck0_15>]>;
+
+multiclass ZAReadz{
+  let TargetGuard = "sme2p1" in {
+def NAME # _B : SInst<"svreadz_za8_{d}_vg1x" # vg_num, vg_num # "m", 
"cUc", MergeNone, "aarch64_sme_readz_x" # vg_num, [IsStreaming, IsInOutZA]>;
+def NAME # _H : SInst<"svreadz_za16_{d}_vg1x" # vg_num, vg_num # "m", 
"sUsbh", MergeNone, "aarch64_sme_readz_x" # vg_num, [IsStreaming, IsInOutZA]>;
+def NAME # _S : SInst<"svreadz_za32_{d}_vg1x" # vg_num, vg_num # "m", 
"iUif", MergeNone, "aarch64_sme_readz_x" # vg_num, [IsStreaming, IsInOutZA]>;
+def NAME # _D : SInst<"svreadz_za64_{d}_vg1x" # vg_num, vg_num # "m", 
"lUld", MergeNone, "aarch64_sme_readz_x" # vg_num, [IsStreaming, IsInOutZA]>;
+  }
+}
+
+defm SVREADZ_VG2 :  ZAReadz<"2">;
+defm SVREADZ_VG4 :  ZAReadz<"4">;
 } // let SVETargetGuard = InvalidMode
diff --git a/clang/test/CodeGen/aarch64-sme2p1-intrinsics/acle_sme2p1_movaz.c 
b/clang/test/CodeGen/aarch64-sme2p1-intrinsics/acle_sme2p1_movaz.c
index 7c9067a5ceece..4

[clang] [CUDA][NFC] CudaArch to GpuArch rename (PR #97028)

2024-06-28 Thread Jakub Chlanda via cfe-commits


@@ -52,7 +52,7 @@ const char *CudaVersionToString(CudaVersion V);
 // Input is "Major.Minor"
 CudaVersion CudaStringToVersion(const llvm::Twine &S);
 
-enum class CudaArch {
+enum class GpuArch {

jchlanda wrote:

Good idea, let me rename it real quick.

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


[clang] [clang][analyzer][doc] Migrate checkers-related docs from HTML to RST (PR #97032)

2024-06-28 Thread Endre Fülöp via cfe-commits

https://github.com/gamesh411 created 
https://github.com/llvm/llvm-project/pull/97032

Documentation for the checkers is kept up to date in RST files.
This patch removes duplication by replacing the HTML docs with links to
docs generated from the RST.

From b11a113682a1b998395139e5e4736689c0f9be84 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Endre=20F=C3=BCl=C3=B6p?= 
Date: Wed, 26 Jun 2024 11:09:33 +0200
Subject: [PATCH 1/3] [clang][analyzer][doc] Migrate checkers-related docs from
 HTML to RST

Documentation for the checkers is kept up to date in RST files.
This patch removes duplication by replacing the HTML docs with links to
docs generated from the RST.
---
 clang/www/analyzer/alpha_checks.html |  932 +---
 clang/www/analyzer/available_checks.html | 1736 +-
 2 files changed, 2 insertions(+), 2666 deletions(-)

diff --git a/clang/www/analyzer/alpha_checks.html 
b/clang/www/analyzer/alpha_checks.html
index 501a9bcbc82a9..80a3ebe4c6166 100644
--- a/clang/www/analyzer/alpha_checks.html
+++ b/clang/www/analyzer/alpha_checks.html
@@ -17,938 +17,8 @@
 
 
 
-Alpha Checkers
-Experimental checkers in addition to the 
-Default Checkers. These are checkers with known issues or limitations that
-keep them from being on by default. They are likely to have false positives.
-Bug reports are welcome but will likely not be investigated for some time.
-Patches welcome!
-
-Clone Alpha Checkers
-Core Alpha Checkers
-C++ Alpha Checkers
-LLVM Checkers
-Variable Argument Alpha Checkers
-Dead Code Alpha Checkers
-OS X Alpha Checkers
-Security Alpha Checkers
-Unix Alpha Checkers
-Non-determinism Alpha 
Checkers
-
 
-
-
-Clone Alpha Checkers
-
-
-Name, DescriptionExample
-
-
-
-alpha.clone.CloneChecker
-(C, C++, ObjC)
-Reports similar pieces of code.
-
-
-void log();
-
-int max(int a, int b) { // warn
-  log();
-  if (a > b)
-return a;
-  return b;
-}
-
-int maxClone(int x, int y) { // similar code here
-  log();
-  if (x > y)
-return x;
-  return y;
-}
-
-
-
-
-Core Alpha Checkers
-
-
-Name, DescriptionExample
-
-
-
-alpha.core.BoolAssignment
-(ObjC)
-Warn about assigning non-{0,1} values to boolean 
variables.
-
-
-void test() {
-  BOOL b = -1; // warn
-}
-
-
-
-
-alpha.core.CastSize
-(C)
-Check when casting a malloc'ed type T, whether the size is a multiple of the
-size of T (Works only with unix.Malloc
-or alpha.unix.MallocWithAnnotations
-checks enabled).
-
-
-void test() {
-  int *x = (int *)malloc(11); // warn
-}
-
-
-
-
-alpha.core.CastToStruct
-(C, C++)
-Check for cast from non-struct pointer to struct pointer.
-
-
-// C
-struct s {};
-
-void test(int *p) {
-  struct s *ps = (struct s *) p; // warn
-}
-
-
-// C++
-class c {};
-
-void test(int *p) {
-  c *pc = (c *) p; // warn
-}
-
-
-
-
-alpha.core.Conversion
-(C, C++, ObjC)
-Loss of sign or precision in implicit conversions
-
-
-void test(unsigned U, signed S) {
-  if (S > 10) {
-if (U < S) {
-}
-  }
-  if (S < -10) {
-if (U < S) { // warn (loss of sign)
-}
-  }
-}
-
-
-void test() {
-  long long A = 1LL << 60;
-  short X = A; // warn (loss of precision)
-}
-
-
-
-
-alpha.core.DynamicTypeChecker
-(ObjC)
-Check for cases where the dynamic and the static type of an
-object are unrelated.
-
-
-id date = [NSDate date];
-
-// Warning: Object has a dynamic type 'NSDate *' which is
-// incompatible with static type 'NSNumber *'"
-NSNumber *number = date;
-[number doubleValue];
-
-
-
-
-alpha.core.FixedAddr
-(C)
-Check for assignment of a fixed address to a pointer.
-
-
-void test() {
-  int *p;
-  p = (int *) 0x1; // warn
-}
-
-
-
-
-alpha.core.IdenticalExpr
-(C, C++)
-Warn about suspicious uses of identical expressions.
-
-
-// C
-void test() {
-  int a = 5;
-  int b = a | 4 | a; // warn: identical expr on both sides
-}
-
-
-// C++
-bool f(void);
-
-void test(bool b) {
-  int i = 10;
-  if (f()) { // warn: true and false branches are identical
-do {
-  i--;
-} while (f());
-  } else {
-do {
-  i--;
-} while (f());
-  }
-}
-
-
-
-
-alpha.core.PointerArithm
-(C)
-Check for pointer arithmetic on locations other than array
-elements.
-
-
-void test() {
-  int x;
-  int *p;
-  p = &x + 1; // warn
-}
-
-
-
-
-alpha.core.PointerSub
-(C)
-Check for pointer subtractions on two pointers pointing to different memory
-chunks.
-
-
-void test() {
-  int x, y;
-  int d = &y - &x; // warn
-}
-
-
-
-
-alpha.core.StackAddressAsyncEscape
-(C)
-Check that addresses to stack memory do not escape the function that involves
-dispatch_after or dispatch_async. This checker is
-a part of core.StackAddressEscape, but is
-https://reviews.llvm.org/D41042>temporarily disabled until some
-false positives are fixed.
-
-
-dispatch_block_t test_block_inside_block_async_leak() {
-  int x = 123;
-  void (^inner)(void) = ^void(void) {
-int y = x;
-++y;
-  };
-  void (^outer)(void) = ^void(void) {
-int z = x;
-++z;
-inner();
-  };
-  return outer; // warn: address of stack-allocated block is captured by a
- 

[clang] [clang][analyzer][doc] Migrate checkers-related docs from HTML to RST (PR #97032)

2024-06-28 Thread via cfe-commits
Endre =?utf-8?q?Fülöp?= ,
Endre =?utf-8?q?Fülöp?= 
Message-ID:
In-Reply-To: 


llvmbot wrote:




@llvm/pr-subscribers-clang

Author: Endre Fülöp (gamesh411)


Changes

Documentation for the checkers is kept up to date in RST files.
This patch removes duplication by replacing the HTML docs with links to
docs generated from the RST.

---

Patch is 87.51 KiB, truncated to 20.00 KiB below, full version: 
https://github.com/llvm/llvm-project/pull/97032.diff


5 Files Affected:

- (removed) clang/www/analyzer/alpha_checks.html (-956) 
- (modified) clang/www/analyzer/annotations.html (+1-1) 
- (removed) clang/www/analyzer/available_checks.html (-1760) 
- (modified) clang/www/analyzer/checker_dev_manual.html (+1-1) 
- (modified) clang/www/analyzer/menu.html.incl (+1-1) 


``diff
diff --git a/clang/www/analyzer/alpha_checks.html 
b/clang/www/analyzer/alpha_checks.html
deleted file mode 100644
index 501a9bcbc82a9..0
--- a/clang/www/analyzer/alpha_checks.html
+++ /dev/null
@@ -1,956 +0,0 @@
-http://www.w3.org/TR/html4/strict.dtd";>
-
-
-  Alpha Checks
-  
-  
-  
-  
-  
-  tr:first-child { width:20%; }
-  
-
-
-
-
-
-
-
-Alpha Checkers
-Experimental checkers in addition to the 
-Default Checkers. These are checkers with known issues or limitations that
-keep them from being on by default. They are likely to have false positives.
-Bug reports are welcome but will likely not be investigated for some time.
-Patches welcome!
-
-Clone Alpha Checkers
-Core Alpha Checkers
-C++ Alpha Checkers
-LLVM Checkers
-Variable Argument Alpha Checkers
-Dead Code Alpha Checkers
-OS X Alpha Checkers
-Security Alpha Checkers
-Unix Alpha Checkers
-Non-determinism Alpha 
Checkers
-
-
-
-
-Clone Alpha Checkers
-
-
-Name, DescriptionExample
-
-
-
-alpha.clone.CloneChecker
-(C, C++, ObjC)
-Reports similar pieces of code.
-
-
-void log();
-
-int max(int a, int b) { // warn
-  log();
-  if (a > b)
-return a;
-  return b;
-}
-
-int maxClone(int x, int y) { // similar code here
-  log();
-  if (x > y)
-return x;
-  return y;
-}
-
-
-
-
-Core Alpha Checkers
-
-
-Name, DescriptionExample
-
-
-
-alpha.core.BoolAssignment
-(ObjC)
-Warn about assigning non-{0,1} values to boolean 
variables.
-
-
-void test() {
-  BOOL b = -1; // warn
-}
-
-
-
-
-alpha.core.CastSize
-(C)
-Check when casting a malloc'ed type T, whether the size is a multiple of the
-size of T (Works only with unix.Malloc
-or alpha.unix.MallocWithAnnotations
-checks enabled).
-
-
-void test() {
-  int *x = (int *)malloc(11); // warn
-}
-
-
-
-
-alpha.core.CastToStruct
-(C, C++)
-Check for cast from non-struct pointer to struct pointer.
-
-
-// C
-struct s {};
-
-void test(int *p) {
-  struct s *ps = (struct s *) p; // warn
-}
-
-
-// C++
-class c {};
-
-void test(int *p) {
-  c *pc = (c *) p; // warn
-}
-
-
-
-
-alpha.core.Conversion
-(C, C++, ObjC)
-Loss of sign or precision in implicit conversions
-
-
-void test(unsigned U, signed S) {
-  if (S > 10) {
-if (U < S) {
-}
-  }
-  if (S < -10) {
-if (U < S) { // warn (loss of sign)
-}
-  }
-}
-
-
-void test() {
-  long long A = 1LL << 60;
-  short X = A; // warn (loss of precision)
-}
-
-
-
-
-alpha.core.DynamicTypeChecker
-(ObjC)
-Check for cases where the dynamic and the static type of an
-object are unrelated.
-
-
-id date = [NSDate date];
-
-// Warning: Object has a dynamic type 'NSDate *' which is
-// incompatible with static type 'NSNumber *'"
-NSNumber *number = date;
-[number doubleValue];
-
-
-
-
-alpha.core.FixedAddr
-(C)
-Check for assignment of a fixed address to a pointer.
-
-
-void test() {
-  int *p;
-  p = (int *) 0x1; // warn
-}
-
-
-
-
-alpha.core.IdenticalExpr
-(C, C++)
-Warn about suspicious uses of identical expressions.
-
-
-// C
-void test() {
-  int a = 5;
-  int b = a | 4 | a; // warn: identical expr on both sides
-}
-
-
-// C++
-bool f(void);
-
-void test(bool b) {
-  int i = 10;
-  if (f()) { // warn: true and false branches are identical
-do {
-  i--;
-} while (f());
-  } else {
-do {
-  i--;
-} while (f());
-  }
-}
-
-
-
-
-alpha.core.PointerArithm
-(C)
-Check for pointer arithmetic on locations other than array
-elements.
-
-
-void test() {
-  int x;
-  int *p;
-  p = &x + 1; // warn
-}
-
-
-
-
-alpha.core.PointerSub
-(C)
-Check for pointer subtractions on two pointers pointing to different memory
-chunks.
-
-
-void test() {
-  int x, y;
-  int d = &y - &x; // warn
-}
-
-
-
-
-alpha.core.StackAddressAsyncEscape
-(C)
-Check that addresses to stack memory do not escape the function that involves
-dispatch_after or dispatch_async. This checker is
-a part of core.StackAddressEscape, but is
-https://reviews.llvm.org/D41042>temporarily disabled until some
-false positives are fixed.
-
-
-dispatch_block_t test_block_inside_block_async_leak() {
-  int x = 123;
-  void (^inner)(void) = ^void(void) {
-int y = x;
-++y;
-  };
-  void (^outer)(void) = ^void(void) {
-int z = x;
-++z;
-inner();
-  };
-  return outer; // warn: address

[clang-tools-extra] [clang-tidy] improve messages when auto-fix does not work (PR #96917)

2024-06-28 Thread Piotr Zegar via cfe-commits

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


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


[clang-tools-extra] [clang-tidy]: Use correct term for user-provided constructor (PR #96617)

2024-06-28 Thread Piotr Zegar via cfe-commits

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


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


[clang] [llvm] [polly] [IR] Don't include Module.h in Analysis.h (NFC) (PR #97023)

2024-06-28 Thread Nikita Popov via cfe-commits

https://github.com/nikic updated https://github.com/llvm/llvm-project/pull/97023

>From f21bee2d46446e9238992fde4e190ce8010ede7a Mon Sep 17 00:00:00 2001
From: Nikita Popov 
Date: Thu, 27 Jun 2024 17:05:54 +0200
Subject: [PATCH 1/2] [IR] Don't include Module.h in Analysis.h (NFC)

Replace it with a forward declaration instead. Analysis.h is
pulled in by all passes, but not all passes need to access the
module.
---
 clang/lib/Interpreter/DeviceOffload.cpp| 1 +
 llvm/include/llvm/Analysis/TargetTransformInfo.h   | 1 +
 llvm/include/llvm/Analysis/VectorUtils.h   | 1 +
 llvm/include/llvm/IR/Analysis.h| 4 +++-
 llvm/include/llvm/Transforms/IPO/Attributor.h  | 1 +
 llvm/include/llvm/Transforms/Utils/Debugify.h  | 3 ++-
 llvm/lib/Analysis/CallPrinter.cpp  | 1 +
 llvm/lib/Analysis/InlineAdvisor.cpp| 1 +
 llvm/lib/Analysis/LazyValueInfo.cpp| 1 +
 llvm/lib/Analysis/LoopInfo.cpp | 1 +
 llvm/lib/Analysis/LoopPass.cpp | 1 +
 llvm/lib/Analysis/MLInlineAdvisor.cpp  | 1 +
 llvm/lib/Analysis/StructuralHash.cpp   | 1 +
 llvm/lib/Analysis/TargetLibraryInfo.cpp| 1 +
 llvm/lib/Analysis/TypeBasedAliasAnalysis.cpp   | 1 +
 llvm/lib/CodeGen/AsmPrinter/AIXException.cpp   | 1 +
 llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp   | 1 +
 llvm/lib/CodeGen/AsmPrinter/WinCFGuard.cpp | 1 +
 llvm/lib/CodeGen/AssignmentTrackingAnalysis.cpp| 1 +
 llvm/lib/CodeGen/CFGuardLongjmp.cpp| 1 +
 llvm/lib/CodeGen/EHContGuardCatchret.cpp   | 1 +
 llvm/lib/CodeGen/GCMetadata.cpp| 1 +
 llvm/lib/CodeGen/KCFI.cpp  | 1 +
 llvm/lib/CodeGen/MachineCheckDebugify.cpp  | 1 +
 llvm/lib/CodeGen/MachineFunctionPass.cpp   | 1 +
 llvm/lib/CodeGen/MachineModuleSlotTracker.cpp  | 1 +
 llvm/lib/CodeGen/RegAllocBase.cpp  | 1 +
 llvm/lib/CodeGen/RegAllocEvictionAdvisor.cpp   | 1 +
 llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp | 1 +
 llvm/lib/CodeGen/WinEHPrepare.cpp  | 1 +
 llvm/lib/ExecutionEngine/Orc/JITTargetMachineBuilder.cpp   | 1 +
 llvm/lib/IR/PassManager.cpp| 1 +
 llvm/lib/LTO/UpdateCompilerUsed.cpp| 3 ++-
 llvm/lib/Target/AArch64/AArch64AsmPrinter.cpp  | 1 +
 llvm/lib/Target/AArch64/AArch64FastISel.cpp| 1 +
 llvm/lib/Target/AArch64/AArch64InstrInfo.cpp   | 1 +
 llvm/lib/Target/AArch64/AArch64TargetObjectFile.cpp| 1 +
 llvm/lib/Target/AMDGPU/AMDGPUAliasAnalysis.h   | 1 +
 llvm/lib/Target/AMDGPU/AMDGPUMachineModuleInfo.cpp | 1 +
 llvm/lib/Target/AMDGPU/R600OpenCLImageTypeLoweringPass.cpp | 1 +
 llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp   | 1 +
 llvm/lib/Target/ARM/ARMInstrInfo.cpp   | 1 +
 llvm/lib/Target/ARM/ARMMachineFunctionInfo.cpp | 1 +
 llvm/lib/Target/ARM/Thumb1InstrInfo.cpp| 1 +
 llvm/lib/Target/ARM/Thumb2InstrInfo.cpp| 1 +
 llvm/lib/Target/AVR/AVRAsmPrinter.cpp  | 1 +
 llvm/lib/Target/BPF/BPFAsmPrinter.cpp  | 1 +
 llvm/lib/Target/BPF/BPFMISimplifyPatchable.cpp | 1 +
 llvm/lib/Target/BPF/BTFDebug.cpp   | 1 +
 llvm/lib/Target/Hexagon/HexagonInstrInfo.cpp   | 1 +
 llvm/lib/Target/Mips/MipsAsmPrinter.cpp| 1 +
 llvm/lib/Target/Mips/MipsISelLowering.cpp  | 1 +
 llvm/lib/Target/PowerPC/PPCMCInstLower.cpp | 1 +
 llvm/lib/Target/PowerPC/PPCSubtarget.cpp   | 2 ++
 llvm/lib/Target/RISCV/RISCVAsmPrinter.cpp  | 1 +
 llvm/lib/Target/RISCV/RISCVInstrInfo.cpp   | 1 +
 llvm/lib/Target/RISCV/RISCVTargetObjectFile.cpp| 1 +
 llvm/lib/Target/SystemZ/SystemZAsmPrinter.cpp  | 1 +
 llvm/lib/Target/SystemZ/SystemZISelLowering.cpp| 1 +
 llvm/lib/Target/Target.cpp | 1 +
 llvm/lib/Target/TargetMachine.cpp  | 1 +
 llvm/lib/Target/WebAssembly/WebAssemblyAsmPrinter.cpp  | 1 +
 llvm/lib/Target/WebAssembly/WebAssemblyMCLowerPrePass.cpp  | 1 +
 llvm/lib/Target/WebAssembly/WebAssemblyRegStackify.cpp | 1 +
 llvm/lib/Target/X86/X86FrameLowering.cpp   | 1 +
 llvm/lib/Target/X86/X86ISelDAGToDAG.cpp| 1 +
 llvm/lib/Target/X86/X86IndirectBranchTracking.cpp  | 1 +
 llvm/lib/Target/X86/X86InsertPrefetch.cpp  | 1 +
 llvm/lib/Target/X86/X86InstrInfo.cpp   | 1 +
 llvm/lib/Target/X

[clang] [Clang] Extend lifetime bound analysis to support assignments (PR #96475)

2024-06-28 Thread Utkarsh Saxena via cfe-commits

https://github.com/usx95 commented:

You can also add "Fixes: https://github.com/llvm/llvm-project/issues/54492"; to 
description to close this bug as this only asks for pointer type support

Please also add release notes.

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


[clang] [Clang] Extend lifetime bound analysis to support assignments (PR #96475)

2024-06-28 Thread Utkarsh Saxena via cfe-commits

https://github.com/usx95 edited https://github.com/llvm/llvm-project/pull/96475
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [Clang] Extend lifetime bound analysis to support assignments (PR #96475)

2024-06-28 Thread Utkarsh Saxena via cfe-commits


@@ -1028,6 +1045,7 @@ void checkExprLifetime(Sema &SemaRef, const 
InitializedEntity &Entity,
 
   switch (shouldLifetimeExtendThroughPath(Path)) {
   case PathLifetimeKind::Extend:
+assert(InitEntity && "Expect only on initializing the entity");

usx95 wrote:

Maybe make it clearer that we do not expect lifetime extension for assignment:
 "Lifetime extension should happen only for initialization and not assigment". 
Same below.

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


[clang] [clang][analyzer][doc] Migrate user-related docs from HTML to RST (PR #97034)

2024-06-28 Thread via cfe-commits
Endre =?utf-8?q?Fülöp?= ,
Endre =?utf-8?q?Fülöp?= ,
Endre =?utf-8?q?Fülöp?= ,
Endre =?utf-8?q?Fülöp?= ,
Endre =?utf-8?q?Fülöp?= ,
Endre =?utf-8?q?Fülöp?= ,
Endre =?utf-8?q?Fülöp?= 
Message-ID:
In-Reply-To: 


llvmbot wrote:



@llvm/pr-subscribers-clang

@llvm/pr-subscribers-clang-static-analyzer-1

Author: Endre Fülöp (gamesh411)


Changes

User documentation now found at https://clang-analyzer.llvm.org is
migrated to RST format.
The content of the documentation is updated to reflect recent
availability of binary releases and integration with XCode and
command-line tools.

---

Patch is 65.30 KiB, truncated to 20.00 KiB below, full version: 
https://github.com/llvm/llvm-project/pull/97034.diff


18 Files Affected:

- (added) clang/docs/analyzer/images/analyzer_html.png () 
- (added) clang/docs/analyzer/images/analyzer_xcode.png () 
- (added) clang/docs/analyzer/images/scan_build_cmd.png () 
- (modified) clang/docs/analyzer/user-docs.rst (+4) 
- (added) clang/docs/analyzer/user-docs/CommandLineUsage.rst (+238) 
- (added) clang/docs/analyzer/user-docs/FilingBugs.rst (+18) 
- (added) clang/docs/analyzer/user-docs/Installation.rst (+37) 
- (added) clang/docs/analyzer/user-docs/UsingWithXCode.rst (+88) 
- (removed) clang/www/analyzer/codechecker.html (-73) 
- (removed) clang/www/analyzer/command-line.html (-67) 
- (removed) clang/www/analyzer/filing_bugs.html (-45) 
- (modified) clang/www/analyzer/index.html (+5-5) 
- (removed) clang/www/analyzer/installation.html (-110) 
- (removed) clang/www/analyzer/latest_checker.html.incl (-1) 
- (modified) clang/www/analyzer/menu.html.incl (+4-4) 
- (modified) clang/www/analyzer/release_notes.html (+4-4) 
- (removed) clang/www/analyzer/scan-build.html (-383) 
- (removed) clang/www/analyzer/xcode.html (-143) 


``diff
diff --git a/clang/docs/analyzer/images/analyzer_html.png 
b/clang/docs/analyzer/images/analyzer_html.png
new file mode 100644
index 0..607ea1882e71b
Binary files /dev/null and b/clang/docs/analyzer/images/analyzer_html.png differ
diff --git a/clang/docs/analyzer/images/analyzer_xcode.png 
b/clang/docs/analyzer/images/analyzer_xcode.png
new file mode 100644
index 0..84c69809e8c39
Binary files /dev/null and b/clang/docs/analyzer/images/analyzer_xcode.png 
differ
diff --git a/clang/docs/analyzer/images/scan_build_cmd.png 
b/clang/docs/analyzer/images/scan_build_cmd.png
new file mode 100644
index 0..464fd4e129a20
Binary files /dev/null and b/clang/docs/analyzer/images/scan_build_cmd.png 
differ
diff --git a/clang/docs/analyzer/user-docs.rst 
b/clang/docs/analyzer/user-docs.rst
index 2292cec6944b1..08cb5119e810b 100644
--- a/clang/docs/analyzer/user-docs.rst
+++ b/clang/docs/analyzer/user-docs.rst
@@ -6,5 +6,9 @@ Contents:
 .. toctree::
:maxdepth: 2
 
+   user-docs/Installation
+   user-docs/CommandLineUsage
+   user-docs/UsingWithXCode
+   user-docs/FilingBugs
user-docs/CrossTranslationUnit
user-docs/TaintAnalysisConfiguration
diff --git a/clang/docs/analyzer/user-docs/CommandLineUsage.rst 
b/clang/docs/analyzer/user-docs/CommandLineUsage.rst
new file mode 100644
index 0..3a228b52e6c80
--- /dev/null
+++ b/clang/docs/analyzer/user-docs/CommandLineUsage.rst
@@ -0,0 +1,238 @@
+Command-Line Usage: CodeChecker and scan-build
+===
+
+This document provides guidelines for running Clang Static Analyzer from the 
command line on whole projects.
+CodeChecker and scan-build are two CLI tools for using CSA on multiple files 
(tranlation units).
+Both provide a way of driving the analyzer, detecting compilation flags, and 
generating reports.
+CodeChecker is more actively maintained, provides heuristics for working with 
multiple versions of popular compilers and it also comes with a web-based GUI 
for viewing, filtering, categorizing and suppressing the results.
+Therefore CodeChecker is recommended in case you need any of the above 
features or just more customizability in general.
+
+Comparison of CodeChecker and scan-build
+
+
+Static Analyzer is by design a GUI tool originally intended to be consumed by 
the XCode IDE.
+Its purpose is to find buggy execution paths in the program, and such paths 
are very hard to comprehend by looking at a non-interactive standard output.
+It is possible, however, to invoke the Static Analyzer from the command line 
in order to obtain analysis results, and then later view them interactively in 
a graphical interface.
+The following tools are used commonly to run the analyzer from the commandline.
+Both tools are wrapper scripts to drive the analysis and the underlying 
invocations of the Clang compiler:
+
+1. CodeChecker_ is a driver and web server that runs the Static Analyzer on 
your projects on demand and maintains a database of issues.
+- Perfect for managing large amounts of Static Analyzer warnings in a 
collaborative environment.
+- Generally much more feature-rich than s

[clang] [clang][analyzer][doc] Migrate user-related docs from HTML to RST (PR #97034)

2024-06-28 Thread Endre Fülöp via cfe-commits

gamesh411 wrote:

Some parts, especially Apple-related sections, may no longer be relevant in the 
docs.
Please share insights into which parts should be corrected or omitted from the 
migration process.
The legacy Clang builds (the most recent one uses Clang version 4.0.0) are 
still on the clang-analyzer.llvm.org site, and this seems to be the only part 
that requires the HTML page and the hosting provider (AFAIK).

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


[clang] [clang][ThreadSafety] Check trylock function success and return types (PR #95290)

2024-06-28 Thread via cfe-commits

asmok-g wrote:

Sorry for late reply. Sending in minutes!

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


[clang] [CUDA][NFC] CudaArch to GpuArch rename (PR #97028)

2024-06-28 Thread Jakub Chlanda via cfe-commits

https://github.com/jchlanda updated 
https://github.com/llvm/llvm-project/pull/97028

>From aa37f9f9df35c0464850fe95ca339545c5431de8 Mon Sep 17 00:00:00 2001
From: Jakub Chlanda 
Date: Fri, 28 Jun 2024 09:25:56 +
Subject: [PATCH] [CUDA][NFC] CudaArch to OffloadArch rename

Rename CudaArch to OffloadArch to better reflect its content and the
use. Apply a similar rename to helpers handling the enum.
---
 clang/include/clang/Basic/Cuda.h |  28 +--
 clang/lib/Basic/Cuda.cpp | 110 ++--
 clang/lib/Basic/Targets/NVPTX.cpp| 160 -
 clang/lib/Basic/Targets/NVPTX.h  |  20 +--
 clang/lib/CodeGen/CGOpenMPRuntimeGPU.cpp | 173 +--
 clang/lib/Driver/Driver.cpp  |  43 ++---
 clang/lib/Driver/OffloadBundler.cpp  |   3 +-
 clang/lib/Driver/ToolChains/AMDGPUOpenMP.cpp |   2 +-
 clang/lib/Driver/ToolChains/Cuda.cpp |  38 ++--
 clang/lib/Driver/ToolChains/Cuda.h   |   4 +-
 clang/lib/Sema/SemaDeclAttr.cpp  |  14 +-
 11 files changed, 297 insertions(+), 298 deletions(-)

diff --git a/clang/include/clang/Basic/Cuda.h b/clang/include/clang/Basic/Cuda.h
index 01cfe286c491b..83699f8897f66 100644
--- a/clang/include/clang/Basic/Cuda.h
+++ b/clang/include/clang/Basic/Cuda.h
@@ -52,7 +52,7 @@ const char *CudaVersionToString(CudaVersion V);
 // Input is "Major.Minor"
 CudaVersion CudaStringToVersion(const llvm::Twine &S);
 
-enum class CudaArch {
+enum class OffloadArch {
   UNUSED,
   UNKNOWN,
   // TODO: Deprecate and remove GPU architectures older than sm_52.
@@ -133,8 +133,8 @@ enum class CudaArch {
// public one.
   LAST,
 
-  CudaDefault = CudaArch::SM_52,
-  HIPDefault = CudaArch::GFX906,
+  CudaDefault = OffloadArch::SM_52,
+  HIPDefault = OffloadArch::GFX906,
 };
 
 enum class CUDAFunctionTarget {
@@ -145,26 +145,26 @@ enum class CUDAFunctionTarget {
   InvalidTarget
 };
 
-static inline bool IsNVIDIAGpuArch(CudaArch A) {
-  return A >= CudaArch::SM_20 && A < CudaArch::GFX600;
+static inline bool IsNVIDIAOffloadArch(OffloadArch A) {
+  return A >= OffloadArch::SM_20 && A < OffloadArch::GFX600;
 }
 
-static inline bool IsAMDGpuArch(CudaArch A) {
+static inline bool IsAMDOffloadArch(OffloadArch A) {
   // Generic processor model is for testing only.
-  return A >= CudaArch::GFX600 && A < CudaArch::Generic;
+  return A >= OffloadArch::GFX600 && A < OffloadArch::Generic;
 }
 
-const char *CudaArchToString(CudaArch A);
-const char *CudaArchToVirtualArchString(CudaArch A);
+const char *OffloadArchToString(OffloadArch A);
+const char *OffloadArchToVirtualArchString(OffloadArch A);
 
 // The input should have the form "sm_20".
-CudaArch StringToCudaArch(llvm::StringRef S);
+OffloadArch StringToOffloadArch(llvm::StringRef S);
 
-/// Get the earliest CudaVersion that supports the given CudaArch.
-CudaVersion MinVersionForCudaArch(CudaArch A);
+/// Get the earliest CudaVersion that supports the given OffloadArch.
+CudaVersion MinVersionForOffloadArch(OffloadArch A);
 
-/// Get the latest CudaVersion that supports the given CudaArch.
-CudaVersion MaxVersionForCudaArch(CudaArch A);
+/// Get the latest CudaVersion that supports the given OffloadArch.
+CudaVersion MaxVersionForOffloadArch(OffloadArch A);
 
 //  Various SDK-dependent features that affect CUDA compilation
 enum class CudaFeature {
diff --git a/clang/lib/Basic/Cuda.cpp b/clang/lib/Basic/Cuda.cpp
index af99c4d61021e..faf3878f064d2 100644
--- a/clang/lib/Basic/Cuda.cpp
+++ b/clang/lib/Basic/Cuda.cpp
@@ -72,23 +72,21 @@ CudaVersion ToCudaVersion(llvm::VersionTuple Version) {
 }
 
 namespace {
-struct CudaArchToStringMap {
-  CudaArch arch;
+struct OffloadArchToStringMap {
+  OffloadArch arch;
   const char *arch_name;
   const char *virtual_arch_name;
 };
 } // namespace
 
-#define SM2(sm, ca)
\
-  { CudaArch::SM_##sm, "sm_" #sm, ca }
+#define SM2(sm, ca) {OffloadArch::SM_##sm, "sm_" #sm, ca}
 #define SM(sm) SM2(sm, "compute_" #sm)
-#define GFX(gpu)   
\
-  { CudaArch::GFX##gpu, "gfx" #gpu, "compute_amdgcn" }
-static const CudaArchToStringMap arch_names[] = {
+#define GFX(gpu) {OffloadArch::GFX##gpu, "gfx" #gpu, "compute_amdgcn"}
+static const OffloadArchToStringMap arch_names[] = {
 // clang-format off
-{CudaArch::UNUSED, "", ""},
+{OffloadArch::UNUSED, "", ""},
 SM2(20, "compute_20"), SM2(21, "compute_20"), // Fermi
-SM(30), {CudaArch::SM_32_, "sm_32", "compute_32"}, SM(35), SM(37),  // 
Kepler
+SM(30), {OffloadArch::SM_32_, "sm_32", "compute_32"}, SM(35), SM(37),  // 
Kepler
 SM(50), SM(52), SM(53),  // Maxwell
 SM(60), SM(61), SM(62),  // Pascal
 SM(70), SM(72),  // Volta
@@ -112,7 +110,7 @@ static const CudaArchToStringMap arch_names[] = {
 GFX(803),  // gfx803
 GFX(805),  // gfx805
 GFX(810),  // gfx810
-{Cuda

[clang] [CUDA][NFC] CudaArch to GpuArch rename (PR #97028)

2024-06-28 Thread Jakub Chlanda via cfe-commits


@@ -52,7 +52,7 @@ const char *CudaVersionToString(CudaVersion V);
 // Input is "Major.Minor"
 CudaVersion CudaStringToVersion(const llvm::Twine &S);
 
-enum class CudaArch {
+enum class GpuArch {

jchlanda wrote:

Done.

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


[clang] [CUDA][NFC] CudaArch to OffloadArch rename (PR #97028)

2024-06-28 Thread Jakub Chlanda via cfe-commits

https://github.com/jchlanda edited 
https://github.com/llvm/llvm-project/pull/97028
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [CUDA][NFC] CudaArch to OffloadArch rename (PR #97028)

2024-06-28 Thread Jakub Chlanda via cfe-commits

https://github.com/jchlanda edited 
https://github.com/llvm/llvm-project/pull/97028
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [CUDA][NFC] CudaArch to OffloadArch rename (PR #97028)

2024-06-28 Thread Jakub Chlanda via cfe-commits


@@ -52,7 +52,7 @@ const char *CudaVersionToString(CudaVersion V);
 // Input is "Major.Minor"
 CudaVersion CudaStringToVersion(const llvm::Twine &S);
 
-enum class CudaArch {
+enum class GpuArch {

jchlanda wrote:

I've folded the commits to keep it clean.

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


[clang] [clang][ThreadSafety] Check trylock function success and return types (PR #95290)

2024-06-28 Thread via cfe-commits

asmok-g wrote:

https://godbolt.org/z/s6nTh6xxd does this serve ?

sorry if it's a bad code.. but it serves the purpose I think.

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


[clang] [flang] [Flang] Re-enable -print-resource-dir compiler option (PR #96799)

2024-06-28 Thread Tom Eccles via cfe-commits

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

@DavidTruby is on holiday

We have tested this on our end and it does not re-introduce the issue. Thanks 
for the revert & fix!

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


[clang] [llvm] [llvm][AArch64][TableGen] Create a ProcessorAlias record (PR #96249)

2024-06-28 Thread Tomas Matheson via cfe-commits

https://github.com/tmatheson-arm approved this pull request.


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


[clang] [llvm] [llvm][AArch64][TableGen] Create a ProcessorAlias record (PR #96249)

2024-06-28 Thread Tomas Matheson via cfe-commits


@@ -5,11 +5,11 @@
 
 // RUN: not %clang_cc1 -triple arm64--- -target-cpu not-a-cpu -fsyntax-only %s 
2>&1 | FileCheck %s --check-prefix AARCH64
 // AARCH64: error: unknown target CPU 'not-a-cpu'
-// AARCH64-NEXT: note: valid target CPU values are: generic, cortex-a35, 
cortex-a34, cortex-a53, cortex-a55, cortex-a510, cortex-a520, cortex-a520ae, 
cortex-a57, cortex-a65, cortex-a65ae, cortex-a72, cortex-a73, cortex-a75, 
cortex-a76, cortex-a76ae, cortex-a77, cortex-a78, cortex-a78ae, cortex-a78c, 
cortex-a710, cortex-a715, cortex-a720, cortex-a720ae, cortex-a725, cortex-r82, 
cortex-r82ae, cortex-x1, cortex-x1c, cortex-x2, cortex-x3, cortex-x4, 
cortex-x925, neoverse-e1, neoverse-n1, neoverse-n2, neoverse-n3, 
neoverse-512tvb, neoverse-v1, neoverse-v2, neoverse-v3, neoverse-v3ae, 
exynos-m3, exynos-m4, exynos-m5, falkor, saphira, kryo, thunderx, thunderxt88, 
thunderxt81, thunderxt83, thunderx2t99, thunderx3t110, tsv110, cyclone, 
apple-a7, apple-a8, apple-a9, apple-a10, apple-a11, apple-a12, apple-s4, 
apple-s5, apple-a13, apple-a14, apple-m1, apple-a15, apple-m2, apple-a16, 
apple-m3, apple-a17, apple-m4, a64fx, carmel, ampere1, ampere1a, ampere1b, 
oryon-1, cobalt-100, grace{{$}}
+// AARCH64-NEXT: note: valid target CPU values are: a64fx, ampere1, ampere1a, 
ampere1b, apple-a10, apple-a11, apple-a12, apple-a13, apple-a14, apple-a15, 
apple-a16, apple-a17, apple-a7, apple-a8, apple-a9, apple-m1, apple-m2, 
apple-m3, apple-m4, apple-s4, apple-s5, carmel, cobalt-100, cortex-a34, 
cortex-a35, cortex-a510, cortex-a520, cortex-a520ae, cortex-a53, cortex-a55, 
cortex-a57, cortex-a65, cortex-a65ae, cortex-a710, cortex-a715, cortex-a72, 
cortex-a720, cortex-a720ae, cortex-a725, cortex-a73, cortex-a75, cortex-a76, 
cortex-a76ae, cortex-a77, cortex-a78, cortex-a78ae, cortex-a78c, cortex-r82, 
cortex-r82ae, cortex-x1, cortex-x1c, cortex-x2, cortex-x3, cortex-x4, 
cortex-x925, cyclone, exynos-m3, exynos-m4, exynos-m5, falkor, generic, grace, 
kryo, neoverse-512tvb, neoverse-e1, neoverse-n1, neoverse-n2, neoverse-n3, 
neoverse-v1, neoverse-v2, neoverse-v3, neoverse-v3ae, oryon-1, saphira, 
thunderx, thunderx2t99, thunderx3t110, thunderxt81, thunderxt83, thunderxt88, 
tsv110{{$}}

tmatheson-arm wrote:

I meant `AARCH64-SAME`, but you are right, that will potentially miss things. 
I'd be happy with changing the actual output format, but it doesn't have to be 
done in this PR.

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


[clang] [clang][FMV] Do not omit explicit default target_version attribute. (PR #96628)

2024-06-28 Thread Alexandros Lamprineas via cfe-commits

https://github.com/labrinea updated 
https://github.com/llvm/llvm-project/pull/96628

>From ff4635208e9cd83c6735c95ebf12125ca737029a Mon Sep 17 00:00:00 2001
From: Alexandros Lamprineas 
Date: Tue, 25 Jun 2024 00:27:45 +0100
Subject: [PATCH 1/2] [clang][FMV] Do not omit explicit default target_version
 attribute.

Fixes a crash and cleans up some dead code.

namespace Foo {
int bar();
__attribute((target_version("default"))) int bar() { return 0; }
__attribute((target_version("mops"))) int bar() { return 1; }
}

$ clang++ --target=aarch64-linux-gnu --rtlib=compiler-rt fmv.cpp

None multiversion type isn't valid here
UNREACHABLE executed at clang/lib/CodeGen/CodeGenModule.cpp:1840!
...
getMangledNameImpl
clang::CodeGen::CodeGenModule::getMangledName
clang::CodeGen::CodeGenModule::EmitGlobal
---
 clang/include/clang/Sema/Sema.h  |  3 +-
 clang/lib/Sema/SemaDecl.cpp  | 45 +---
 clang/lib/Sema/SemaDeclAttr.cpp  | 16 ++---
 clang/test/CodeGen/attr-target-version.c | 88 
 clang/test/CodeGenCXX/fmv-namespace.cpp  | 60 
 clang/test/Sema/attr-target-version.c|  5 +-
 6 files changed, 118 insertions(+), 99 deletions(-)

diff --git a/clang/include/clang/Sema/Sema.h b/clang/include/clang/Sema/Sema.h
index 2e7af0f691cbb..31bb81705a742 100644
--- a/clang/include/clang/Sema/Sema.h
+++ b/clang/include/clang/Sema/Sema.h
@@ -3786,8 +3786,7 @@ class Sema final : public SemaBase {
 StringRef Name);
 
   bool checkTargetAttr(SourceLocation LiteralLoc, StringRef Str);
-  bool checkTargetVersionAttr(SourceLocation LiteralLoc, Decl *D,
-  StringRef &Str, bool &isDefault);
+  bool checkTargetVersionAttr(SourceLocation Loc, Decl *D, StringRef Str);
   bool checkTargetClonesAttrString(
   SourceLocation LiteralLoc, StringRef Str, const StringLiteral *Literal,
   Decl *D, bool &HasDefault, bool &HasCommas, bool &HasNotDefault,
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp
index 029ccf944c513..572c46eed1aaa 100644
--- a/clang/lib/Sema/SemaDecl.cpp
+++ b/clang/lib/Sema/SemaDecl.cpp
@@ -11465,6 +11465,10 @@ static bool CheckMultiVersionFirstFunction(Sema &S, 
FunctionDecl *FD) {
   // otherwise it is treated as a normal function.
   if (TA && !TA->isDefaultVersion())
 return false;
+  // The target_version attribute only causes Multiversioning if this
+  // declaration is NOT the default version.
+  if (TVA && TVA->isDefaultVersion())
+return false;
 
   if ((TA || TVA) && CheckMultiVersionValue(S, FD)) {
 FD->setInvalidDecl();
@@ -11498,11 +11502,9 @@ static void patchDefaultTargetVersion(FunctionDecl 
*From, FunctionDecl *To) {
 
   if (MVKindTo == MultiVersionKind::None &&
   (MVKindFrom == MultiVersionKind::TargetVersion ||
-   MVKindFrom == MultiVersionKind::TargetClones)) {
-To->setIsMultiVersion();
+   MVKindFrom == MultiVersionKind::TargetClones))
 To->addAttr(TargetVersionAttr::CreateImplicit(
 To->getASTContext(), "default", To->getSourceRange()));
-  }
 }
 
 static bool CheckTargetCausesMultiVersioning(Sema &S, FunctionDecl *OldFD,
@@ -11523,10 +11525,16 @@ static bool CheckTargetCausesMultiVersioning(Sema &S, 
FunctionDecl *OldFD,
   const auto *OldTVA = OldFD->getAttr();
   // If the old decl is NOT MultiVersioned yet, and we don't cause that
   // to change, this is a simple redeclaration.
-  if ((NewTA && !NewTA->isDefaultVersion() &&
-   (!OldTA || OldTA->getFeaturesStr() == NewTA->getFeaturesStr())) ||
-  (NewTVA && !NewTVA->isDefaultVersion() &&
-   (!OldTVA || OldTVA->getName() == NewTVA->getName(
+  if (NewTA && !NewTA->isDefaultVersion() &&
+  (!OldTA || OldTA->getFeaturesStr() == NewTA->getFeaturesStr()))
+return false;
+
+  // The target_version attribute only causes Multiversioning if this
+  // declaration is NOT the default version. Moreover, the old declaration
+  // must be the default version (either explicitly via the attribute,
+  // or implicitly without it).
+  if (NewTVA &&
+  (NewTVA->isDefaultVersion() || (OldTVA && !OldTVA->isDefaultVersion(
 return false;
 
   // Otherwise, this decl causes MultiVersioning.
@@ -11543,8 +11551,7 @@ static bool CheckTargetCausesMultiVersioning(Sema &S, 
FunctionDecl *OldFD,
   }
 
   // If this is 'default', permit the forward declaration.
-  if ((NewTA && NewTA->isDefaultVersion() && !OldTA) ||
-  (NewTVA && NewTVA->isDefaultVersion() && !OldTVA)) {
+  if (NewTA && NewTA->isDefaultVersion() && !OldTA) {
 Redeclaration = true;
 OldDecl = OldFD;
 OldFD->setIsMultiVersion();
@@ -11947,24 +11954,8 @@ static bool CheckMultiVersionFunction(Sema &S, 
FunctionDecl *NewFD,
 
   FunctionDecl *OldFD = OldDecl->getAsFunction();
 
-  if (!OldFD->isMultiVersion() && MVKind == MultiVersionKind::None) {
-if (NewTVA || !OldFD->getAttr())
-  return false;
-if (!NewFD->getType()->getAs()) {
-  // Multiversion

[clang] [clang][FMV] Do not omit explicit default target_version attribute. (PR #96628)

2024-06-28 Thread Alexandros Lamprineas via cfe-commits


@@ -11576,22 +11584,6 @@ static bool CheckTargetCausesMultiVersioning(Sema &S, 
FunctionDecl *OldFD,
 }
   }
 
-  if (NewTVA) {

labrinea wrote:

This is checking things like
```
//expected-note@+1 {{previous declaration is here}}
void __attribute__((target_version("bti+flagm2"))) one(void) {}
//expected-error@+1 {{multiversioned function redeclarations require identical 
target attributes}}
void __attribute__((target_version("flagm2+bti"))) one(void) {}
 ```
 (example taken from clang/test/Sema/attr-target-version.c)
 
 At this point we know that the new declaration is triggering multiversioning 
therefore the old was the (implicit or explicit) default.

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


[clang] [clang][FMV] Do not omit explicit default target_version attribute. (PR #96628)

2024-06-28 Thread Alexandros Lamprineas via cfe-commits

https://github.com/labrinea edited 
https://github.com/llvm/llvm-project/pull/96628
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang][FMV] Do not omit explicit default target_version attribute. (PR #96628)

2024-06-28 Thread Alexandros Lamprineas via cfe-commits

https://github.com/labrinea edited 
https://github.com/llvm/llvm-project/pull/96628
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [flang] [Flang] Re-enable -print-resource-dir compiler option (PR #96799)

2024-06-28 Thread Kelvin Li via cfe-commits

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

LG.  Thanks.

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


[clang] [AMDGPU][OpenMP] Do not attach -fcuda-is-device flag for AMDGPU OpenMP (PR #96909)

2024-06-28 Thread via cfe-commits

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


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


[clang] [C11] Generic selection expressions and qualified rvalues (PR #96913)

2024-06-28 Thread Aaron Ballman via cfe-commits

AaronBallman wrote:

> > Discussion on the WG14 reflectors suggested that the qualifiers should 
> > still be stripped from the type of the controlling expression; the standard 
> > should be corrected to make this more clear.
> 
> Does WG14 think we're right to produce a qualified rvalue in this case? 
> Another option might be to strip qualifiers in rvalue member access, but that 
> would have further-reaching impact.

The sentiment on the reflector (granted, it's reflector sentiment and not asked 
of the whole committee in an official way) was that you do get a qualified 
rvalue out a member access expression and that it has utility for cases like 
use with `typeof` (consider: `typeof(foo().i) x = 12;`, but that we really 
should update the way qualifiers work so we can clean up edge cases in the 
language (like if the structure contained an array, there's a special case to 
give the returned object temporary lifetime but that might make it an lvalue or 
it could be an rvalue, depending on how you squint). `_Generic` is the only 
case we could find where it's possible to get an rvalue that you then perform 
notional lvalue conversion on, so the plan is for me to write a paper to 
narrowly repair `_Generic` by specifying the type is decayed and qualifiers are 
stripped rather than leaning on lvalue conversion.

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


[clang] [llvm] [PowerPC] Diagnose musttail instead of crash inside backend (PR #93267)

2024-06-28 Thread Chen Zheng via cfe-commits

https://github.com/chenzheng1030 updated 
https://github.com/llvm/llvm-project/pull/93267

>From dc1902589e601bd5673aecf58eb11b85543f0ad5 Mon Sep 17 00:00:00 2001
From: Chen Zheng 
Date: Thu, 23 May 2024 22:59:48 -0400
Subject: [PATCH 1/4] [PowerPC] Diagnose musttail instead of crash inside
 backend

musttail does not often possible to generate on PPC targets as when calling
to a function defined in another model, PPC needs to restore the TOC
pointer. To restore the TOC pointer, compiler needs to emit a nop
after the function call to let linker generate codes to restore
TOC pointer. Tail call does not generate expected call sequence for this
case.

To avoid the crash inside the compiler backend, a diagnosis is added
in the frontend and in the backend, PPC will change the musttail to
tail.

Fixes #63214
---
 .../clang/Basic/DiagnosticSemaKinds.td|  5 +++
 clang/lib/CodeGen/CGCall.cpp  | 10 +-
 clang/test/SemaCXX/attr-musttail-ppc.cpp  | 12 +++
 llvm/lib/Target/PowerPC/PPCISelLowering.cpp   | 15 +++--
 llvm/test/CodeGen/PowerPC/musttail-call.ll| 32 +++
 5 files changed, 70 insertions(+), 4 deletions(-)
 create mode 100644 clang/test/SemaCXX/attr-musttail-ppc.cpp
 create mode 100644 llvm/test/CodeGen/PowerPC/musttail-call.ll

diff --git a/clang/include/clang/Basic/DiagnosticSemaKinds.td 
b/clang/include/clang/Basic/DiagnosticSemaKinds.td
index 96f0c0f0205c2..c07b87a63c07b 100644
--- a/clang/include/clang/Basic/DiagnosticSemaKinds.td
+++ b/clang/include/clang/Basic/DiagnosticSemaKinds.td
@@ -3864,6 +3864,11 @@ def note_cannot_use_trivial_abi_reason : Note<
   "it is polymorphic|"
   "it has a base of a non-trivial class type|it has a virtual base|"
   "it has a __weak field|it has a field of a non-trivial class type}1">;
+def warn_ppc_musttail_maybe_ignored: Warning<
+  "'musttail' attribute may be ignored on ppc targets">,
+  InGroup;
+def err_aix_musttail_unsupported: Error<
+  "'musttail' attribute is not supported on AIX">;
 
 // Availability attribute
 def warn_availability_unknown_platform : Warning<
diff --git a/clang/lib/CodeGen/CGCall.cpp b/clang/lib/CodeGen/CGCall.cpp
index 2b301130ef7b7..dae3d3287f683 100644
--- a/clang/lib/CodeGen/CGCall.cpp
+++ b/clang/lib/CodeGen/CGCall.cpp
@@ -26,6 +26,7 @@
 #include "clang/AST/DeclCXX.h"
 #include "clang/AST/DeclObjC.h"
 #include "clang/Basic/CodeGenOptions.h"
+#include "clang/Basic/DiagnosticSema.h"
 #include "clang/Basic/TargetInfo.h"
 #include "clang/CodeGen/CGFunctionInfo.h"
 #include "clang/CodeGen/SwiftCallingConv.h"
@@ -5751,8 +5752,15 @@ RValue CodeGenFunction::EmitCall(const CGFunctionInfo 
&CallInfo,
   if (llvm::CallInst *Call = dyn_cast(CI)) {
 if (TargetDecl && TargetDecl->hasAttr())
   Call->setTailCallKind(llvm::CallInst::TCK_NoTail);
-else if (IsMustTail)
+else if (IsMustTail) {
+  if (getTarget().getTriple().isPPC()) {
+if (getTarget().getTriple().isOSAIX())
+  CGM.getDiags().Report(Loc, diag::err_aix_musttail_unsupported);
+else
+  CGM.getDiags().Report(Loc, diag::warn_ppc_musttail_maybe_ignored);
+  }
   Call->setTailCallKind(llvm::CallInst::TCK_MustTail);
+}
   }
 
   // Add metadata for calls to MSAllocator functions
diff --git a/clang/test/SemaCXX/attr-musttail-ppc.cpp 
b/clang/test/SemaCXX/attr-musttail-ppc.cpp
new file mode 100644
index 0..72b61adf7560b
--- /dev/null
+++ b/clang/test/SemaCXX/attr-musttail-ppc.cpp
@@ -0,0 +1,12 @@
+// RUN: %clang_cc1 %s -triple powerpc64-ibm-aix-xcoff -o /dev/null -emit-llvm 
-verify=aix
+// RUN: %clang_cc1 %s -triple powerpc-ibm-aix-xcoff -o /dev/null -emit-llvm 
-verify=aix
+// RUN: %clang_cc1 %s -triple powerpc64-unknown-linux-gnu -o /dev/null 
-emit-llvm -verify=linux
+// RUN: %clang_cc1 %s -triple powerpc-unknown-linux-gnu -o /dev/null 
-emit-llvm -verify=linux
+// RUN: %clang_cc1 %s -triple powerpc64le-unknown-linux-gnu -o /dev/null 
-emit-llvm -verify=linux
+
+int Func();
+int Func1() {
+  // linux-warning@+2 {{'musttail' attribute may be ignored on ppc targets}}
+  // aix-error@+1 {{'musttail' attribute is not supported on AIX}}
+  [[clang::musttail]] return Func();
+}
diff --git a/llvm/lib/Target/PowerPC/PPCISelLowering.cpp 
b/llvm/lib/Target/PowerPC/PPCISelLowering.cpp
index 4d4008ac0ba70..17439a620df2e 100644
--- a/llvm/lib/Target/PowerPC/PPCISelLowering.cpp
+++ b/llvm/lib/Target/PowerPC/PPCISelLowering.cpp
@@ -146,6 +146,10 @@ static cl::opt PPCAIXTLSModelOptUseIEForLDLimit(
 cl::desc("Set inclusive limit count of TLS local-dynamic access(es) in a "
  "function to use initial-exec"));
 
+static cl::opt AbortOnImpossibleMusttailCall(
+"ppc-abort-on-impossible-musttailcall", cl::init(false), cl::Hidden,
+cl::desc("Abort if any call marked as musttail is impossible."));
+
 STATISTIC(NumTailCalls, "Number of tail calls");
 STATISTIC(NumSiblingCalls, "Number of sibling calls");
 STATISTIC(ShufflesHandledWithVPERM,
@@ -5945,9 +5949,14 @@ 
PP

[clang] [llvm] [PowerPC] Diagnose musttail instead of crash inside backend (PR #93267)

2024-06-28 Thread Chen Zheng via cfe-commits


@@ -5751,8 +5751,29 @@ RValue CodeGenFunction::EmitCall(const CGFunctionInfo 
&CallInfo,
   if (llvm::CallInst *Call = dyn_cast(CI)) {
 if (TargetDecl && TargetDecl->hasAttr())
   Call->setTailCallKind(llvm::CallInst::TCK_NoTail);
-else if (IsMustTail)
+else if (IsMustTail) {
+  if (getTarget().getTriple().isPPC()) {
+if (getTarget().getTriple().isOSAIX())
+  CGM.getDiags().Report(Loc, diag::err_aix_musttail_unsupported);
+else if (!getTarget().hasFeature("pcrelative-memops")) {
+  if (getTarget().hasFeature("longcall"))
+CGM.getDiags().Report(Loc, diag::err_ppc_impossible_musttail) << 0;
+  else if (Call->isIndirectCall())
+CGM.getDiags().Report(Loc, diag::err_ppc_impossible_musttail) << 1;
+  else if (isa_and_nonnull(TargetDecl) &&
+   cast(TargetDecl)->isWeak())

chenzheng1030 wrote:

Thanks very much. I've added the check, hope these are the APIs you expected.

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


[clang] Extend -Wnonportable-include-path with a warning about trailing whitespace or dots (PR #96960)

2024-06-28 Thread Aaron Ballman via cfe-commits

https://github.com/AaronBallman edited 
https://github.com/llvm/llvm-project/pull/96960
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] Extend -Wnonportable-include-path with a warning about trailing whitespace or dots (PR #96960)

2024-06-28 Thread Aaron Ballman via cfe-commits

https://github.com/AaronBallman commented:

Thank you for working on this! Please be sure to add a release note to 
`clang/docs/ReleaseNotes.rst` so users know about the improved diagnostics.

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


[clang] Extend -Wnonportable-include-path with a warning about trailing whitespace or dots (PR #96960)

2024-06-28 Thread Aaron Ballman via cfe-commits


@@ -361,7 +361,11 @@ class NonportablePath  : Warning<
   "non-portable path to file '%0'; specified path differs in case from file"
   " name on disk">;
 def pp_nonportable_path : NonportablePath,
-  InGroup>;
+  InGroup;

AaronBallman wrote:

I would be nice to give the diagnostic group a different identifier (the name 
we expose to users is fine!) so that we don't have this weird naming conflict 
between the diagnostic group and the `class NonportablePath` definition a few 
lines up from here.

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


[clang] Extend -Wnonportable-include-path with a warning about trailing whitespace or dots (PR #96960)

2024-06-28 Thread Aaron Ballman via cfe-commits


@@ -0,0 +1,11 @@
+// REQUIRES: case-insensitive-filesystem
+// RUN: %clang_cc1 -Wall %s
+
+#include "empty_file_to_include.h " // expected-warning {{non-portable path}}
+#include "empty_file_to_include.h." // expected-warning {{non-portable path}}
+#include "empty_file_to_include.h   " // expected-warning {{non-portable 
path}}
+#include "empty_file_to_include.h..." // expected-warning {{non-portable 
path}}
+#include "empty_file_to_include.h . . . " // expected-warning {{non-portable 
path}}
+#include "empty_file_to_include.h.. .. " // expected-warning {{non-portable 
path}}
+
+#include "empty_file_to_include.h" // No warning

AaronBallman wrote:

Please add a newline to the end of the file.

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


[clang-tools-extra] 7878d9c - [clangd] Replace an include with a forward declaration

2024-06-28 Thread Nico Weber via cfe-commits

Author: Nico Weber
Date: 2024-06-28T13:38:14+02:00
New Revision: 7878d9c0363528c44effe55aae2843fbabb6dd0e

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

LOG: [clangd] Replace an include with a forward declaration

The real Client.cpp and other users of Client.h (ClangdMain.cpp, Dexp.cpp)
already include index/Index.h, so no effect there.

And UnimplementedClient.cpp only returns `nullptr` and doesn't need
to know the full type.

Makes it possible to compile UnimplementedClient.cpp without having
to wait for clang's tblgen code generators.

No behavior change.

Added: 


Modified: 
clang-tools-extra/clangd/index/remote/Client.h

Removed: 




diff  --git a/clang-tools-extra/clangd/index/remote/Client.h 
b/clang-tools-extra/clangd/index/remote/Client.h
index ff5348bd23279..2fdcf7723d5be 100644
--- a/clang-tools-extra/clangd/index/remote/Client.h
+++ b/clang-tools-extra/clangd/index/remote/Client.h
@@ -9,11 +9,13 @@
 #ifndef LLVM_CLANG_TOOLS_EXTRA_CLANGD_INDEX_REMOTE_CLIENT_H
 #define LLVM_CLANG_TOOLS_EXTRA_CLANGD_INDEX_REMOTE_CLIENT_H
 
-#include "index/Index.h"
 #include "llvm/ADT/StringRef.h"
 
 namespace clang {
 namespace clangd {
+
+class SymbolIndex;
+
 namespace remote {
 
 /// Returns an SymbolIndex client that passes requests to remote index located



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


[clang-tools-extra] 69c99ad - [clangd] Fix build on linux after 7878d9c036352

2024-06-28 Thread Nico Weber via cfe-commits

Author: Nico Weber
Date: 2024-06-28T13:42:54+02:00
New Revision: 69c99ad7e84b075bbafc541a2e4397e18975391d

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

LOG: [clangd] Fix build on linux after 7878d9c036352

Added: 


Modified: 
clang-tools-extra/clangd/index/remote/Client.h

Removed: 




diff  --git a/clang-tools-extra/clangd/index/remote/Client.h 
b/clang-tools-extra/clangd/index/remote/Client.h
index 2fdcf7723d5be..9755fb23c2ba5 100644
--- a/clang-tools-extra/clangd/index/remote/Client.h
+++ b/clang-tools-extra/clangd/index/remote/Client.h
@@ -11,6 +11,8 @@
 
 #include "llvm/ADT/StringRef.h"
 
+#include 
+
 namespace clang {
 namespace clangd {
 



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


[clang] [llvm] [AArch64][NEON] Add intrinsics for LUTI (PR #96883)

2024-06-28 Thread via cfe-commits

https://github.com/Lukacma updated 
https://github.com/llvm/llvm-project/pull/96883

>From cb2ebe232013576f57f8f26b9156fccd75d7d38f Mon Sep 17 00:00:00 2001
From: Marian Lukac 
Date: Thu, 27 Jun 2024 09:38:17 +
Subject: [PATCH 1/2] [AArch64][NEON] Add intrinsics for LUTI

---
 clang/include/clang/Basic/arm_neon.td |  16 +
 clang/lib/CodeGen/CGBuiltin.cpp   |  54 +++
 clang/test/CodeGen/aarch64-neon-luti.c| 433 ++
 llvm/include/llvm/IR/IntrinsicsAArch64.td |  19 +
 .../lib/Target/AArch64/AArch64InstrFormats.td |  14 +-
 llvm/lib/Target/AArch64/AArch64InstrInfo.td   |  70 +++
 llvm/test/CodeGen/AArch64/neon-luti.ll| 207 +
 7 files changed, 806 insertions(+), 7 deletions(-)
 create mode 100644 clang/test/CodeGen/aarch64-neon-luti.c
 create mode 100644 llvm/test/CodeGen/AArch64/neon-luti.ll

diff --git a/clang/include/clang/Basic/arm_neon.td 
b/clang/include/clang/Basic/arm_neon.td
index 6390ba3f9fe5e..0dd76ce32fc20 100644
--- a/clang/include/clang/Basic/arm_neon.td
+++ b/clang/include/clang/Basic/arm_neon.td
@@ -2096,3 +2096,19 @@ let ArchGuard = "defined(__aarch64__) || 
defined(__arm64ec__)", TargetGuard = "r
   def VLDAP1_LANE : WInst<"vldap1_lane", ".(c*!).I", "QUlQlUlldQdPlQPl">;
   def VSTL1_LANE  : WInst<"vstl1_lane", "v*(.!)I", "QUlQlUlldQdPlQPl">;
 }
+
+//Lookup table read with 2-bit/4-bit indices
+let ArchGuard = "defined(__aarch64__)", TargetGuard = "lut" in {
+  def VLUTI2_B: SInst<"vluti2_lane","Q.(qU)I",   "cUcPcQcQUcQPc">;
+  def VLUTI2_B_Q  : SInst<"vluti2_laneq",   "Q.(QU)I",   "cUcPcQcQUcQPc">;
+  def VLUTI2_H: SInst<"vluti2_lane","Q.(qU<)I",   "sUsPshQsQUsQPsQh">;
+  def VLUTI2_H_Q  : SInst<"vluti2_laneq",   "Q.(QU<)I",   "sUsPshQsQUsQPsQh">; 
 
+  def VLUTI4_B: SInst<"vluti4_laneq","..UI",   "QcQUcQPc">;
+  def VLUTI4_H_X2 : SInst<"vluti4_laneq_x2", ".2(U<)I", "QsQUsQPsQh">;
+
+  let ArchGuard = "defined(__aarch64__)", TargetGuard= "lut,bf16" in {
+def VLUTI2_BF  : SInst<"vluti2_lane", "Q.(qU<)I",   "bQb">;  
+def VLUTI2_BF_Q: SInst<"vluti2_laneq","Q.(QU<)I",   "bQb">;  
+def VLUTI4_BF_X2   : SInst<"vluti4_laneq_x2", ".2(U<)I", "Qb">;
+  }
+}
diff --git a/clang/lib/CodeGen/CGBuiltin.cpp b/clang/lib/CodeGen/CGBuiltin.cpp
index 511e1fd4016d7..f9ac6c9dc8504 100644
--- a/clang/lib/CodeGen/CGBuiltin.cpp
+++ b/clang/lib/CodeGen/CGBuiltin.cpp
@@ -13357,6 +13357,60 @@ Value 
*CodeGenFunction::EmitAArch64BuiltinExpr(unsigned BuiltinID,
 Int = Intrinsic::aarch64_neon_suqadd;
 return EmitNeonCall(CGM.getIntrinsic(Int, Ty), Ops, "vuqadd");
   }
+
+  case NEON::BI__builtin_neon_vluti2_lane_bf16:
+  case NEON::BI__builtin_neon_vluti2_lane_f16:
+  case NEON::BI__builtin_neon_vluti2_lane_p16:
+  case NEON::BI__builtin_neon_vluti2_lane_p8:
+  case NEON::BI__builtin_neon_vluti2_lane_s16:
+  case NEON::BI__builtin_neon_vluti2_lane_s8:
+  case NEON::BI__builtin_neon_vluti2_lane_u16:
+  case NEON::BI__builtin_neon_vluti2_lane_u8:
+  case NEON::BI__builtin_neon_vluti2_laneq_bf16:
+  case NEON::BI__builtin_neon_vluti2_laneq_f16:
+  case NEON::BI__builtin_neon_vluti2_laneq_p16:
+  case NEON::BI__builtin_neon_vluti2_laneq_p8:
+  case NEON::BI__builtin_neon_vluti2_laneq_s16:
+  case NEON::BI__builtin_neon_vluti2_laneq_s8:
+  case NEON::BI__builtin_neon_vluti2_laneq_u16:
+  case NEON::BI__builtin_neon_vluti2_laneq_u8:
+  case NEON::BI__builtin_neon_vluti2q_lane_bf16:
+  case NEON::BI__builtin_neon_vluti2q_lane_f16:
+  case NEON::BI__builtin_neon_vluti2q_lane_p16:
+  case NEON::BI__builtin_neon_vluti2q_lane_p8:
+  case NEON::BI__builtin_neon_vluti2q_lane_s16:
+  case NEON::BI__builtin_neon_vluti2q_lane_s8:
+  case NEON::BI__builtin_neon_vluti2q_lane_u16:
+  case NEON::BI__builtin_neon_vluti2q_lane_u8:
+  case NEON::BI__builtin_neon_vluti2q_laneq_bf16:
+  case NEON::BI__builtin_neon_vluti2q_laneq_f16:
+  case NEON::BI__builtin_neon_vluti2q_laneq_p16:
+  case NEON::BI__builtin_neon_vluti2q_laneq_p8:
+  case NEON::BI__builtin_neon_vluti2q_laneq_s16:
+  case NEON::BI__builtin_neon_vluti2q_laneq_s8:
+  case NEON::BI__builtin_neon_vluti2q_laneq_u16:
+  case NEON::BI__builtin_neon_vluti2q_laneq_u8: {
+Int = Intrinsic::aarch64_neon_vluti2_lane;
+llvm::Type *Tys[3];
+Tys[0] = Ty;
+Tys[1] = Ops[0]->getType();
+Tys[2] = Ops[1]->getType();
+return EmitNeonCall(CGM.getIntrinsic(Int, Tys), Ops, "vluti2_lane");
+  }
+  case NEON::BI__builtin_neon_vluti4q_laneq_p8:
+  case NEON::BI__builtin_neon_vluti4q_laneq_s8:
+  case NEON::BI__builtin_neon_vluti4q_laneq_u8: {
+Int = Intrinsic::aarch64_neon_vluti4q_laneq;
+return EmitNeonCall(CGM.getIntrinsic(Int, Ty), Ops, "vluti4q_laneq");
+  }
+  case NEON::BI__builtin_neon_vluti4q_laneq_bf16_x2:
+  case NEON::BI__builtin_neon_vluti4q_laneq_f16_x2:
+  case NEON::BI__builtin_neon_vluti4q_laneq_p16_x2:
+  case NEON::BI__builtin_neon_vluti4q_laneq_s16_x2:
+  case NEON::BI__builtin_neon_vluti4q_laneq_u16_x2: {
+Int = Intrinsic::aar

[clang] [llvm] [AArch64][NEON] Add intrinsics for LUTI (PR #96883)

2024-06-28 Thread via cfe-commits


@@ -6420,6 +6420,76 @@ def : Pat<(v16i8 (int_aarch64_neon_tbx1 (v16i8 V128:$Rd),
 let Predicates = [HasLUT] in {
   defm LUT2 : BaseSIMDTableLookupIndexed2<"luti2">;
   defm LUT4 : BaseSIMDTableLookupIndexed4<"luti4">;
+
+  def : Pat<(v16i8 (int_aarch64_neon_vluti2_lane (v8i8 V64:$Rn), 
+  (v8i8 V64:$Rm), (i32 VectorIndexS32b_timm:$idx))),
+  (LUT2_B (INSERT_SUBREG (IMPLICIT_DEF), V64:$Rn, dsub), 
(INSERT_SUBREG (IMPLICIT_DEF), V64:$Rm, dsub),  VectorIndexS32b_timm:$idx)>;
+  def : Pat<(v16i8 (int_aarch64_neon_vluti2_lane (v8i8 V64:$Rn), 
+  (v16i8 V128:$Rm), (i32 VectorIndexS32b_timm:$idx))),
+  (LUT2_B (INSERT_SUBREG (IMPLICIT_DEF), V64:$Rn, dsub), V128:$Rm,  
VectorIndexS32b_timm:$idx)>;
+  def : Pat<(v16i8 (int_aarch64_neon_vluti2_lane (v16i8 V128:$Rn), 
+  (v8i8 V64:$Rm), (i32 VectorIndexS32b_timm:$idx))),
+  (LUT2_B V128:$Rn, (INSERT_SUBREG (IMPLICIT_DEF), V64:$Rm, dsub),  
VectorIndexS32b_timm:$idx)>;
+  def : Pat<(v16i8 (int_aarch64_neon_vluti2_lane (v16i8 V128:$Rn), 
+  (v16i8 V128:$Rm), (i32 VectorIndexS32b_timm:$idx))),
+  (LUT2_B V128:$Rn, V128:$Rm,  VectorIndexS32b_timm:$idx)>;
+  def : Pat<(v8i16 (int_aarch64_neon_vluti2_lane (v4i16 V64:$Rn), 
+(v8i8 V64:$Rm), (i32 VectorIndexH32b_timm:$idx))),
+(LUT2_H (INSERT_SUBREG (IMPLICIT_DEF), V64:$Rn, dsub), 
(INSERT_SUBREG (IMPLICIT_DEF), V64:$Rm, dsub),  VectorIndexH32b_timm:$idx)>;
+  def : Pat<(v8f16 (int_aarch64_neon_vluti2_lane (v4f16 V64:$Rn), 
+(v8i8 V64:$Rm), (i32 VectorIndexH32b_timm:$idx))),
+(LUT2_H (INSERT_SUBREG (IMPLICIT_DEF), V64:$Rn, dsub), 
(INSERT_SUBREG (IMPLICIT_DEF), V64:$Rm, dsub),  VectorIndexH32b_timm:$idx)>;
+  def : Pat<(v8i16 (int_aarch64_neon_vluti2_lane (v4i16 V64:$Rn), 
+(v16i8 V128:$Rm), (i32 VectorIndexH32b_timm:$idx))),
+(LUT2_H (INSERT_SUBREG (IMPLICIT_DEF), V64:$Rn, dsub), V128:$Rm,  
VectorIndexH32b_timm:$idx)>;
+  def : Pat<(v8f16 (int_aarch64_neon_vluti2_lane (v4f16 V64:$Rn), 
+(v16i8 V128:$Rm), (i32 VectorIndexH32b_timm:$idx))),
+(LUT2_H (INSERT_SUBREG (IMPLICIT_DEF), V64:$Rn, dsub), V128:$Rm,  
VectorIndexH32b_timm:$idx)>;
+  def : Pat<(v8i16 (int_aarch64_neon_vluti2_lane (v8i16 V128:$Rn), 
+(v8i8 V64:$Rm), (i32 VectorIndexH32b_timm:$idx))),
+(LUT2_H V128:$Rn, (INSERT_SUBREG (IMPLICIT_DEF), V64:$Rm, dsub),  
VectorIndexH32b_timm:$idx)>;
+  def : Pat<(v8f16 (int_aarch64_neon_vluti2_lane (v8f16 V128:$Rn), 
+(v8i8 V64:$Rm), (i32 VectorIndexH32b_timm:$idx))),
+(LUT2_H V128:$Rn, (INSERT_SUBREG (IMPLICIT_DEF), V64:$Rm, dsub),  
VectorIndexH32b_timm:$idx)>;
+  def : Pat<(v8i16 (int_aarch64_neon_vluti2_lane (v8i16 VecListOne8h:$Rn), 
+(v16i8 V128:$Rm), (i32 VectorIndexH32b_timm:$idx))),
+(LUT2_H VecListOne8h:$Rn, V128:$Rm,  VectorIndexH32b_timm:$idx)>;
+  def : Pat<(v8f16 (int_aarch64_neon_vluti2_lane (v8f16 VecListOne8h:$Rn), 
+(v16i8 V128:$Rm), (i32 VectorIndexH32b_timm:$idx))),
+(LUT2_H VecListOne8h:$Rn, V128:$Rm,  VectorIndexH32b_timm:$idx)>;
+
+  def : Pat<(v16i8 (int_aarch64_neon_vluti4q_laneq (v16i8 VecListOne16b:$Rn), 
+(v16i8 V128:$Rm), (i32 VectorIndexD32b_timm:$idx))),
+(LUT4_B VecListOne16b:$Rn, V128:$Rm,  VectorIndexD32b_timm:$idx)>;
+
+  def : Pat<(v8i16 (int_aarch64_neon_vluti4q_laneq_x2 (v8i16 
VecListOne8h:$Rn1), 
+(v8i16 VecListOne8h:$Rn2), (v16i8 V128:$Rm), 
+(i32 VectorIndexS32b_timm:$idx))),
+(LUT4_H (REG_SEQUENCE QQ, VecListOne8h:$Rn1, qsub0, 
VecListOne8h:$Rn2, qsub1), V128:$Rm,  VectorIndexS32b_timm:$idx)>;
+  def : Pat<(v8f16 (int_aarch64_neon_vluti4q_laneq_x2 (v8f16 
VecListOne8h:$Rn1), 
+(v8f16 VecListOne8h:$Rn2), (v16i8 V128:$Rm), 
+(i32 VectorIndexS32b_timm:$idx))),
+(LUT4_H (REG_SEQUENCE QQ, VecListOne8h:$Rn1, qsub0, 
VecListOne8h:$Rn2, qsub1), V128:$Rm,  VectorIndexS32b_timm:$idx)>;
+}
+
+let Predicates = [HasLUT, HasBF16] in {

Lukacma wrote:

Thank you for the suggestion. I have , hopefully, cleaned up patterns now. 

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


[clang] [llvm] [AArch64][NEON] Add intrinsics for LUTI (PR #96883)

2024-06-28 Thread via cfe-commits


@@ -2096,3 +2096,19 @@ let ArchGuard = "defined(__aarch64__) || 
defined(__arm64ec__)", TargetGuard = "r
   def VLDAP1_LANE : WInst<"vldap1_lane", ".(c*!).I", "QUlQlUlldQdPlQPl">;
   def VSTL1_LANE  : WInst<"vstl1_lane", "v*(.!)I", "QUlQlUlldQdPlQPl">;
 }
+
+//Lookup table read with 2-bit/4-bit indices

Lukacma wrote:

Done

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


[clang] [CUDA][NFC] CudaArch to OffloadArch rename (PR #97028)

2024-06-28 Thread Matt Arsenault via cfe-commits

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


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


[clang] [CUDA][NFC] CudaArch to OffloadArch rename (PR #97028)

2024-06-28 Thread Joseph Huber via cfe-commits

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

This is definitely overdue, thanks. 

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


[clang] 4169338 - [IR] Don't include Module.h in Analysis.h (NFC) (#97023)

2024-06-28 Thread via cfe-commits

Author: Nikita Popov
Date: 2024-06-28T14:30:47+02:00
New Revision: 4169338e75cdce73d34063532db598c95ee82ae4

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

LOG: [IR] Don't include Module.h in Analysis.h (NFC) (#97023)

Replace it with a forward declaration instead. Analysis.h is pulled in
by all passes, but not all passes need to access the module.

Added: 


Modified: 
clang/lib/Interpreter/DeviceOffload.cpp
llvm/include/llvm/Analysis/TargetTransformInfo.h
llvm/include/llvm/Analysis/VectorUtils.h
llvm/include/llvm/IR/Analysis.h
llvm/include/llvm/Transforms/IPO/Attributor.h
llvm/include/llvm/Transforms/Utils/Debugify.h
llvm/lib/Analysis/CallPrinter.cpp
llvm/lib/Analysis/InlineAdvisor.cpp
llvm/lib/Analysis/LazyValueInfo.cpp
llvm/lib/Analysis/LoopInfo.cpp
llvm/lib/Analysis/LoopPass.cpp
llvm/lib/Analysis/MLInlineAdvisor.cpp
llvm/lib/Analysis/StructuralHash.cpp
llvm/lib/Analysis/TargetLibraryInfo.cpp
llvm/lib/Analysis/TypeBasedAliasAnalysis.cpp
llvm/lib/CodeGen/AsmPrinter/AIXException.cpp
llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp
llvm/lib/CodeGen/AsmPrinter/WinCFGuard.cpp
llvm/lib/CodeGen/AssignmentTrackingAnalysis.cpp
llvm/lib/CodeGen/CFGuardLongjmp.cpp
llvm/lib/CodeGen/EHContGuardCatchret.cpp
llvm/lib/CodeGen/GCMetadata.cpp
llvm/lib/CodeGen/KCFI.cpp
llvm/lib/CodeGen/MachineCheckDebugify.cpp
llvm/lib/CodeGen/MachineFunctionPass.cpp
llvm/lib/CodeGen/MachineModuleSlotTracker.cpp
llvm/lib/CodeGen/RegAllocBase.cpp
llvm/lib/CodeGen/RegAllocEvictionAdvisor.cpp
llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
llvm/lib/CodeGen/WinEHPrepare.cpp
llvm/lib/ExecutionEngine/Orc/JITTargetMachineBuilder.cpp
llvm/lib/IR/PassManager.cpp
llvm/lib/LTO/UpdateCompilerUsed.cpp
llvm/lib/Target/AArch64/AArch64AsmPrinter.cpp
llvm/lib/Target/AArch64/AArch64FastISel.cpp
llvm/lib/Target/AArch64/AArch64InstrInfo.cpp
llvm/lib/Target/AArch64/AArch64TargetObjectFile.cpp
llvm/lib/Target/AMDGPU/AMDGPUAliasAnalysis.h
llvm/lib/Target/AMDGPU/AMDGPUMachineModuleInfo.cpp
llvm/lib/Target/AMDGPU/R600OpenCLImageTypeLoweringPass.cpp
llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp
llvm/lib/Target/ARM/ARMInstrInfo.cpp
llvm/lib/Target/ARM/ARMMachineFunctionInfo.cpp
llvm/lib/Target/ARM/Thumb1InstrInfo.cpp
llvm/lib/Target/ARM/Thumb2InstrInfo.cpp
llvm/lib/Target/AVR/AVRAsmPrinter.cpp
llvm/lib/Target/BPF/BPFAsmPrinter.cpp
llvm/lib/Target/BPF/BPFMISimplifyPatchable.cpp
llvm/lib/Target/BPF/BTFDebug.cpp
llvm/lib/Target/Hexagon/HexagonInstrInfo.cpp
llvm/lib/Target/Mips/MipsAsmPrinter.cpp
llvm/lib/Target/Mips/MipsISelLowering.cpp
llvm/lib/Target/PowerPC/PPCMCInstLower.cpp
llvm/lib/Target/PowerPC/PPCSubtarget.cpp
llvm/lib/Target/RISCV/RISCVAsmPrinter.cpp
llvm/lib/Target/RISCV/RISCVInstrInfo.cpp
llvm/lib/Target/RISCV/RISCVTargetObjectFile.cpp
llvm/lib/Target/SystemZ/SystemZAsmPrinter.cpp
llvm/lib/Target/SystemZ/SystemZISelLowering.cpp
llvm/lib/Target/Target.cpp
llvm/lib/Target/TargetMachine.cpp
llvm/lib/Target/WebAssembly/WebAssemblyAsmPrinter.cpp
llvm/lib/Target/WebAssembly/WebAssemblyMCLowerPrePass.cpp
llvm/lib/Target/WebAssembly/WebAssemblyRegStackify.cpp
llvm/lib/Target/X86/X86FrameLowering.cpp
llvm/lib/Target/X86/X86ISelDAGToDAG.cpp
llvm/lib/Target/X86/X86IndirectBranchTracking.cpp
llvm/lib/Target/X86/X86InsertPrefetch.cpp
llvm/lib/Target/X86/X86InstrInfo.cpp
llvm/lib/Target/X86/X86PreTileConfig.cpp
llvm/lib/Target/X86/X86ReturnThunks.cpp
llvm/lib/Target/X86/X86Subtarget.cpp
llvm/lib/Transforms/IPO/CalledValuePropagation.cpp
llvm/lib/Transforms/Instrumentation/LowerAllowCheckPass.cpp
llvm/lib/Transforms/Instrumentation/PGOForceFunctionAttrs.cpp
llvm/lib/Transforms/Scalar/ConstantHoisting.cpp
llvm/lib/Transforms/Scalar/MakeGuardsExplicit.cpp
llvm/lib/Transforms/Scalar/PlaceSafepoints.cpp
llvm/lib/Transforms/Utils/CanonicalizeAliases.cpp
llvm/lib/Transforms/Utils/DemoteRegToStack.cpp
llvm/lib/Transforms/Utils/LowerGlobalDtors.cpp
llvm/unittests/Analysis/AssumeBundleQueriesTest.cpp
llvm/unittests/Analysis/DDGTest.cpp
llvm/unittests/Analysis/GlobalsModRefTest.cpp
llvm/unittests/Analysis/IVDescriptorsTest.cpp
llvm/unittests/Analysis/LoopInfoTest.cpp
llvm/unittests/Analysis/LoopNestTest.cpp
llvm/unittests/CodeGen/AArch64SelectionDAGTest.cpp
llvm/unittests/CodeGen/AMDGPUMetadataTest.cpp
llvm/unittests/CodeGen/MLRegAllocDevelopmentFeatures.cpp
llvm/unittests/CodeGen/SelectionDAGAddressAnalysisTest.cpp
llvm/unittests/CodeGen/SelectionDAGPatternMatchTest.cpp
llvm/unittests/MI/LiveIntervalTest.cpp
llvm/unittests/MIR/MachineMetadata.cpp
llvm/unittests/Ta

[clang] [llvm] [polly] [IR] Don't include Module.h in Analysis.h (NFC) (PR #97023)

2024-06-28 Thread Nikita Popov via cfe-commits

https://github.com/nikic closed https://github.com/llvm/llvm-project/pull/97023
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [C23] Add INFINITY and NAN macros to (PR #96659)

2024-06-28 Thread Aaron Ballman via cfe-commits

https://github.com/AaronBallman updated 
https://github.com/llvm/llvm-project/pull/96659

>From b59c7f8c91d7c128975554d90bef3657ce3b2728 Mon Sep 17 00:00:00 2001
From: Aaron Ballman 
Date: Tue, 25 Jun 2024 10:52:56 -0400
Subject: [PATCH 1/3] [C23] Add INFINITY and NAN macros to 

This is in support of WG14 N2848 which only define the macros if
infinity and nan are supported, so use of -ffinite-math will cause the
macros to not be defined.
---
 clang/docs/ReleaseNotes.rst |  5 +
 clang/lib/Headers/float.h   |  6 ++
 clang/test/Headers/float.c  | 29 +
 3 files changed, 40 insertions(+)

diff --git a/clang/docs/ReleaseNotes.rst b/clang/docs/ReleaseNotes.rst
index df579ae398c5e..45c9a2cc47b09 100644
--- a/clang/docs/ReleaseNotes.rst
+++ b/clang/docs/ReleaseNotes.rst
@@ -336,6 +336,11 @@ C23 Feature Support
 - Properly promote bit-fields of bit-precise integer types to the field's type
   rather than to ``int``. #GH87641
 
+- Added the ``INFINITY`` and ``NAN`` macros to Clang's 
+  freestanding implementation; these macros were defined in C99 but Clang
+  implements the macros as described by C23 in
+  `WG14 N2848 `_.
+
 Non-comprehensive list of changes in this release
 -
 
diff --git a/clang/lib/Headers/float.h b/clang/lib/Headers/float.h
index 642c8f06cc938..929c0854a865b 100644
--- a/clang/lib/Headers/float.h
+++ b/clang/lib/Headers/float.h
@@ -47,6 +47,8 @@
 (defined(__cplusplus) && __cplusplus >= 201103L) ||
\
 (__STDC_HOSTED__ && defined(_AIX) && defined(_ALL_SOURCE))
 #undef DECIMAL_DIG
+#undef INFINITY
+#undef NAN
 #  endif
 #  undef FLT_DIG
 #  undef DBL_DIG
@@ -93,6 +95,10 @@
 #if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) ||  
\
 (defined(__cplusplus) && __cplusplus >= 201103L)
 #define FLT_EVAL_METHOD __FLT_EVAL_METHOD__
+#if defined(__FINITE_MATH_ONLY__) && !__FINITE_MATH_ONLY__
+#  define INFINITY (__builtin_infinity())
+#  define NAN (__builtin_nan(""))
+#endif
 #endif
 #define FLT_ROUNDS (__builtin_flt_rounds())
 #define FLT_RADIX __FLT_RADIX__
diff --git a/clang/test/Headers/float.c b/clang/test/Headers/float.c
index 70c11b0537537..8dfbc32521ade 100644
--- a/clang/test/Headers/float.c
+++ b/clang/test/Headers/float.c
@@ -1,9 +1,13 @@
 // RUN: %clang_cc1 -fsyntax-only -verify -std=c89 -ffreestanding %s
 // RUN: %clang_cc1 -fsyntax-only -verify -std=c99 -ffreestanding %s
 // RUN: %clang_cc1 -fsyntax-only -verify -std=c11 -ffreestanding %s
+// RUN: %clang_cc1 -fsyntax-only -verify -std=c23 -ffreestanding %s
+// RUN: %clang_cc1 -fsyntax-only -verify -std=c23 -ffreestanding 
-ffinite-math-only %s
 // RUN: %clang_cc1 -fsyntax-only -verify -xc++ -std=c++11 -ffreestanding %s
 // RUN: %clang_cc1 -fsyntax-only -verify -xc++ -std=c++14 -ffreestanding %s
 // RUN: %clang_cc1 -fsyntax-only -verify -xc++ -std=c++17 -ffreestanding %s
+// RUN: %clang_cc1 -fsyntax-only -verify -xc++ -std=c++23 -ffreestanding %s
+// RUN: %clang_cc1 -fsyntax-only -verify -xc++ -std=c++23 -ffreestanding 
-ffinite-math-only %s
 // expected-no-diagnostics
 
 /* Basic floating point conformance checks against:
@@ -107,10 +111,35 @@
 #elif   DECIMAL_DIG < 10
 #error "Mandatory macro DECIMAL_DIG is invalid."
 #endif
+
+#if __FINITE_MATH_ONLY__ == 0
+#ifndef INFINITY
+#error "Mandatory macro INFINITY is missing."
+#endif
+#ifndef NAN
+#error "Mandatory macro NAN is missing."
+#endif
+#else
+#ifdef INFINITY
+#error "Macro INFINITY should not be defined."
+#endif
+
+#ifdef NAN
+#error "Macro NAN should not be defined."
+#endif
+#endif
 #else
 #ifdef DECIMAL_DIG
 #error "Macro DECIMAL_DIG should not be defined."
 #endif
+
+#ifdef INFINITY
+#error "Macro INFINITY should not be defined."
+#endif
+
+#ifdef NAN
+#error "Macro NAN should not be defined."
+#endif
 #endif
 
 

>From 86055e3ecb25befdffdf17f2a1eb8b9c704a1e7a Mon Sep 17 00:00:00 2001
From: Aaron Ballman 
Date: Tue, 25 Jun 2024 10:55:03 -0400
Subject: [PATCH 2/3] Update the status page

---
 clang/www/c_status.html | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/clang/www/c_status.html b/clang/www/c_status.html
index 04c1df9ebc050..bc37f8cd5e404 100644
--- a/clang/www/c_status.html
+++ b/clang/www/c_status.html
@@ -991,7 +991,7 @@ C23 implementation status
 
   Contradiction about INFINITY macro
   https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2848.pdf";>N2848
-  Unknown
+  Clang 19
 
 
   Require exact-width integer type interfaces

>From 88019c9964068a43f96f1ab13b75fb6e60238470 Mon Sep 17 00:00:00 2001
From: Aaron Ballman 
Date: Fri, 28 Jun 2024 08:31:45 -0400
Subject: [PATCH 3/3] Update based on review feedback

* Now de

[clang] [C23] Add INFINITY and NAN macros to (PR #96659)

2024-06-28 Thread Aaron Ballman via cfe-commits

https://github.com/AaronBallman updated 
https://github.com/llvm/llvm-project/pull/96659

>From b59c7f8c91d7c128975554d90bef3657ce3b2728 Mon Sep 17 00:00:00 2001
From: Aaron Ballman 
Date: Tue, 25 Jun 2024 10:52:56 -0400
Subject: [PATCH 1/3] [C23] Add INFINITY and NAN macros to 

This is in support of WG14 N2848 which only define the macros if
infinity and nan are supported, so use of -ffinite-math will cause the
macros to not be defined.
---
 clang/docs/ReleaseNotes.rst |  5 +
 clang/lib/Headers/float.h   |  6 ++
 clang/test/Headers/float.c  | 29 +
 3 files changed, 40 insertions(+)

diff --git a/clang/docs/ReleaseNotes.rst b/clang/docs/ReleaseNotes.rst
index df579ae398c5e..45c9a2cc47b09 100644
--- a/clang/docs/ReleaseNotes.rst
+++ b/clang/docs/ReleaseNotes.rst
@@ -336,6 +336,11 @@ C23 Feature Support
 - Properly promote bit-fields of bit-precise integer types to the field's type
   rather than to ``int``. #GH87641
 
+- Added the ``INFINITY`` and ``NAN`` macros to Clang's 
+  freestanding implementation; these macros were defined in C99 but Clang
+  implements the macros as described by C23 in
+  `WG14 N2848 `_.
+
 Non-comprehensive list of changes in this release
 -
 
diff --git a/clang/lib/Headers/float.h b/clang/lib/Headers/float.h
index 642c8f06cc938..929c0854a865b 100644
--- a/clang/lib/Headers/float.h
+++ b/clang/lib/Headers/float.h
@@ -47,6 +47,8 @@
 (defined(__cplusplus) && __cplusplus >= 201103L) ||
\
 (__STDC_HOSTED__ && defined(_AIX) && defined(_ALL_SOURCE))
 #undef DECIMAL_DIG
+#undef INFINITY
+#undef NAN
 #  endif
 #  undef FLT_DIG
 #  undef DBL_DIG
@@ -93,6 +95,10 @@
 #if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) ||  
\
 (defined(__cplusplus) && __cplusplus >= 201103L)
 #define FLT_EVAL_METHOD __FLT_EVAL_METHOD__
+#if defined(__FINITE_MATH_ONLY__) && !__FINITE_MATH_ONLY__
+#  define INFINITY (__builtin_infinity())
+#  define NAN (__builtin_nan(""))
+#endif
 #endif
 #define FLT_ROUNDS (__builtin_flt_rounds())
 #define FLT_RADIX __FLT_RADIX__
diff --git a/clang/test/Headers/float.c b/clang/test/Headers/float.c
index 70c11b0537537..8dfbc32521ade 100644
--- a/clang/test/Headers/float.c
+++ b/clang/test/Headers/float.c
@@ -1,9 +1,13 @@
 // RUN: %clang_cc1 -fsyntax-only -verify -std=c89 -ffreestanding %s
 // RUN: %clang_cc1 -fsyntax-only -verify -std=c99 -ffreestanding %s
 // RUN: %clang_cc1 -fsyntax-only -verify -std=c11 -ffreestanding %s
+// RUN: %clang_cc1 -fsyntax-only -verify -std=c23 -ffreestanding %s
+// RUN: %clang_cc1 -fsyntax-only -verify -std=c23 -ffreestanding 
-ffinite-math-only %s
 // RUN: %clang_cc1 -fsyntax-only -verify -xc++ -std=c++11 -ffreestanding %s
 // RUN: %clang_cc1 -fsyntax-only -verify -xc++ -std=c++14 -ffreestanding %s
 // RUN: %clang_cc1 -fsyntax-only -verify -xc++ -std=c++17 -ffreestanding %s
+// RUN: %clang_cc1 -fsyntax-only -verify -xc++ -std=c++23 -ffreestanding %s
+// RUN: %clang_cc1 -fsyntax-only -verify -xc++ -std=c++23 -ffreestanding 
-ffinite-math-only %s
 // expected-no-diagnostics
 
 /* Basic floating point conformance checks against:
@@ -107,10 +111,35 @@
 #elif   DECIMAL_DIG < 10
 #error "Mandatory macro DECIMAL_DIG is invalid."
 #endif
+
+#if __FINITE_MATH_ONLY__ == 0
+#ifndef INFINITY
+#error "Mandatory macro INFINITY is missing."
+#endif
+#ifndef NAN
+#error "Mandatory macro NAN is missing."
+#endif
+#else
+#ifdef INFINITY
+#error "Macro INFINITY should not be defined."
+#endif
+
+#ifdef NAN
+#error "Macro NAN should not be defined."
+#endif
+#endif
 #else
 #ifdef DECIMAL_DIG
 #error "Macro DECIMAL_DIG should not be defined."
 #endif
+
+#ifdef INFINITY
+#error "Macro INFINITY should not be defined."
+#endif
+
+#ifdef NAN
+#error "Macro NAN should not be defined."
+#endif
 #endif
 
 

>From 86055e3ecb25befdffdf17f2a1eb8b9c704a1e7a Mon Sep 17 00:00:00 2001
From: Aaron Ballman 
Date: Tue, 25 Jun 2024 10:55:03 -0400
Subject: [PATCH 2/3] Update the status page

---
 clang/www/c_status.html | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/clang/www/c_status.html b/clang/www/c_status.html
index 04c1df9ebc050..bc37f8cd5e404 100644
--- a/clang/www/c_status.html
+++ b/clang/www/c_status.html
@@ -991,7 +991,7 @@ C23 implementation status
 
   Contradiction about INFINITY macro
   https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2848.pdf";>N2848
-  Unknown
+  Clang 19
 
 
   Require exact-width integer type interfaces

>From 88019c9964068a43f96f1ab13b75fb6e60238470 Mon Sep 17 00:00:00 2001
From: Aaron Ballman 
Date: Fri, 28 Jun 2024 08:31:45 -0400
Subject: [PATCH 3/3] Update based on review feedback

* Now de

[clang] [Clang] Clarify diagnostic notes for implicitly generated deduction guides (PR #96084)

2024-06-28 Thread Aaron Ballman via cfe-commits

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

LGTM, thank you for the improvement to deduction guide diagnostics!

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


[clang] [compiler-rt] [llvm] [PAC][AArch64] Support init/fini array signing (PR #96478)

2024-06-28 Thread Daniil Kovalev via cfe-commits

https://github.com/kovdan01 updated 
https://github.com/llvm/llvm-project/pull/96478

>From 5399237a71c0ccd872821034d83ea2c3a04bed3f Mon Sep 17 00:00:00 2001
From: Daniil Kovalev 
Date: Fri, 21 Jun 2024 12:32:51 +0300
Subject: [PATCH 1/2] [PAC][AArch64] Support init/fini array signing

If both `-fptrauth-init-fini` and `-fptrauth-calls` are passed, sign
function pointers in `llvm.global_ctors` and `llvm.global_dtors` with
constant discriminator 0xD9D4 (`ptrauth_string_discriminator("init_fini")`).
Additionally, if `-fptrauth-init-fini-address-discrimination` is passed,
address discrimination is used for signing (otherwise, just constant
discriminator is used).
---
 clang/include/clang/Basic/Features.def|  1 +
 clang/include/clang/Basic/LangOptions.def |  1 +
 .../include/clang/Basic/PointerAuthOptions.h  |  7 ++
 clang/include/clang/Driver/Options.td |  1 +
 clang/lib/CodeGen/CodeGenModule.cpp   | 63 +--
 clang/lib/Driver/ToolChains/Clang.cpp |  3 +
 clang/lib/Frontend/CompilerInvocation.cpp |  9 +++
 clang/lib/Headers/ptrauth.h   |  8 ++
 clang/test/CodeGen/aarch64-elf-pauthabi.c | 12 ++-
 clang/test/CodeGen/ptrauth-init-fini.c| 39 ++
 clang/test/Driver/aarch64-ptrauth.c   |  6 +-
 clang/test/Preprocessor/ptrauth_feature.c | 52 +
 compiler-rt/lib/builtins/crtbegin.c   | 16 
 llvm/include/llvm/BinaryFormat/ELF.h  |  3 +-
 .../AArch64/note-gnu-property-elf-pauthabi.ll |  2 +-
 .../test/CodeGen/AArch64/ptrauth-init-fini.ll | 77 +++
 .../ELF/AArch64/aarch64-feature-pauth.s   | 18 ++---
 llvm/tools/llvm-readobj/ELFDumper.cpp |  4 +-
 18 files changed, 268 insertions(+), 54 deletions(-)
 create mode 100644 clang/test/CodeGen/ptrauth-init-fini.c
 create mode 100644 llvm/test/CodeGen/AArch64/ptrauth-init-fini.ll

diff --git a/clang/include/clang/Basic/Features.def 
b/clang/include/clang/Basic/Features.def
index 53f410d3cb4bd..5dca40b261655 100644
--- a/clang/include/clang/Basic/Features.def
+++ b/clang/include/clang/Basic/Features.def
@@ -110,6 +110,7 @@ FEATURE(ptrauth_vtable_pointer_address_discrimination, 
LangOpts.PointerAuthVTPtr
 FEATURE(ptrauth_vtable_pointer_type_discrimination, 
LangOpts.PointerAuthVTPtrTypeDiscrimination)
 FEATURE(ptrauth_member_function_pointer_type_discrimination, 
LangOpts.PointerAuthCalls)
 FEATURE(ptrauth_init_fini, LangOpts.PointerAuthInitFini)
+FEATURE(ptrauth_init_fini_address_discrimination, 
LangOpts.PointerAuthInitFiniAddressDiscrimination)
 EXTENSION(swiftcc,
   PP.getTargetInfo().checkCallingConvention(CC_Swift) ==
   clang::TargetInfo::CCCR_OK)
diff --git a/clang/include/clang/Basic/LangOptions.def 
b/clang/include/clang/Basic/LangOptions.def
index 6dd6b5614f44c..2de854731 100644
--- a/clang/include/clang/Basic/LangOptions.def
+++ b/clang/include/clang/Basic/LangOptions.def
@@ -168,6 +168,7 @@ LANGOPT(PointerAuthAuthTraps, 1, 0, "pointer authentication 
failure traps")
 LANGOPT(PointerAuthVTPtrAddressDiscrimination, 1, 0, "incorporate address 
discrimination in authenticated vtable pointers")
 LANGOPT(PointerAuthVTPtrTypeDiscrimination, 1, 0, "incorporate type 
discrimination in authenticated vtable pointers")
 LANGOPT(PointerAuthInitFini, 1, 0, "sign function pointers in init/fini 
arrays")
+LANGOPT(PointerAuthInitFiniAddressDiscrimination, 1, 0, "incorporate address 
discrimination in authenticated function pointers in init/fini arrays")
 
 LANGOPT(DoubleSquareBracketAttributes, 1, 0, "'[[]]' attributes extension for 
all language standard modes")
 LANGOPT(ExperimentalLateParseAttributes, 1, 0, "experimental late parsing of 
attributes")
diff --git a/clang/include/clang/Basic/PointerAuthOptions.h 
b/clang/include/clang/Basic/PointerAuthOptions.h
index aaad4a2b2b5ae..9e2b64111e461 100644
--- a/clang/include/clang/Basic/PointerAuthOptions.h
+++ b/clang/include/clang/Basic/PointerAuthOptions.h
@@ -23,6 +23,10 @@
 
 namespace clang {
 
+/// Constant discriminator to be used with function pointers in .init_array and
+/// .fini_array. The value is ptrauth_string_discriminator("init_fini")
+constexpr uint16_t InitFiniPointerConstantDiscriminator = 0xD9D4;
+
 constexpr unsigned PointerAuthKeyNone = -1;
 
 class PointerAuthSchema {
@@ -150,6 +154,9 @@ class PointerAuthSchema {
 struct PointerAuthOptions {
   /// The ABI for C function pointers.
   PointerAuthSchema FunctionPointers;
+
+  /// The ABI for function addresses in .init_array and .fini_array
+  PointerAuthSchema InitFiniPointers;
 };
 
 } // end namespace clang
diff --git a/clang/include/clang/Driver/Options.td 
b/clang/include/clang/Driver/Options.td
index c529cc9506667..5b8d4139d975b 100644
--- a/clang/include/clang/Driver/Options.td
+++ b/clang/include/clang/Driver/Options.td
@@ -4228,6 +4228,7 @@ defm ptrauth_vtable_pointer_address_discrimination :
 defm ptrauth_vtable_pointer_type_discrimination :
   OptInCC1FFlag<"ptrauth-vtable-pointer-type-discrimin

[clang] [compiler-rt] [llvm] [PAC][AArch64] Support init/fini array signing (PR #96478)

2024-06-28 Thread Daniil Kovalev via cfe-commits

https://github.com/kovdan01 edited 
https://github.com/llvm/llvm-project/pull/96478
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [compiler-rt] [llvm] [PAC][AArch64] Support init/fini array signing (PR #96478)

2024-06-28 Thread Daniil Kovalev via cfe-commits

kovdan01 wrote:

The PR no longer depends on #96477. For signed ctors/dtors we now have special 
address discrimination handling so we don't need to use self-references to 
`llvm.global_{c|d}tors` with giant `getelementptr` expressions - such 
references are disallowed and, as discussed in #96477, allowing them just for 
ptrauth purposes has significant drawbacks.

Instead, just use `ptr inttoptr (i64 1 to ptr)`, like this:

```
@llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr 
} { i32 65535, ptr ptrauth (ptr @foo, i32 0, i64 55764, ptr inttoptr (i64 1 to 
ptr)), ptr null }]
```

This is the same approach which is used in Apple's downstream for coroutines, 
and we share some code with that - see 
https://github.com/ahmedbougacha/llvm-project/commit/2a5528ea2cb223fca0b47f0a4833bbb938cf0748.
 Also tagging @ahmedbougacha.



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


[clang] [libc] [llvm] AMDGPU: Add a subtarget feature for fine-grained remote memory support (PR #96442)

2024-06-28 Thread Matt Arsenault via cfe-commits

https://github.com/arsenm updated 
https://github.com/llvm/llvm-project/pull/96442

>From 03be6a1847ff90955413d1d488e2619036ffbceb Mon Sep 17 00:00:00 2001
From: martinboehme 
Date: Wed, 26 Jun 2024 15:01:57 +0200
Subject: [PATCH 01/14] [clang][dataflow] Teach `AnalysisASTVisitor` that
 `typeid()` can be evaluated. (#96731)

We were previously treating the operand of `typeid()` as being
definitely
unevaluated, but it can be evaluated if it is a glvalue of polymorphic
type.

This patch includes a test that fails without the fix.
---
 .../clang/Analysis/FlowSensitive/ASTOps.h |  6 ++-
 .../Analysis/FlowSensitive/TransferTest.cpp   | 43 +++
 2 files changed, 48 insertions(+), 1 deletion(-)

diff --git a/clang/include/clang/Analysis/FlowSensitive/ASTOps.h 
b/clang/include/clang/Analysis/FlowSensitive/ASTOps.h
index 925b99af9141a..f9c923a36ad22 100644
--- a/clang/include/clang/Analysis/FlowSensitive/ASTOps.h
+++ b/clang/include/clang/Analysis/FlowSensitive/ASTOps.h
@@ -113,7 +113,11 @@ class AnalysisASTVisitor : public 
RecursiveASTVisitor {
   // nevertheless it appears in the Clang CFG, so we don't exclude it here.
   bool TraverseDecltypeTypeLoc(DecltypeTypeLoc) { return true; }
   bool TraverseTypeOfExprTypeLoc(TypeOfExprTypeLoc) { return true; }
-  bool TraverseCXXTypeidExpr(CXXTypeidExpr *) { return true; }
+  bool TraverseCXXTypeidExpr(CXXTypeidExpr *TIE) {
+if (TIE->isPotentiallyEvaluated())
+  return RecursiveASTVisitor::TraverseCXXTypeidExpr(TIE);
+return true;
+  }
   bool TraverseUnaryExprOrTypeTraitExpr(UnaryExprOrTypeTraitExpr *) {
 return true;
   }
diff --git a/clang/unittests/Analysis/FlowSensitive/TransferTest.cpp 
b/clang/unittests/Analysis/FlowSensitive/TransferTest.cpp
index e743eefa5d458..39e7001393e5e 100644
--- a/clang/unittests/Analysis/FlowSensitive/TransferTest.cpp
+++ b/clang/unittests/Analysis/FlowSensitive/TransferTest.cpp
@@ -1637,6 +1637,49 @@ TEST(TransferTest, StructModeledFieldsWithAccessor) {
   });
 }
 
+TEST(TransferTest, StructModeledFieldsInTypeid) {
+  // Test that we model fields mentioned inside a `typeid()` expression only if
+  // that expression is potentially evaluated -- i.e. if the expression inside
+  // `typeid()` is a glvalue of polymorphic type (see
+  // `CXXTypeidExpr::isPotentiallyEvaluated()` and [expr.typeid]p3).
+  std::string Code = R"(
+// Definitions needed for `typeid`.
+namespace std {
+  class type_info {};
+  class bad_typeid {};
+}  // namespace std
+
+struct NonPolymorphic {};
+
+struct Polymorphic {
+  virtual ~Polymorphic() = default;
+};
+
+struct S {
+  NonPolymorphic *NonPoly;
+  Polymorphic *Poly;
+};
+
+void target(S &s) {
+  typeid(*s.NonPoly);
+  typeid(*s.Poly);
+  // [[p]]
+}
+  )";
+  runDataflow(
+  Code,
+  [](const llvm::StringMap> &Results,
+ ASTContext &ASTCtx) {
+const Environment &Env = getEnvironmentAtAnnotation(Results, "p");
+auto &SLoc = getLocForDecl(ASTCtx, Env, "s");
+std::vector Fields;
+for (auto [Field, _] : SLoc.children())
+  Fields.push_back(Field);
+EXPECT_THAT(Fields,
+UnorderedElementsAre(findValueDecl(ASTCtx, "Poly")));
+  });
+}
+
 TEST(TransferTest, StructModeledFieldsWithComplicatedInheritance) {
   std::string Code = R"(
 struct Base1 {

>From 3894ac32fbdb4d6bc85e05a5c80031a14d6a5daa Mon Sep 17 00:00:00 2001
From: martinboehme 
Date: Wed, 26 Jun 2024 15:40:42 +0200
Subject: [PATCH 02/14] Revert "[clang][dataflow] Teach `AnalysisASTVisitor`
 that `typeid()` can be evaluated." (#96766)

Reverts llvm/llvm-project#96731

It causes CI failures.
---
 .../clang/Analysis/FlowSensitive/ASTOps.h |  6 +--
 .../Analysis/FlowSensitive/TransferTest.cpp   | 43 ---
 2 files changed, 1 insertion(+), 48 deletions(-)

diff --git a/clang/include/clang/Analysis/FlowSensitive/ASTOps.h 
b/clang/include/clang/Analysis/FlowSensitive/ASTOps.h
index f9c923a36ad22..925b99af9141a 100644
--- a/clang/include/clang/Analysis/FlowSensitive/ASTOps.h
+++ b/clang/include/clang/Analysis/FlowSensitive/ASTOps.h
@@ -113,11 +113,7 @@ class AnalysisASTVisitor : public 
RecursiveASTVisitor {
   // nevertheless it appears in the Clang CFG, so we don't exclude it here.
   bool TraverseDecltypeTypeLoc(DecltypeTypeLoc) { return true; }
   bool TraverseTypeOfExprTypeLoc(TypeOfExprTypeLoc) { return true; }
-  bool TraverseCXXTypeidExpr(CXXTypeidExpr *TIE) {
-if (TIE->isPotentiallyEvaluated())
-  return RecursiveASTVisitor::TraverseCXXTypeidExpr(TIE);
-return true;
-  }
+  bool TraverseCXXTypeidExpr(CXXTypeidExpr *) { return true; }
   bool TraverseUnaryExprOrTypeTraitExpr(UnaryExprOrTypeTraitExpr *) {
 return true;
   }
diff --git a/clang/unittests/Analysis/FlowSensitive/TransferTest.cpp 
b/clang/unittests/Analysis/FlowSensitive/TransferTest.cpp
index 39e7001393e5e..e743eefa5d458 100644
--- a/clang/unittests/Analysis/

[clang] [llvm] [polly] [IR] Don't include Module.h in Analysis.h (NFC) (PR #97023)

2024-06-28 Thread LLVM Continuous Integration via cfe-commits

llvm-ci wrote:

LLVM Buildbot has detected a new failure on builder `ml-opt-dev-x86-64` running 
on `ml-opt-dev-x86-64-b2` while building `clang,llvm,polly` at step 5 
"build-unified-tree".

Full details are available at: 
https://lab.llvm.org/buildbot/#/builders/137/builds/829

Here is the relevant piece of the build log for the reference:
```
Step 5 (build-unified-tree) failure: build (failure)
...
33.359 [2882/64/672] Building CXX object 
lib/IR/CMakeFiles/LLVMCore.dir/DebugLoc.cpp.o
33.414 [2881/64/673] Building CXX object 
lib/CodeGen/CMakeFiles/LLVMCodeGen.dir/ExpandPostRAPseudos.cpp.o
34.097 [2880/64/674] Building CXX object 
examples/IRTransforms/CMakeFiles/ExampleIRTransforms.dir/SimplifyCFG.cpp.o
34.454 [2879/64/675] Building CXX object 
lib/IR/CMakeFiles/LLVMCore.dir/PassManager.cpp.o
34.504 [2878/64/676] Building CXX object 
lib/CodeGen/CMakeFiles/LLVMCodeGen.dir/FaultMaps.cpp.o
34.556 [2877/64/677] Building CXX object 
lib/CodeGen/CMakeFiles/LLVMCodeGen.dir/FEntryInserter.cpp.o
35.882 [2876/64/678] Building CXX object 
lib/IR/CMakeFiles/LLVMCore.dir/ConvergenceVerifier.cpp.o
35.966 [2875/64/679] Building CXX object 
lib/CodeGen/CMakeFiles/LLVMCodeGen.dir/FixupStatepointCallerSaved.cpp.o
36.028 [2874/64/680] Building CXX object 
lib/CodeGen/CMakeFiles/LLVMCodeGen.dir/FuncletLayout.cpp.o
36.876 [2873/64/681] Building CXX object 
lib/CodeGen/CMakeFiles/LLVMCodeGen.dir/MLRegAllocPriorityAdvisor.cpp.o
FAILED: lib/CodeGen/CMakeFiles/LLVMCodeGen.dir/MLRegAllocPriorityAdvisor.cpp.o 
ccache /usr/bin/c++ -DCPUINFO_SUPPORTED_PLATFORM=1 -DGTEST_HAS_RTTI=0 -D_DEBUG 
-D_GLIBCXX_ASSERTIONS -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS 
-D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS 
-I/b/ml-opt-dev-x86-64-b1/build/lib/CodeGen 
-I/b/ml-opt-dev-x86-64-b1/llvm-project/llvm/lib/CodeGen 
-I/b/ml-opt-dev-x86-64-b1/build/include 
-I/b/ml-opt-dev-x86-64-b1/llvm-project/llvm/include -isystem 
/tmp/tflitebuild/tensorflow/include -isystem 
/tmp/tflitebuild/eigen/include/eigen3 -isystem 
/tmp/tflitebuild/abseil-cpp/include -isystem 
/tmp/tflitebuild/flatbuffers/include -isystem 
/tmp/tflitebuild/gemmlowp/include/gemmlowp -isystem 
/tmp/tflitebuild/ml_dtypes/src/ml_dtypes -isystem 
/tmp/tflitebuild/ml_dtypes/src/ml_dtypes/ml_dtypes -isystem 
/tmp/tflitebuild/ruy/include -isystem /tmp/tflitebuild/cpuinfo/include -isystem 
/tmp/tflitebuild/ARM_NEON_2_x86_SSE/include -fPIC -fno-semantic-interposition 
-fvisibility-inlines-hidden -Werror=date-time -fno-lifetime-dse -Wall -Wextra 
-Wno-unused-parameter -Wwrite-strings -Wcast-qual 
-Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough 
-Wno-uninitialized -Wno-nonnull -Wno-class-memaccess -Wno-redundant-move 
-Wno-pessimizing-move -Wno-noexcept-type -Wdelete-non-virtual-dtor 
-Wsuggest-override -Wno-comment -Wno-misleading-indentation -fdiagnostics-color 
-ffunction-sections -fdata-sections -O3 -DNDEBUG  -fno-exceptions 
-funwind-tables -fno-rtti -UNDEBUG -DEIGEN_NEON_GEBP_NR=4 
-DTFL_STATIC_LIBRARY_BUILD -std=c++17 -MD -MT 
lib/CodeGen/CMakeFiles/LLVMCodeGen.dir/MLRegAllocPriorityAdvisor.cpp.o -MF 
lib/CodeGen/CMakeFiles/LLVMCodeGen.dir/MLRegAllocPriorityAdvisor.cpp.o.d -o 
lib/CodeGen/CMakeFiles/LLVMCodeGen.dir/MLRegAllocPriorityAdvisor.cpp.o -c 
/b/ml-opt-dev-x86-64-b1/llvm-project/llvm/lib/CodeGen/MLRegAllocPriorityAdvisor.cpp
/b/ml-opt-dev-x86-64-b1/llvm-project/llvm/lib/CodeGen/MLRegAllocPriorityAdvisor.cpp:
 In member function ‘virtual bool 
llvm::DevelopmentModePriorityAdvisorAnalysis::doInitialization(llvm::Module&)’:
/b/ml-opt-dev-x86-64-b1/llvm-project/llvm/lib/CodeGen/MLRegAllocPriorityAdvisor.cpp:223:24:
 error: invalid use of incomplete type ‘class llvm::Module’
  223 | LLVMContext &Ctx = M.getContext();
  |^
In file included from 
/b/ml-opt-dev-x86-64-b1/llvm-project/llvm/include/llvm/IR/User.h:24,
 from 
/b/ml-opt-dev-x86-64-b1/llvm-project/llvm/include/llvm/IR/Constant.h:16,
 from 
/b/ml-opt-dev-x86-64-b1/llvm-project/llvm/include/llvm/IR/Metadata.h:26,
 from 
/b/ml-opt-dev-x86-64-b1/llvm-project/llvm/include/llvm/Analysis/MemoryLocation.h:19,
 from 
/b/ml-opt-dev-x86-64-b1/llvm-project/llvm/include/llvm/CodeGen/MachineInstr.h:23,
 from 
/b/ml-opt-dev-x86-64-b1/llvm-project/llvm/include/llvm/CodeGen/MachineBasicBlock.h:20,
 from 
/b/ml-opt-dev-x86-64-b1/llvm-project/llvm/include/llvm/CodeGen/SlotIndexes.h:26,
 from 
/b/ml-opt-dev-x86-64-b1/llvm-project/llvm/include/llvm/CodeGen/LiveInterval.h:29,
 from 
/b/ml-opt-dev-x86-64-b1/llvm-project/llvm/lib/CodeGen/InterferenceCache.h:18,
 from 
/b/ml-opt-dev-x86-64-b1/llvm-project/llvm/lib/CodeGen/RegAllocGreedy.h:15,
 from 
/b/ml-opt-dev-x86-64-b1/llvm-project/llvm/lib/CodeGen/MLRegAllocPriorityAdvisor.cpp:14:
/b/ml-opt-dev-x86-64-b1/llvm-project/llvm/include/llvm/IR/Value.h:47:7: note: 
forward declaration of ‘

[clang] [clang-repl] Support wasm execution (PR #86402)

2024-06-28 Thread Aaron Ballman via cfe-commits

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

I don't have expertise with wasm, but the changes seem reasonable to me -- 
LGTM, but maybe wait a few days before landing in case other reviewers have 
concerns.

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


[clang] [clang-repl] Support wasm execution (PR #86402)

2024-06-28 Thread Aaron Ballman via cfe-commits

https://github.com/AaronBallman edited 
https://github.com/llvm/llvm-project/pull/86402
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [compiler-rt] [llvm] [PAC][AArch64] Support init/fini array signing (PR #96478)

2024-06-28 Thread Daniil Kovalev via cfe-commits

https://github.com/kovdan01 edited 
https://github.com/llvm/llvm-project/pull/96478
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang] require arg list in type specifiers using template kw (PR #94674)

2024-06-28 Thread Aaron Ballman via cfe-commits

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

LGTM -- no release note needed because this is a follow-up to work that already 
has a release note.

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


[clang] [clang] require arg list in type specifiers using template kw (PR #94674)

2024-06-28 Thread Aaron Ballman via cfe-commits

https://github.com/AaronBallman edited 
https://github.com/llvm/llvm-project/pull/94674
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] 08892cc - [clang][OpenMP] Simplify handling of `if` clause (#96936)

2024-06-28 Thread via cfe-commits

Author: Krzysztof Parzyszek
Date: 2024-06-28T07:46:18-05:00
New Revision: 08892cc07da9faf4c0e1efa966025936c952211b

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

LOG: [clang][OpenMP] Simplify handling of `if` clause (#96936)

Get the allowed name modifiers from the list of constituent leaf
directives.

Added: 


Modified: 
clang/lib/Sema/SemaOpenMP.cpp

Removed: 




diff  --git a/clang/lib/Sema/SemaOpenMP.cpp b/clang/lib/Sema/SemaOpenMP.cpp
index 760a8f08d3e5b..29104b2c0de94 100644
--- a/clang/lib/Sema/SemaOpenMP.cpp
+++ b/clang/lib/Sema/SemaOpenMP.cpp
@@ -6549,18 +6549,14 @@ StmtResult SemaOpenMP::ActOnOpenMPExecutableDirective(
 ClausesWithImplicit);
   }
 
-  llvm::SmallVector AllowedNameModifiers;
   switch (Kind) {
   case OMPD_parallel:
 Res = ActOnOpenMPParallelDirective(ClausesWithImplicit, AStmt, StartLoc,
EndLoc);
-AllowedNameModifiers.push_back(OMPD_parallel);
 break;
   case OMPD_simd:
 Res = ActOnOpenMPSimdDirective(ClausesWithImplicit, AStmt, StartLoc, 
EndLoc,
VarsWithInheritedDSA);
-if (getLangOpts().OpenMP >= 50)
-  AllowedNameModifiers.push_back(OMPD_simd);
 break;
   case OMPD_tile:
 Res =
@@ -6577,8 +6573,6 @@ StmtResult SemaOpenMP::ActOnOpenMPExecutableDirective(
   case OMPD_for_simd:
 Res = ActOnOpenMPForSimdDirective(ClausesWithImplicit, AStmt, StartLoc,
   EndLoc, VarsWithInheritedDSA);
-if (getLangOpts().OpenMP >= 50)
-  AllowedNameModifiers.push_back(OMPD_simd);
 break;
   case OMPD_sections:
 Res = ActOnOpenMPSectionsDirective(ClausesWithImplicit, AStmt, StartLoc,
@@ -6609,14 +6603,10 @@ StmtResult SemaOpenMP::ActOnOpenMPExecutableDirective(
   case OMPD_parallel_for:
 Res = ActOnOpenMPParallelForDirective(ClausesWithImplicit, AStmt, StartLoc,
   EndLoc, VarsWithInheritedDSA);
-AllowedNameModifiers.push_back(OMPD_parallel);
 break;
   case OMPD_parallel_for_simd:
 Res = ActOnOpenMPParallelForSimdDirective(
 ClausesWithImplicit, AStmt, StartLoc, EndLoc, VarsWithInheritedDSA);
-AllowedNameModifiers.push_back(OMPD_parallel);
-if (getLangOpts().OpenMP >= 50)
-  AllowedNameModifiers.push_back(OMPD_simd);
 break;
   case OMPD_scope:
 Res =
@@ -6625,22 +6615,18 @@ StmtResult SemaOpenMP::ActOnOpenMPExecutableDirective(
   case OMPD_parallel_master:
 Res = ActOnOpenMPParallelMasterDirective(ClausesWithImplicit, AStmt,
  StartLoc, EndLoc);
-AllowedNameModifiers.push_back(OMPD_parallel);
 break;
   case OMPD_parallel_masked:
 Res = ActOnOpenMPParallelMaskedDirective(ClausesWithImplicit, AStmt,
  StartLoc, EndLoc);
-AllowedNameModifiers.push_back(OMPD_parallel);
 break;
   case OMPD_parallel_sections:
 Res = ActOnOpenMPParallelSectionsDirective(ClausesWithImplicit, AStmt,
StartLoc, EndLoc);
-AllowedNameModifiers.push_back(OMPD_parallel);
 break;
   case OMPD_task:
 Res =
 ActOnOpenMPTaskDirective(ClausesWithImplicit, AStmt, StartLoc, EndLoc);
-AllowedNameModifiers.push_back(OMPD_task);
 break;
   case OMPD_taskyield:
 assert(ClausesWithImplicit.empty() &&
@@ -6700,19 +6686,14 @@ StmtResult SemaOpenMP::ActOnOpenMPExecutableDirective(
   case OMPD_target:
 Res = ActOnOpenMPTargetDirective(ClausesWithImplicit, AStmt, StartLoc,
  EndLoc);
-AllowedNameModifiers.push_back(OMPD_target);
 break;
   case OMPD_target_parallel:
 Res = ActOnOpenMPTargetParallelDirective(ClausesWithImplicit, AStmt,
  StartLoc, EndLoc);
-AllowedNameModifiers.push_back(OMPD_target);
-AllowedNameModifiers.push_back(OMPD_parallel);
 break;
   case OMPD_target_parallel_for:
 Res = ActOnOpenMPTargetParallelForDirective(
 ClausesWithImplicit, AStmt, StartLoc, EndLoc, VarsWithInheritedDSA);
-AllowedNameModifiers.push_back(OMPD_target);
-AllowedNameModifiers.push_back(OMPD_parallel);
 break;
   case OMPD_cancellation_point:
 assert(ClausesWithImplicit.empty() &&
@@ -6726,90 +6707,58 @@ StmtResult SemaOpenMP::ActOnOpenMPExecutableDirective(
"No associated statement allowed for 'omp cancel' directive");
 Res = ActOnOpenMPCancelDirective(ClausesWithImplicit, StartLoc, EndLoc,
  CancelRegion);
-AllowedNameModifiers.push_back(OMPD_cancel);
 break;
   case OMPD_target_data:
 Res = ActOnOpenMPTargetDataDirective(ClausesWithImpli

[clang] [clang][OpenMP] Simplify handling of `if` clause (PR #96936)

2024-06-28 Thread Krzysztof Parzyszek via cfe-commits

https://github.com/kparzysz closed 
https://github.com/llvm/llvm-project/pull/96936
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [compiler-rt] [llvm] [PAC][AArch64] Support init/fini array signing (PR #96478)

2024-06-28 Thread Daniil Kovalev via cfe-commits

https://github.com/kovdan01 updated 
https://github.com/llvm/llvm-project/pull/96478

>From 5399237a71c0ccd872821034d83ea2c3a04bed3f Mon Sep 17 00:00:00 2001
From: Daniil Kovalev 
Date: Fri, 21 Jun 2024 12:32:51 +0300
Subject: [PATCH 1/3] [PAC][AArch64] Support init/fini array signing

If both `-fptrauth-init-fini` and `-fptrauth-calls` are passed, sign
function pointers in `llvm.global_ctors` and `llvm.global_dtors` with
constant discriminator 0xD9D4 (`ptrauth_string_discriminator("init_fini")`).
Additionally, if `-fptrauth-init-fini-address-discrimination` is passed,
address discrimination is used for signing (otherwise, just constant
discriminator is used).
---
 clang/include/clang/Basic/Features.def|  1 +
 clang/include/clang/Basic/LangOptions.def |  1 +
 .../include/clang/Basic/PointerAuthOptions.h  |  7 ++
 clang/include/clang/Driver/Options.td |  1 +
 clang/lib/CodeGen/CodeGenModule.cpp   | 63 +--
 clang/lib/Driver/ToolChains/Clang.cpp |  3 +
 clang/lib/Frontend/CompilerInvocation.cpp |  9 +++
 clang/lib/Headers/ptrauth.h   |  8 ++
 clang/test/CodeGen/aarch64-elf-pauthabi.c | 12 ++-
 clang/test/CodeGen/ptrauth-init-fini.c| 39 ++
 clang/test/Driver/aarch64-ptrauth.c   |  6 +-
 clang/test/Preprocessor/ptrauth_feature.c | 52 +
 compiler-rt/lib/builtins/crtbegin.c   | 16 
 llvm/include/llvm/BinaryFormat/ELF.h  |  3 +-
 .../AArch64/note-gnu-property-elf-pauthabi.ll |  2 +-
 .../test/CodeGen/AArch64/ptrauth-init-fini.ll | 77 +++
 .../ELF/AArch64/aarch64-feature-pauth.s   | 18 ++---
 llvm/tools/llvm-readobj/ELFDumper.cpp |  4 +-
 18 files changed, 268 insertions(+), 54 deletions(-)
 create mode 100644 clang/test/CodeGen/ptrauth-init-fini.c
 create mode 100644 llvm/test/CodeGen/AArch64/ptrauth-init-fini.ll

diff --git a/clang/include/clang/Basic/Features.def 
b/clang/include/clang/Basic/Features.def
index 53f410d3cb4bd..5dca40b261655 100644
--- a/clang/include/clang/Basic/Features.def
+++ b/clang/include/clang/Basic/Features.def
@@ -110,6 +110,7 @@ FEATURE(ptrauth_vtable_pointer_address_discrimination, 
LangOpts.PointerAuthVTPtr
 FEATURE(ptrauth_vtable_pointer_type_discrimination, 
LangOpts.PointerAuthVTPtrTypeDiscrimination)
 FEATURE(ptrauth_member_function_pointer_type_discrimination, 
LangOpts.PointerAuthCalls)
 FEATURE(ptrauth_init_fini, LangOpts.PointerAuthInitFini)
+FEATURE(ptrauth_init_fini_address_discrimination, 
LangOpts.PointerAuthInitFiniAddressDiscrimination)
 EXTENSION(swiftcc,
   PP.getTargetInfo().checkCallingConvention(CC_Swift) ==
   clang::TargetInfo::CCCR_OK)
diff --git a/clang/include/clang/Basic/LangOptions.def 
b/clang/include/clang/Basic/LangOptions.def
index 6dd6b5614f44c..2de854731 100644
--- a/clang/include/clang/Basic/LangOptions.def
+++ b/clang/include/clang/Basic/LangOptions.def
@@ -168,6 +168,7 @@ LANGOPT(PointerAuthAuthTraps, 1, 0, "pointer authentication 
failure traps")
 LANGOPT(PointerAuthVTPtrAddressDiscrimination, 1, 0, "incorporate address 
discrimination in authenticated vtable pointers")
 LANGOPT(PointerAuthVTPtrTypeDiscrimination, 1, 0, "incorporate type 
discrimination in authenticated vtable pointers")
 LANGOPT(PointerAuthInitFini, 1, 0, "sign function pointers in init/fini 
arrays")
+LANGOPT(PointerAuthInitFiniAddressDiscrimination, 1, 0, "incorporate address 
discrimination in authenticated function pointers in init/fini arrays")
 
 LANGOPT(DoubleSquareBracketAttributes, 1, 0, "'[[]]' attributes extension for 
all language standard modes")
 LANGOPT(ExperimentalLateParseAttributes, 1, 0, "experimental late parsing of 
attributes")
diff --git a/clang/include/clang/Basic/PointerAuthOptions.h 
b/clang/include/clang/Basic/PointerAuthOptions.h
index aaad4a2b2b5ae..9e2b64111e461 100644
--- a/clang/include/clang/Basic/PointerAuthOptions.h
+++ b/clang/include/clang/Basic/PointerAuthOptions.h
@@ -23,6 +23,10 @@
 
 namespace clang {
 
+/// Constant discriminator to be used with function pointers in .init_array and
+/// .fini_array. The value is ptrauth_string_discriminator("init_fini")
+constexpr uint16_t InitFiniPointerConstantDiscriminator = 0xD9D4;
+
 constexpr unsigned PointerAuthKeyNone = -1;
 
 class PointerAuthSchema {
@@ -150,6 +154,9 @@ class PointerAuthSchema {
 struct PointerAuthOptions {
   /// The ABI for C function pointers.
   PointerAuthSchema FunctionPointers;
+
+  /// The ABI for function addresses in .init_array and .fini_array
+  PointerAuthSchema InitFiniPointers;
 };
 
 } // end namespace clang
diff --git a/clang/include/clang/Driver/Options.td 
b/clang/include/clang/Driver/Options.td
index c529cc9506667..5b8d4139d975b 100644
--- a/clang/include/clang/Driver/Options.td
+++ b/clang/include/clang/Driver/Options.td
@@ -4228,6 +4228,7 @@ defm ptrauth_vtable_pointer_address_discrimination :
 defm ptrauth_vtable_pointer_type_discrimination :
   OptInCC1FFlag<"ptrauth-vtable-pointer-type-discrimin

[clang] [llvm] [polly] [IR] Don't include Module.h in Analysis.h (NFC) (PR #97023)

2024-06-28 Thread LLVM Continuous Integration via cfe-commits

llvm-ci wrote:

LLVM Buildbot has detected a new failure on builder `ml-opt-devrel-x86-64` 
running on `ml-opt-devrel-x86-64-b2` while building `clang,llvm,polly` at step 
5 "build-unified-tree".

Full details are available at: 
https://lab.llvm.org/buildbot/#/builders/175/builds/833

Here is the relevant piece of the build log for the reference:
```
Step 5 (build-unified-tree) failure: build (failure)
...
210.665 [1476/64/2101] Building CXX object 
lib/Analysis/CMakeFiles/LLVMAnalysis.dir/CaptureTracking.cpp.o
211.223 [1475/64/2102] Building CXX object 
lib/Analysis/CMakeFiles/LLVMAnalysis.dir/HeatUtils.cpp.o
212.463 [1474/64/2103] Building CXX object 
lib/Transforms/Scalar/CMakeFiles/LLVMScalarOpts.dir/NewGVN.cpp.o
212.498 [1473/64/2104] Building CXX object 
lib/Analysis/CMakeFiles/LLVMAnalysis.dir/CFGPrinter.cpp.o
212.935 [1472/64/2105] Building CXX object 
lib/Analysis/CMakeFiles/LLVMAnalysis.dir/CallGraph.cpp.o
213.155 [1471/64/2106] Building CXX object 
lib/Transforms/Scalar/CMakeFiles/LLVMScalarOpts.dir/SROA.cpp.o
213.187 [1470/64/2107] Building CXX object 
lib/Analysis/CMakeFiles/LLVMAnalysis.dir/MemoryProfileInfo.cpp.o
213.596 [1469/64/2108] Building CXX object 
lib/Analysis/CMakeFiles/LLVMAnalysis.dir/Delinearization.cpp.o
213.749 [1468/64/2109] Building CXX object 
lib/Analysis/CMakeFiles/LLVMAnalysis.dir/CycleAnalysis.cpp.o
215.395 [1467/64/2110] Building CXX object 
lib/Analysis/CMakeFiles/LLVMAnalysis.dir/DevelopmentModeInlineAdvisor.cpp.o
FAILED: 
lib/Analysis/CMakeFiles/LLVMAnalysis.dir/DevelopmentModeInlineAdvisor.cpp.o 
ccache /usr/bin/c++ -DCPUINFO_SUPPORTED_PLATFORM=1 -DGTEST_HAS_RTTI=0 
-DHAS_LOGF128 -DLLVM_HAVE_TF_AOT_INLINERSIZEMODEL -D_DEBUG 
-D_GLIBCXX_ASSERTIONS -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS 
-D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS 
-I/b/ml-opt-devrel-x86-64-b1/build/lib/Analysis 
-I/b/ml-opt-devrel-x86-64-b1/llvm-project/llvm/lib/Analysis 
-I/var/lib/buildbot/.local/lib/python3.7/site-packages/tensorflow/include 
-I/b/ml-opt-devrel-x86-64-b1/build/include 
-I/b/ml-opt-devrel-x86-64-b1/llvm-project/llvm/include -isystem 
/tmp/tflitebuild/tensorflow/include -isystem 
/tmp/tflitebuild/eigen/include/eigen3 -isystem 
/tmp/tflitebuild/abseil-cpp/include -isystem 
/tmp/tflitebuild/flatbuffers/include -isystem 
/tmp/tflitebuild/gemmlowp/include/gemmlowp -isystem 
/tmp/tflitebuild/ml_dtypes/src/ml_dtypes -isystem 
/tmp/tflitebuild/ml_dtypes/src/ml_dtypes/ml_dtypes -isystem 
/tmp/tflitebuild/ruy/include -isystem /tmp/tflitebuild/cpuinfo/include -isystem 
/tmp/tflitebuild/ARM_NEON_2_x86_SSE/include -fPIC -fno-semantic-interposition 
-fvisibility-inlines-hidden -Werror=date-time -fno-lifetime-dse -Wall -Wextra 
-Wno-unused-parameter -Wwrite-strings -Wcast-qual 
-Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough 
-Wno-uninitialized -Wno-nonnull -Wno-class-memaccess -Wno-redundant-move 
-Wno-pessimizing-move -Wno-noexcept-type -Wdelete-non-virtual-dtor 
-Wsuggest-override -Wno-comment -Wno-misleading-indentation -fdiagnostics-color 
-ffunction-sections -fdata-sections -O3 -DNDEBUG  -fno-exceptions 
-funwind-tables -fno-rtti -UNDEBUG -DEIGEN_NEON_GEBP_NR=4 
-DTFL_STATIC_LIBRARY_BUILD -std=c++17 -MD -MT 
lib/Analysis/CMakeFiles/LLVMAnalysis.dir/DevelopmentModeInlineAdvisor.cpp.o -MF 
lib/Analysis/CMakeFiles/LLVMAnalysis.dir/DevelopmentModeInlineAdvisor.cpp.o.d 
-o lib/Analysis/CMakeFiles/LLVMAnalysis.dir/DevelopmentModeInlineAdvisor.cpp.o 
-c 
/b/ml-opt-devrel-x86-64-b1/llvm-project/llvm/lib/Analysis/DevelopmentModeInlineAdvisor.cpp
/b/ml-opt-devrel-x86-64-b1/llvm-project/llvm/lib/Analysis/DevelopmentModeInlineAdvisor.cpp:
 In member function ‘std::optional 
{anonymous}::DevelopmentModeMLInlineAdvisor::getNativeSizeEstimate(const 
llvm::Function&) const’:
/b/ml-opt-devrel-x86-64-b1/llvm-project/llvm/lib/Analysis/DevelopmentModeInlineAdvisor.cpp:348:18:
 error: invalid use of incomplete type ‘const class llvm::Module’
  348 | F.getParent()->getContext().emitError(
  |  ^~
In file included from 
/b/ml-opt-devrel-x86-64-b1/llvm-project/llvm/include/llvm/Analysis/TensorSpec.h:15,
 from 
/b/ml-opt-devrel-x86-64-b1/llvm-project/llvm/lib/Analysis/DevelopmentModeInlineAdvisor.cpp:13:
/b/ml-opt-devrel-x86-64-b1/llvm-project/llvm/include/llvm/IR/LLVMContext.h:32:7:
 note: forward declaration of ‘class llvm::Module’
   32 | class Module;
  |   ^~
/b/ml-opt-devrel-x86-64-b1/llvm-project/llvm/lib/Analysis/DevelopmentModeInlineAdvisor.cpp:
 In member function ‘size_t 
{anonymous}::DevelopmentModeMLInlineAdvisor::getTotalSizeEstimate()’:
/b/ml-opt-devrel-x86-64-b1/llvm-project/llvm/lib/Analysis/DevelopmentModeInlineAdvisor.cpp:391:18:
 error: range-based ‘for’ expression of type ‘llvm::Module’ has incomplete type
  391 |   for (auto &F : M) {
  |  ^
/b/ml-opt-devrel-x86-64-b1/llvm-project/llvm/lib/Analysis/DevelopmentModeInlineAdvisor.cpp:
 In function ‘std::unique_ptr 
llvm::getDevelopmentModeAd

[clang] Sema: Fix CXXRecordDecl::isTriviallyCopyable() for classes with all deleted special functions. (PR #94831)

2024-06-28 Thread Aaron Ballman via cfe-commits


@@ -1462,6 +1473,10 @@ void 
CXXRecordDecl::addedEligibleSpecialMemberFunction(const CXXMethodDecl *MD,
 if (!MD->isUserProvided())
   data().DeclaredNonTrivialSpecialMembersForCall |= SMKind;
   }
+
+  if (MD->isDeleted()) {
+data().HasDeletedSpecialMembers |= SMKind;
+  }

AaronBallman wrote:

```suggestion
  if (MD->isDeleted())
data().HasDeletedSpecialMembers |= SMKind;
```

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


[clang] Sema: Fix CXXRecordDecl::isTriviallyCopyable() for classes with all deleted special functions. (PR #94831)

2024-06-28 Thread Aaron Ballman via cfe-commits

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

LGTM, though please add a release note to `clang/docs/ReleaseNotes.rst` so 
users know about the fix.

We should keep our eyes peeled for any ABI fallout from this change (changing 
the way type traits respond often leads to surprising ABI breaks) -- we may 
need to put in some ABI tag checking if there's fallout.

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


[clang] Sema: Fix CXXRecordDecl::isTriviallyCopyable() for classes with all deleted special functions. (PR #94831)

2024-06-28 Thread Aaron Ballman via cfe-commits

https://github.com/AaronBallman edited 
https://github.com/llvm/llvm-project/pull/94831
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [Clang][Sema] Fix lookup of dependent operator= named by using-declaration (PR #91503)

2024-06-28 Thread Paul Osmialowski via cfe-commits

pawosm-arm wrote:

The number of C++ workloads failing to build after #90152 is rather impressive, 
even this PR do not help. Is there a plan to address that?

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


[clang] [compiler-rt] [llvm] [PAC][AArch64] Support init/fini array signing (PR #96478)

2024-06-28 Thread Daniil Kovalev via cfe-commits

https://github.com/kovdan01 updated 
https://github.com/llvm/llvm-project/pull/96478

>From 5399237a71c0ccd872821034d83ea2c3a04bed3f Mon Sep 17 00:00:00 2001
From: Daniil Kovalev 
Date: Fri, 21 Jun 2024 12:32:51 +0300
Subject: [PATCH 1/2] [PAC][AArch64] Support init/fini array signing

If both `-fptrauth-init-fini` and `-fptrauth-calls` are passed, sign
function pointers in `llvm.global_ctors` and `llvm.global_dtors` with
constant discriminator 0xD9D4 (`ptrauth_string_discriminator("init_fini")`).
Additionally, if `-fptrauth-init-fini-address-discrimination` is passed,
address discrimination is used for signing (otherwise, just constant
discriminator is used).
---
 clang/include/clang/Basic/Features.def|  1 +
 clang/include/clang/Basic/LangOptions.def |  1 +
 .../include/clang/Basic/PointerAuthOptions.h  |  7 ++
 clang/include/clang/Driver/Options.td |  1 +
 clang/lib/CodeGen/CodeGenModule.cpp   | 63 +--
 clang/lib/Driver/ToolChains/Clang.cpp |  3 +
 clang/lib/Frontend/CompilerInvocation.cpp |  9 +++
 clang/lib/Headers/ptrauth.h   |  8 ++
 clang/test/CodeGen/aarch64-elf-pauthabi.c | 12 ++-
 clang/test/CodeGen/ptrauth-init-fini.c| 39 ++
 clang/test/Driver/aarch64-ptrauth.c   |  6 +-
 clang/test/Preprocessor/ptrauth_feature.c | 52 +
 compiler-rt/lib/builtins/crtbegin.c   | 16 
 llvm/include/llvm/BinaryFormat/ELF.h  |  3 +-
 .../AArch64/note-gnu-property-elf-pauthabi.ll |  2 +-
 .../test/CodeGen/AArch64/ptrauth-init-fini.ll | 77 +++
 .../ELF/AArch64/aarch64-feature-pauth.s   | 18 ++---
 llvm/tools/llvm-readobj/ELFDumper.cpp |  4 +-
 18 files changed, 268 insertions(+), 54 deletions(-)
 create mode 100644 clang/test/CodeGen/ptrauth-init-fini.c
 create mode 100644 llvm/test/CodeGen/AArch64/ptrauth-init-fini.ll

diff --git a/clang/include/clang/Basic/Features.def 
b/clang/include/clang/Basic/Features.def
index 53f410d3cb4bd..5dca40b261655 100644
--- a/clang/include/clang/Basic/Features.def
+++ b/clang/include/clang/Basic/Features.def
@@ -110,6 +110,7 @@ FEATURE(ptrauth_vtable_pointer_address_discrimination, 
LangOpts.PointerAuthVTPtr
 FEATURE(ptrauth_vtable_pointer_type_discrimination, 
LangOpts.PointerAuthVTPtrTypeDiscrimination)
 FEATURE(ptrauth_member_function_pointer_type_discrimination, 
LangOpts.PointerAuthCalls)
 FEATURE(ptrauth_init_fini, LangOpts.PointerAuthInitFini)
+FEATURE(ptrauth_init_fini_address_discrimination, 
LangOpts.PointerAuthInitFiniAddressDiscrimination)
 EXTENSION(swiftcc,
   PP.getTargetInfo().checkCallingConvention(CC_Swift) ==
   clang::TargetInfo::CCCR_OK)
diff --git a/clang/include/clang/Basic/LangOptions.def 
b/clang/include/clang/Basic/LangOptions.def
index 6dd6b5614f44c..2de854731 100644
--- a/clang/include/clang/Basic/LangOptions.def
+++ b/clang/include/clang/Basic/LangOptions.def
@@ -168,6 +168,7 @@ LANGOPT(PointerAuthAuthTraps, 1, 0, "pointer authentication 
failure traps")
 LANGOPT(PointerAuthVTPtrAddressDiscrimination, 1, 0, "incorporate address 
discrimination in authenticated vtable pointers")
 LANGOPT(PointerAuthVTPtrTypeDiscrimination, 1, 0, "incorporate type 
discrimination in authenticated vtable pointers")
 LANGOPT(PointerAuthInitFini, 1, 0, "sign function pointers in init/fini 
arrays")
+LANGOPT(PointerAuthInitFiniAddressDiscrimination, 1, 0, "incorporate address 
discrimination in authenticated function pointers in init/fini arrays")
 
 LANGOPT(DoubleSquareBracketAttributes, 1, 0, "'[[]]' attributes extension for 
all language standard modes")
 LANGOPT(ExperimentalLateParseAttributes, 1, 0, "experimental late parsing of 
attributes")
diff --git a/clang/include/clang/Basic/PointerAuthOptions.h 
b/clang/include/clang/Basic/PointerAuthOptions.h
index aaad4a2b2b5ae..9e2b64111e461 100644
--- a/clang/include/clang/Basic/PointerAuthOptions.h
+++ b/clang/include/clang/Basic/PointerAuthOptions.h
@@ -23,6 +23,10 @@
 
 namespace clang {
 
+/// Constant discriminator to be used with function pointers in .init_array and
+/// .fini_array. The value is ptrauth_string_discriminator("init_fini")
+constexpr uint16_t InitFiniPointerConstantDiscriminator = 0xD9D4;
+
 constexpr unsigned PointerAuthKeyNone = -1;
 
 class PointerAuthSchema {
@@ -150,6 +154,9 @@ class PointerAuthSchema {
 struct PointerAuthOptions {
   /// The ABI for C function pointers.
   PointerAuthSchema FunctionPointers;
+
+  /// The ABI for function addresses in .init_array and .fini_array
+  PointerAuthSchema InitFiniPointers;
 };
 
 } // end namespace clang
diff --git a/clang/include/clang/Driver/Options.td 
b/clang/include/clang/Driver/Options.td
index c529cc9506667..5b8d4139d975b 100644
--- a/clang/include/clang/Driver/Options.td
+++ b/clang/include/clang/Driver/Options.td
@@ -4228,6 +4228,7 @@ defm ptrauth_vtable_pointer_address_discrimination :
 defm ptrauth_vtable_pointer_type_discrimination :
   OptInCC1FFlag<"ptrauth-vtable-pointer-type-discrimin

[clang] [llvm] [clang][docs] Add preliminary documentation for SPIR-V support in the HIPAMD ToolChain (PR #96657)

2024-06-28 Thread Yaxun Liu via cfe-commits

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


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


[clang] Extend -Wnonportable-include-path with a warning about trailing whitespace or dots (PR #96960)

2024-06-28 Thread via cfe-commits

https://github.com/zmodem edited https://github.com/llvm/llvm-project/pull/96960
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] Extend -Wnonportable-include-path with a warning about trailing whitespace or dots (PR #96960)

2024-06-28 Thread via cfe-commits

https://github.com/zmodem commented:

Nice!

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


[clang] Extend -Wnonportable-include-path with a warning about trailing whitespace or dots (PR #96960)

2024-06-28 Thread via cfe-commits


@@ -2098,6 +2098,23 @@ OptionalFileEntryRef 
Preprocessor::LookupHeaderIncludeOrImport(
 const FileEntry *LookupFromFile, StringRef &LookupFilename,
 SmallVectorImpl &RelativePath, SmallVectorImpl &SearchPath,
 ModuleMap::KnownHeader &SuggestedModule, bool isAngled) {
+
+  // Check for trailing whitespace or dots in the include path.
+  // This must be done before looking up the file, as Windows will still
+  // find the file even if there are trailing dots or whitespace.
+  size_t TrailingPos = Filename.find_last_not_of(" .");
+  if (TrailingPos != StringRef::npos && TrailingPos < Filename.size() - 1) {
+StringRef TrimmedFilename = Filename.rtrim(" .");
+
+auto Hint = isAngled

zmodem wrote:

Since you're providing fixits, it would be nice to have tests for them. Look at 
clang/test/Parser/extra-semi.cpp for an example.

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


[clang] Extend -Wnonportable-include-path with a warning about trailing whitespace or dots (PR #96960)

2024-06-28 Thread via cfe-commits


@@ -0,0 +1,11 @@
+// REQUIRES: case-insensitive-filesystem

zmodem wrote:

Hmm, I think Mac's qualifies as a case-insensitive-filesystem, but I don't 
think it ignores trailing spaces/dots like Windows does(?).

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


[clang] Extend -Wnonportable-include-path with a warning about trailing whitespace or dots (PR #96960)

2024-06-28 Thread via cfe-commits


@@ -361,7 +361,11 @@ class NonportablePath  : Warning<
   "non-portable path to file '%0'; specified path differs in case from file"
   " name on disk">;
 def pp_nonportable_path : NonportablePath,
-  InGroup>;
+  InGroup;
+def pp_nonportable_path_trailing_whitespace : Warning<
+  "non-portable path to file '%0'; specified path contains trailing"
+  "whitespace or dots">,

zmodem wrote:

Unless it would complicate the code too much, could we use 
`%select{whitespace|dots}` here to make the diagnostic specific to whether it's 
a trailing space or dot?

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


[clang] Extend -Wnonportable-include-path with a warning about trailing whitespace or dots (PR #96960)

2024-06-28 Thread via cfe-commits


@@ -0,0 +1,11 @@
+// REQUIRES: case-insensitive-filesystem
+// RUN: %clang_cc1 -Wall %s
+
+#include "empty_file_to_include.h " // expected-warning {{non-portable path}}

zmodem wrote:

The expected-warning directives require running clang with the `-verify` flag.

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


[clang] Extend -Wnonportable-include-path with a warning about trailing whitespace or dots (PR #96960)

2024-06-28 Thread via cfe-commits


@@ -1543,3 +1543,6 @@ def ExtractAPIMisuse : DiagGroup<"extractapi-misuse">;
 // Warnings about using the non-standard extension having an explicit 
specialization
 // with a storage class specifier.
 def ExplicitSpecializationStorageClass : 
DiagGroup<"explicit-specialization-storage-class">;
+
+// Warnings about non-portable include paths

zmodem wrote:

nit: period at the end

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


[clang] [NFC] use appropriate castas (PR #95272)

2024-06-28 Thread via cfe-commits

https://github.com/mahesh-attarde closed 
https://github.com/llvm/llvm-project/pull/95272
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [llvm] [polly] [IR] Don't include Module.h in Analysis.h (NFC) (PR #97023)

2024-06-28 Thread LLVM Continuous Integration via cfe-commits

llvm-ci wrote:

LLVM Buildbot has detected a new failure on builder `lldb-aarch64-ubuntu` 
running on `linaro-lldb-aarch64-ubuntu` while building `clang,llvm,polly` at 
step 6 "test".

Full details are available at: 
https://lab.llvm.org/buildbot/#/builders/59/builds/712

Here is the relevant piece of the build log for the reference:
```
Step 6 (test) failure: build (failure)
...
PASS: lldb-shell :: SymbolFile/DWARF/x86/dwarf5-index-is-used.cpp (1599 of 1981)
PASS: lldb-shell :: SymbolFile/DWARF/x86/dwarf5-implicit-const.s (1600 of 1981)
PASS: lldb-shell :: SymbolFile/DWARF/x86/dwarf5_locations.s (1601 of 1981)
PASS: lldb-shell :: SymbolFile/DWARF/x86/dwarf5-line-strp.s (1602 of 1981)
PASS: lldb-shell :: SymbolFile/DWARF/x86/dwarf5-partial-index.cpp (1603 of 1981)
PASS: lldb-shell :: SymbolFile/DWARF/x86/dwarf5-split.s (1604 of 1981)
PASS: lldb-shell :: SymbolFile/DWARF/x86/dwarf5_tu_index_abbrev_offset.s (1605 
of 1981)
PASS: lldb-shell :: SymbolFile/DWARF/x86/dwo-not-found-warning.cpp (1606 of 
1981)
PASS: lldb-shell :: SymbolFile/DWARF/x86/dwo-type-in-main-file.s (1607 of 1981)
PASS: lldb-shell :: SymbolFile/DWARF/x86/dwp-debug-types.s (1608 of 1981)
FAIL: lldb-shell :: SymbolFile/DWARF/x86/dwp-foreign-type-units.cpp (1609 of 
1981)
 TEST 'lldb-shell :: 
SymbolFile/DWARF/x86/dwp-foreign-type-units.cpp' FAILED 
Exit Code: 1

Command Output (stderr):
--
RUN: at line 19: /home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/bin/clang 
--target=specify-a-target-or-use-a-_host-substitution -target x86_64-pc-linux 
-gdwarf-5 -gsplit-dwarf-fdebug-types-section -gpubnames -c 
/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/llvm-project/lldb/test/Shell/SymbolFile/DWARF/x86/dwp-foreign-type-units.cpp
 -o 
/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/tools/lldb/test/Shell/SymbolFile/DWARF/x86/Output/dwp-foreign-type-units.cpp.tmp.main.o
+ /home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/bin/clang 
--target=specify-a-target-or-use-a-_host-substitution -target x86_64-pc-linux 
-gdwarf-5 -gsplit-dwarf -fdebug-types-section -gpubnames -c 
/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/llvm-project/lldb/test/Shell/SymbolFile/DWARF/x86/dwp-foreign-type-units.cpp
 -o 
/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/tools/lldb/test/Shell/SymbolFile/DWARF/x86/Output/dwp-foreign-type-units.cpp.tmp.main.o
RUN: at line 21: /home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/bin/clang 
--target=specify-a-target-or-use-a-_host-substitution -target x86_64-pc-linux 
-gdwarf-5 -gsplit-dwarf -DVARIANT-fdebug-types-section -gpubnames -c 
/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/llvm-project/lldb/test/Shell/SymbolFile/DWARF/x86/dwp-foreign-type-units.cpp
 -o 
/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/tools/lldb/test/Shell/SymbolFile/DWARF/x86/Output/dwp-foreign-type-units.cpp.tmp.foo.o
+ /home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/bin/clang 
--target=specify-a-target-or-use-a-_host-substitution -target x86_64-pc-linux 
-gdwarf-5 -gsplit-dwarf -DVARIANT -fdebug-types-section -gpubnames -c 
/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/llvm-project/lldb/test/Shell/SymbolFile/DWARF/x86/dwp-foreign-type-units.cpp
 -o 
/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/tools/lldb/test/Shell/SymbolFile/DWARF/x86/Output/dwp-foreign-type-units.cpp.tmp.foo.o
RUN: at line 23: 
/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/bin/ld.lld 
/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/tools/lldb/test/Shell/SymbolFile/DWARF/x86/Output/dwp-foreign-type-units.cpp.tmp.main.o
 
/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/tools/lldb/test/Shell/SymbolFile/DWARF/x86/Output/dwp-foreign-type-units.cpp.tmp.foo.o
 -o 
/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/tools/lldb/test/Shell/SymbolFile/DWARF/x86/Output/dwp-foreign-type-units.cpp.tmp
+ /home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/bin/ld.lld 
/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/tools/lldb/test/Shell/SymbolFile/DWARF/x86/Output/dwp-foreign-type-units.cpp.tmp.main.o
 
/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/tools/lldb/test/Shell/SymbolFile/DWARF/x86/Output/dwp-foreign-type-units.cpp.tmp.foo.o
 -o 
/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/tools/lldb/test/Shell/SymbolFile/DWARF/x86/Output/dwp-foreign-type-units.cpp.tmp
ld.lld: warning: cannot find entry symbol _start; not setting start address
RUN: at line 26: rm -f 
/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/tools/lldb/test/Shell/SymbolFile/DWARF/x86/Output/dwp-foreign-type-units.cpp.tmp.dwp
+ rm -f 
/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/tools/lldb/test/Shell/SymbolFile/DWARF/x86/Output/dwp-foreign-type-units.cpp.tmp.dwp
RUN: at line 27: /home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/bin/lldb 
--no-lldbinit -S 
/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/tools/lldb/test/Shell/lit-lldb-init-quiet
-o "type lookup IntegerType"-o "type lookup

  1   2   3   4   5   >