[llvm-branch-commits] [lld] PR for llvm/llvm-project#79960 (PR #79961)

2024-01-30 Thread via llvm-branch-commits

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


[llvm-branch-commits] [lld] PR for llvm/llvm-project#79960 (PR #79961)

2024-01-30 Thread via llvm-branch-commits

https://github.com/llvmbot created 
https://github.com/llvm/llvm-project/pull/79961

resolves llvm/llvm-project#79960

>From 7203187739fbb333b0d4710d1e988fbcf440bd86 Mon Sep 17 00:00:00 2001
From: Fangrui Song 
Date: Mon, 29 Jan 2024 13:26:33 -0800
Subject: [PATCH] [ELF] --warn-backrefs: --defsym does not make a backward
 reference

The interaction between --warn-backrefs was not tested, but if
--defsym-created reference causes archive member extraction, it seems
reasonable to suppress the diagnostic, which was the behavior before #78944.

(cherry picked from commit 9a1ca245c8bc60b1ca12cd906fb31130801d977e)
---
 lld/ELF/InputFiles.cpp   | 7 ++-
 lld/test/ELF/warn-backrefs.s | 4 
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/lld/ELF/InputFiles.cpp b/lld/ELF/InputFiles.cpp
index 75e5ee1d0da4f..a292e873e72f7 100644
--- a/lld/ELF/InputFiles.cpp
+++ b/lld/ELF/InputFiles.cpp
@@ -1788,7 +1788,12 @@ void BinaryFile::parse() {
 }
 
 InputFile *elf::createInternalFile(StringRef name) {
-  return make(InputFile::InternalKind, MemoryBufferRef("", name));
+  auto *file =
+  make(InputFile::InternalKind, MemoryBufferRef("", name));
+  // References from an internal file do not lead to --warn-backrefs
+  // diagnostics.
+  file->groupId = 0;
+  return file;
 }
 
 ELFFileBase *elf::createObjFile(MemoryBufferRef mb, StringRef archiveName,
diff --git a/lld/test/ELF/warn-backrefs.s b/lld/test/ELF/warn-backrefs.s
index 1e5c14ed052e6..453017eb1c8ec 100644
--- a/lld/test/ELF/warn-backrefs.s
+++ b/lld/test/ELF/warn-backrefs.s
@@ -100,6 +100,10 @@
 ## -u does not make a backward reference.
 # RUN: ld.lld --fatal-warnings --warn-backrefs -u foo %t2.a %t1.o -o /dev/null
 
+## --defsym does not make a backward reference, but it does not suppress the 
warning due to another file.
+# RUN: ld.lld --fatal-warnings --warn-backrefs --defsym=x=foo -e 0 %t2.a -o 
/dev/null
+# RUN: ld.lld --warn-backrefs --defsym=x=foo %t2.a %t1.o -o /dev/null 2>&1 | 
FileCheck %s
+
 # RUN: not ld.lld --warn-backrefs-exclude='[' 2>&1 | FileCheck 
--check-prefix=INVALID %s
 # INVALID: error: --warn-backrefs-exclude: invalid glob pattern, unmatched 
'[': [
 

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


[llvm-branch-commits] [lld] PR for llvm/llvm-project#79960 (PR #79961)

2024-01-30 Thread via llvm-branch-commits

llvmbot wrote:




@llvm/pr-subscribers-lld-elf

Author: None (llvmbot)


Changes

resolves llvm/llvm-project#79960

---
Full diff: https://github.com/llvm/llvm-project/pull/79961.diff


2 Files Affected:

- (modified) lld/ELF/InputFiles.cpp (+6-1) 
- (modified) lld/test/ELF/warn-backrefs.s (+4) 


``diff
diff --git a/lld/ELF/InputFiles.cpp b/lld/ELF/InputFiles.cpp
index 75e5ee1d0da4f..a292e873e72f7 100644
--- a/lld/ELF/InputFiles.cpp
+++ b/lld/ELF/InputFiles.cpp
@@ -1788,7 +1788,12 @@ void BinaryFile::parse() {
 }
 
 InputFile *elf::createInternalFile(StringRef name) {
-  return make(InputFile::InternalKind, MemoryBufferRef("", name));
+  auto *file =
+  make(InputFile::InternalKind, MemoryBufferRef("", name));
+  // References from an internal file do not lead to --warn-backrefs
+  // diagnostics.
+  file->groupId = 0;
+  return file;
 }
 
 ELFFileBase *elf::createObjFile(MemoryBufferRef mb, StringRef archiveName,
diff --git a/lld/test/ELF/warn-backrefs.s b/lld/test/ELF/warn-backrefs.s
index 1e5c14ed052e6..453017eb1c8ec 100644
--- a/lld/test/ELF/warn-backrefs.s
+++ b/lld/test/ELF/warn-backrefs.s
@@ -100,6 +100,10 @@
 ## -u does not make a backward reference.
 # RUN: ld.lld --fatal-warnings --warn-backrefs -u foo %t2.a %t1.o -o /dev/null
 
+## --defsym does not make a backward reference, but it does not suppress the 
warning due to another file.
+# RUN: ld.lld --fatal-warnings --warn-backrefs --defsym=x=foo -e 0 %t2.a -o 
/dev/null
+# RUN: ld.lld --warn-backrefs --defsym=x=foo %t2.a %t1.o -o /dev/null 2>&1 | 
FileCheck %s
+
 # RUN: not ld.lld --warn-backrefs-exclude='[' 2>&1 | FileCheck 
--check-prefix=INVALID %s
 # INVALID: error: --warn-backrefs-exclude: invalid glob pattern, unmatched 
'[': [
 

``




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


[llvm-branch-commits] [llvm] PR for llvm/llvm-project#79860 (PR #79969)

2024-01-30 Thread via llvm-branch-commits

https://github.com/llvmbot created 
https://github.com/llvm/llvm-project/pull/79969

resolves llvm/llvm-project#79860

>From a2c2da3974793acc606d97284ce8a68e4d7d2f5c Mon Sep 17 00:00:00 2001
From: David Green 
Date: Mon, 29 Jan 2024 16:46:22 +
Subject: [PATCH] [AArch64] Don't generate neon integer complex numbers with
 +sve2. NFC (#79829)

The condition for allowing integer complex number support could also
allow neon fixed length complex numbers if +sve2 was specified. This
tightens the condition to only allow integer complex number support for
scalable vectors.

We could generalize this in the future to generate SVE intrinsics for
fixed-length vectors, but for the moment this opts for the simpler fix.

(cherry picked from commit 9520773c46777adbc1d489f831d6c93b8287ca0e)
---
 .../Target/AArch64/AArch64ISelLowering.cpp|  4 +--
 .../AArch64/complex-deinterleaving-f16-add.ll | 27 +++
 2 files changed, 29 insertions(+), 2 deletions(-)

diff --git a/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp 
b/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
index 332fb37655288..24c5a45192bd8 100644
--- a/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
+++ b/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
@@ -26899,7 +26899,7 @@ bool 
AArch64TargetLowering::isComplexDeinterleavingOperationSupported(
 return false;
 
   // If the vector is scalable, SVE is enabled, implying support for complex
-  // numbers. Otherwirse, we need to ensure complex number support is avaialble
+  // numbers. Otherwise, we need to ensure complex number support is available
   if (!VTy->isScalableTy() && !Subtarget->hasComplxNum())
 return false;
 
@@ -26915,7 +26915,7 @@ bool 
AArch64TargetLowering::isComplexDeinterleavingOperationSupported(
   !llvm::isPowerOf2_32(VTyWidth))
 return false;
 
-  if (ScalarTy->isIntegerTy() && Subtarget->hasSVE2()) {
+  if (ScalarTy->isIntegerTy() && Subtarget->hasSVE2() && VTy->isScalableTy()) {
 unsigned ScalarWidth = ScalarTy->getScalarSizeInBits();
 return 8 <= ScalarWidth && ScalarWidth <= 64;
   }
diff --git a/llvm/test/CodeGen/AArch64/complex-deinterleaving-f16-add.ll 
b/llvm/test/CodeGen/AArch64/complex-deinterleaving-f16-add.ll
index 93497f38063d2..7b8448de2331b 100644
--- a/llvm/test/CodeGen/AArch64/complex-deinterleaving-f16-add.ll
+++ b/llvm/test/CodeGen/AArch64/complex-deinterleaving-f16-add.ll
@@ -1,6 +1,7 @@
 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
 ; RUN: llc < %s --mattr=+complxnum,+neon,+fullfp16 -o - | FileCheck %s
 ; RUN: llc < %s --mattr=+complxnum,+neon,+fullfp16,+sve -o - | FileCheck %s
+; RUN: llc < %s --mattr=+complxnum,+neon,+fullfp16,+sve2 -o - | FileCheck %s
 
 target triple = "aarch64"
 
@@ -158,6 +159,32 @@ entry:
   ret <16 x half> %interleaved.vec
 }
 
+
+; Expected not to transform as it is integer
+define <16 x i16> @complex_add_v16i16(<16 x i16> %a, <16 x i16> %b) {
+; CHECK-LABEL: complex_add_v16i16:
+; CHECK:   // %bb.0: // %entry
+; CHECK-NEXT:uzp1 v4.8h, v2.8h, v3.8h
+; CHECK-NEXT:uzp1 v5.8h, v0.8h, v1.8h
+; CHECK-NEXT:uzp2 v0.8h, v0.8h, v1.8h
+; CHECK-NEXT:uzp2 v1.8h, v2.8h, v3.8h
+; CHECK-NEXT:sub v2.8h, v4.8h, v0.8h
+; CHECK-NEXT:add v1.8h, v1.8h, v5.8h
+; CHECK-NEXT:zip1 v0.8h, v2.8h, v1.8h
+; CHECK-NEXT:zip2 v1.8h, v2.8h, v1.8h
+; CHECK-NEXT:ret
+entry:
+  %a.real = shufflevector <16 x i16> %a, <16 x i16> zeroinitializer, <8 x i32> 

+  %a.imag = shufflevector <16 x i16> %a, <16 x i16> zeroinitializer, <8 x i32> 

+  %b.real = shufflevector <16 x i16> %b, <16 x i16> zeroinitializer, <8 x i32> 

+  %b.imag = shufflevector <16 x i16> %b, <16 x i16> zeroinitializer, <8 x i32> 

+  %0 = sub <8 x i16> %b.real, %a.imag
+  %1 = add <8 x i16> %b.imag, %a.real
+  %interleaved.vec = shufflevector <8 x i16> %0, <8 x i16> %1, <16 x i32> 
+  ret <16 x i16> %interleaved.vec
+}
+
+
 declare { <2 x half>, <2 x half> } 
@llvm.experimental.vector.deinterleave2.v4f16(<4 x half>)
 declare <4 x half> @llvm.experimental.vector.interleave2.v4f16(<2 x half>, <2 
x half>)
 

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


[llvm-branch-commits] [llvm] PR for llvm/llvm-project#79860 (PR #79969)

2024-01-30 Thread via llvm-branch-commits

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


[llvm-branch-commits] [llvm] PR for llvm/llvm-project#79860 (PR #79969)

2024-01-30 Thread via llvm-branch-commits

llvmbot wrote:

@igogo-x86 What do you think about merging this PR to the release branch?

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


[llvm-branch-commits] [llvm] PR for llvm/llvm-project#79860 (PR #79969)

2024-01-30 Thread via llvm-branch-commits

llvmbot wrote:




@llvm/pr-subscribers-backend-aarch64

Author: None (llvmbot)


Changes

resolves llvm/llvm-project#79860

---
Full diff: https://github.com/llvm/llvm-project/pull/79969.diff


2 Files Affected:

- (modified) llvm/lib/Target/AArch64/AArch64ISelLowering.cpp (+2-2) 
- (modified) llvm/test/CodeGen/AArch64/complex-deinterleaving-f16-add.ll (+27) 


``diff
diff --git a/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp 
b/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
index 332fb37655288..24c5a45192bd8 100644
--- a/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
+++ b/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
@@ -26899,7 +26899,7 @@ bool 
AArch64TargetLowering::isComplexDeinterleavingOperationSupported(
 return false;
 
   // If the vector is scalable, SVE is enabled, implying support for complex
-  // numbers. Otherwirse, we need to ensure complex number support is avaialble
+  // numbers. Otherwise, we need to ensure complex number support is available
   if (!VTy->isScalableTy() && !Subtarget->hasComplxNum())
 return false;
 
@@ -26915,7 +26915,7 @@ bool 
AArch64TargetLowering::isComplexDeinterleavingOperationSupported(
   !llvm::isPowerOf2_32(VTyWidth))
 return false;
 
-  if (ScalarTy->isIntegerTy() && Subtarget->hasSVE2()) {
+  if (ScalarTy->isIntegerTy() && Subtarget->hasSVE2() && VTy->isScalableTy()) {
 unsigned ScalarWidth = ScalarTy->getScalarSizeInBits();
 return 8 <= ScalarWidth && ScalarWidth <= 64;
   }
diff --git a/llvm/test/CodeGen/AArch64/complex-deinterleaving-f16-add.ll 
b/llvm/test/CodeGen/AArch64/complex-deinterleaving-f16-add.ll
index 93497f38063d2..7b8448de2331b 100644
--- a/llvm/test/CodeGen/AArch64/complex-deinterleaving-f16-add.ll
+++ b/llvm/test/CodeGen/AArch64/complex-deinterleaving-f16-add.ll
@@ -1,6 +1,7 @@
 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
 ; RUN: llc < %s --mattr=+complxnum,+neon,+fullfp16 -o - | FileCheck %s
 ; RUN: llc < %s --mattr=+complxnum,+neon,+fullfp16,+sve -o - | FileCheck %s
+; RUN: llc < %s --mattr=+complxnum,+neon,+fullfp16,+sve2 -o - | FileCheck %s
 
 target triple = "aarch64"
 
@@ -158,6 +159,32 @@ entry:
   ret <16 x half> %interleaved.vec
 }
 
+
+; Expected not to transform as it is integer
+define <16 x i16> @complex_add_v16i16(<16 x i16> %a, <16 x i16> %b) {
+; CHECK-LABEL: complex_add_v16i16:
+; CHECK:   // %bb.0: // %entry
+; CHECK-NEXT:uzp1 v4.8h, v2.8h, v3.8h
+; CHECK-NEXT:uzp1 v5.8h, v0.8h, v1.8h
+; CHECK-NEXT:uzp2 v0.8h, v0.8h, v1.8h
+; CHECK-NEXT:uzp2 v1.8h, v2.8h, v3.8h
+; CHECK-NEXT:sub v2.8h, v4.8h, v0.8h
+; CHECK-NEXT:add v1.8h, v1.8h, v5.8h
+; CHECK-NEXT:zip1 v0.8h, v2.8h, v1.8h
+; CHECK-NEXT:zip2 v1.8h, v2.8h, v1.8h
+; CHECK-NEXT:ret
+entry:
+  %a.real = shufflevector <16 x i16> %a, <16 x i16> zeroinitializer, <8 x i32> 

+  %a.imag = shufflevector <16 x i16> %a, <16 x i16> zeroinitializer, <8 x i32> 

+  %b.real = shufflevector <16 x i16> %b, <16 x i16> zeroinitializer, <8 x i32> 

+  %b.imag = shufflevector <16 x i16> %b, <16 x i16> zeroinitializer, <8 x i32> 

+  %0 = sub <8 x i16> %b.real, %a.imag
+  %1 = add <8 x i16> %b.imag, %a.real
+  %interleaved.vec = shufflevector <8 x i16> %0, <8 x i16> %1, <16 x i32> 
+  ret <16 x i16> %interleaved.vec
+}
+
+
 declare { <2 x half>, <2 x half> } 
@llvm.experimental.vector.deinterleave2.v4f16(<4 x half>)
 declare <4 x half> @llvm.experimental.vector.interleave2.v4f16(<2 x half>, <2 
x half>)
 

``




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


[llvm-branch-commits] [clang] 193b711 - Revert "[RISCV] Relax march string order constraint"

2024-01-30 Thread via llvm-branch-commits

Author: Mehdi Amini
Date: 2024-01-30T02:32:24-08:00
New Revision: 193b711e4e1596c9db045e1e2afbc3077adccad3

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

LOG: Revert "[RISCV] Relax march string order constraint"

Added: 


Modified: 
clang/test/Driver/riscv-arch.c
llvm/lib/Support/RISCVISAInfo.cpp
llvm/unittests/Support/RISCVISAInfoTest.cpp

Removed: 




diff  --git a/clang/test/Driver/riscv-arch.c b/clang/test/Driver/riscv-arch.c
index c9e984e07cbe..0ac81ea982f1 100644
--- a/clang/test/Driver/riscv-arch.c
+++ b/clang/test/Driver/riscv-arch.c
@@ -156,8 +156,9 @@
 // RUN: -fsyntax-only 2>&1 | FileCheck -check-prefix=RV32L %s
 // RV32L: error: invalid arch name 'rv32l'
 
-// RUN: %clang --target=riscv32-unknown-elf -march=rv32imadf -### %s \
-// RUN:   -fsyntax-only 2>&1 | FileCheck %s
+// RUN: not %clang --target=riscv32-unknown-elf -march=rv32imadf -### %s \
+// RUN: -fsyntax-only 2>&1 | FileCheck -check-prefix=RV32IMADF %s
+// RV32IMADF: error: invalid arch name 'rv32imadf'
 
 // RUN: not %clang --target=riscv32-unknown-elf -march=rv32imm -### %s \
 // RUN: -fsyntax-only 2>&1 | FileCheck -check-prefix=RV32IMM %s
@@ -183,8 +184,9 @@
 // RUN: -fsyntax-only 2>&1 | FileCheck -check-prefix=RV64L %s
 // RV64L: error: invalid arch name 'rv64l'
 
-// RUN: %clang --target=riscv64-unknown-elf -march=rv64imadf -### %s \
-// RUN:   -fsyntax-only 2>&1 | FileCheck %s
+// RUN: not %clang --target=riscv64-unknown-elf -march=rv64imadf -### %s \
+// RUN: -fsyntax-only 2>&1 | FileCheck -check-prefix=RV64IMADF %s
+// RV64IMADF: error: invalid arch name 'rv64imadf'
 
 // RUN: not %clang --target=riscv64-unknown-elf -march=rv64imm -### %s \
 // RUN: -fsyntax-only 2>&1 | FileCheck -check-prefix=RV64IMM %s
@@ -214,7 +216,7 @@
 // RUN: not %clang --target=riscv32-unknown-elf -march=rv32imcq -### %s \
 // RUN: -fsyntax-only 2>&1 | FileCheck -check-prefix=RV32-ORDER %s
 // RV32-ORDER: error: invalid arch name 'rv32imcq',
-// RV32-ORDER: unsupported standard user-level extension 'q'
+// RV32-ORDER: standard user-level extension not given in canonical order 'q'
 
 // RUN: not %clang --target=riscv32-unknown-elf -march=rv32izvl64b -### %s \
 // RUN: -fsyntax-only 2>&1 | FileCheck -check-prefix=RV32-ZVL64B-ER %s
@@ -316,7 +318,7 @@
 // RUN: not %clang --target=riscv32-unknown-elf -march=rv32ixabc_a -### %s \
 // RUN: -fsyntax-only 2>&1 | FileCheck -check-prefix=RV32-PREFIX %s
 // RV32-PREFIX: error: invalid arch name 'rv32ixabc_a',
-// RV32-PREFIX: unsupported non-standard user-level extension 'xabc'
+// RV32-PREFIX: invalid extension prefix 'a'
 
 // RUN: not %clang --target=riscv32-unknown-elf -march=rv32ixdef_sabc -### %s \
 // RUN: -fsyntax-only 2>&1 | FileCheck -check-prefix=RV32-X-ORDER %s

diff  --git a/llvm/lib/Support/RISCVISAInfo.cpp 
b/llvm/lib/Support/RISCVISAInfo.cpp
index 050253f78399..c46d76da962c 100644
--- a/llvm/lib/Support/RISCVISAInfo.cpp
+++ b/llvm/lib/Support/RISCVISAInfo.cpp
@@ -7,7 +7,6 @@
 
//===--===//
 
 #include "llvm/Support/RISCVISAInfo.h"
-#include "llvm/ADT/MapVector.h"
 #include "llvm/ADT/STLExtras.h"
 #include "llvm/ADT/SetVector.h"
 #include "llvm/ADT/StringExtras.h"
@@ -704,106 +703,6 @@ RISCVISAInfo::parseNormalizedArchString(StringRef Arch) {
   return std::move(ISAInfo);
 }
 
-static Error splitExtsByUnderscore(StringRef Exts,
-   std::vector &SplitExts) {
-  SmallVector Split;
-  if (Exts.empty())
-return Error::success();
-
-  Exts.split(Split, "_");
-
-  for (auto Ext : Split) {
-if (Ext.empty())
-  return createStringError(errc::invalid_argument,
-   "extension name missing after separator '_'");
-
-SplitExts.push_back(Ext.str());
-  }
-  return Error::success();
-}
-
-static Error processMultiLetterExtension(
-StringRef RawExt,
-MapVector> &SeenExtMap,
-bool IgnoreUnknown, bool EnableExperimentalExtension,
-bool ExperimentalExtensionVersionCheck) {
-  StringRef Type = getExtensionType(RawExt);
-  StringRef Desc = getExtensionTypeDesc(RawExt);
-  auto Pos = findLastNonVersionCharacter(RawExt) + 1;
-  StringRef Name(RawExt.substr(0, Pos));
-  StringRef Vers(RawExt.substr(Pos));
-
-  if (Type.empty()) {
-if (IgnoreUnknown)
-  return Error::success();
-return createStringError(errc::invalid_argument,
- "invalid extension prefix '" + RawExt + "'");
-  }
-
-  if (!IgnoreUnknown && Name.size() == Type.size())
-return createStringError(errc::invalid_argument,
- "%s name missing after '%s'", Desc.str().c_str(),
- Type.str().c_str());
-
-  unsigned Major, Minor, ConsumeLength;
-  if (auto E = getExtensionVe

[llvm-branch-commits] [llvm] [clang] [AArch64] Add some release notes items (PR #79983)

2024-01-30 Thread Momchil Velikov via llvm-branch-commits

https://github.com/momchil-velikov created 
https://github.com/llvm/llvm-project/pull/79983

None

>From d647f6a4754807648dd11480b3e942571a9e1e25 Mon Sep 17 00:00:00 2001
From: Momchil Velikov 
Date: Tue, 30 Jan 2024 11:13:42 +
Subject: [PATCH] [AArch64] Add some release notes items

---
 clang/docs/ReleaseNotes.rst | 5 +
 llvm/docs/ReleaseNotes.rst  | 8 
 2 files changed, 13 insertions(+)

diff --git a/clang/docs/ReleaseNotes.rst b/clang/docs/ReleaseNotes.rst
index 060bc7669b72a..ab5fb5aee61a8 100644
--- a/clang/docs/ReleaseNotes.rst
+++ b/clang/docs/ReleaseNotes.rst
@@ -1164,6 +1164,11 @@ Arm and AArch64 Support
   * Cortex-A720 (cortex-a720).
   * Cortex-X4 (cortex-x4).
 
+- Alpha support has been added for SVE2.1 intrinsics.
+
+- Support has been added for `-fstack-clash-protection` and 
`-mstack-probe-size`
+  command line options.
+
 Android Support
 ^^^
 
diff --git a/llvm/docs/ReleaseNotes.rst b/llvm/docs/ReleaseNotes.rst
index 7b6a3f10d6377..990f5a5f73e84 100644
--- a/llvm/docs/ReleaseNotes.rst
+++ b/llvm/docs/ReleaseNotes.rst
@@ -105,6 +105,14 @@ Changes to the AArch64 Backend
   Armv9.0a has the same features enabled as Armv8.5a, with the exception
   of crypto.
 
+* Assembler/disassembler support has been added for 2023 architecture
+  extensions.
+
+* Support has been added for Stack Clash Protection. During function frame
+  creation and dynamic stack allocations, the compiler will issue memory
+  accesses at reguilar intervals so that a guard area at the top of the stack
+  can't be skipped over.
+
 Changes to the AMDGPU Backend
 -
 

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


[llvm-branch-commits] [llvm] [clang] [AArch64] Add some release notes items (PR #79983)

2024-01-30 Thread via llvm-branch-commits

llvmbot wrote:




@llvm/pr-subscribers-clang

Author: Momchil Velikov (momchil-velikov)


Changes



---
Full diff: https://github.com/llvm/llvm-project/pull/79983.diff


2 Files Affected:

- (modified) clang/docs/ReleaseNotes.rst (+5) 
- (modified) llvm/docs/ReleaseNotes.rst (+8) 


``diff
diff --git a/clang/docs/ReleaseNotes.rst b/clang/docs/ReleaseNotes.rst
index 060bc7669b72..ab5fb5aee61a 100644
--- a/clang/docs/ReleaseNotes.rst
+++ b/clang/docs/ReleaseNotes.rst
@@ -1164,6 +1164,11 @@ Arm and AArch64 Support
   * Cortex-A720 (cortex-a720).
   * Cortex-X4 (cortex-x4).
 
+- Alpha support has been added for SVE2.1 intrinsics.
+
+- Support has been added for `-fstack-clash-protection` and 
`-mstack-probe-size`
+  command line options.
+
 Android Support
 ^^^
 
diff --git a/llvm/docs/ReleaseNotes.rst b/llvm/docs/ReleaseNotes.rst
index 7b6a3f10d637..990f5a5f73e8 100644
--- a/llvm/docs/ReleaseNotes.rst
+++ b/llvm/docs/ReleaseNotes.rst
@@ -105,6 +105,14 @@ Changes to the AArch64 Backend
   Armv9.0a has the same features enabled as Armv8.5a, with the exception
   of crypto.
 
+* Assembler/disassembler support has been added for 2023 architecture
+  extensions.
+
+* Support has been added for Stack Clash Protection. During function frame
+  creation and dynamic stack allocations, the compiler will issue memory
+  accesses at reguilar intervals so that a guard area at the top of the stack
+  can't be skipped over.
+
 Changes to the AMDGPU Backend
 -
 

``




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


[llvm-branch-commits] [llvm] [clang] [AArch64] Add some release notes items (PR #79983)

2024-01-30 Thread Momchil Velikov via llvm-branch-commits

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


[llvm-branch-commits] [llvm] PR for llvm/llvm-project#78725 (PR #79986)

2024-01-30 Thread via llvm-branch-commits

https://github.com/llvmbot created 
https://github.com/llvm/llvm-project/pull/79986

resolves llvm/llvm-project#78725

>From 218b9f3e1cf6faac0172a9f91a76f40fe90ea405 Mon Sep 17 00:00:00 2001
From: Graham Hunter 
Date: Fri, 26 Jan 2024 11:30:35 +
Subject: [PATCH] [LV] Fix handling of interleaving linear args (#78725)

Currently when interleaving vector calls with linear arguments,
the Part is ignored and all vector calls use the initial value
from the first lane of the current iteration.

Fix this to extract from the correct part of the linear vector.

(cherry picked from commit d4c01714239e80d21e441c3886749fc56b743f81)
---
 .../lib/Transforms/Vectorize/VPlanRecipes.cpp | 12 +++--
 .../AArch64/vector-call-linear-args.ll| 54 ---
 2 files changed, 42 insertions(+), 24 deletions(-)

diff --git a/llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp 
b/llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp
index bbeb5da2cfec..ae2fc522ba40 100644
--- a/llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp
+++ b/llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp
@@ -597,13 +597,15 @@ void VPWidenCallRecipe::execute(VPTransformState &State) {
 for (const auto &I : enumerate(operands())) {
   // Some intrinsics have a scalar argument - don't replace it with a
   // vector.
-  // Some vectorized function variants may also take a scalar argument,
-  // e.g. linear parameters for pointers.
   Value *Arg;
-  if ((VFTy && !VFTy->getParamType(I.index())->isVectorTy()) ||
-  (UseIntrinsic &&
-   isVectorIntrinsicWithScalarOpAtArg(VectorIntrinsicID, I.index(
+  if (UseIntrinsic &&
+  isVectorIntrinsicWithScalarOpAtArg(VectorIntrinsicID, I.index()))
 Arg = State.get(I.value(), VPIteration(0, 0));
+  // Some vectorized function variants may also take a scalar argument,
+  // e.g. linear parameters for pointers. This needs to be the scalar value
+  // from the start of the respective part when interleaving.
+  else if (VFTy && !VFTy->getParamType(I.index())->isVectorTy())
+Arg = State.get(I.value(), VPIteration(Part, 0));
   else
 Arg = State.get(I.value(), Part);
   if (UseIntrinsic &&
diff --git 
a/llvm/test/Transforms/LoopVectorize/AArch64/vector-call-linear-args.ll 
b/llvm/test/Transforms/LoopVectorize/AArch64/vector-call-linear-args.ll
index 29440ca17424..f60ab5e848dd 100644
--- a/llvm/test/Transforms/LoopVectorize/AArch64/vector-call-linear-args.ll
+++ b/llvm/test/Transforms/LoopVectorize/AArch64/vector-call-linear-args.ll
@@ -21,7 +21,8 @@ define void @test_linear8(ptr noalias %a, ptr readnone %b, 
i64 %n) {
 ; NEON_INTERLEAVE-SAME: (ptr noalias [[A:%.*]], ptr readnone [[B:%.*]], i64 
[[N:%.*]]) {
 ; NEON_INTERLEAVE:[[TMP4:%.*]] = extractelement <2 x ptr> [[TMP2:%.*]], 
i32 0
 ; NEON_INTERLEAVE:[[TMP5:%.*]] = call <2 x i64> 
@vec_foo_linear8_nomask_neon(ptr [[TMP4]])
-; NEON_INTERLEAVE:[[TMP6:%.*]] = call <2 x i64> 
@vec_foo_linear8_nomask_neon(ptr [[TMP4]])
+; NEON_INTERLEAVE:[[TMP6:%.*]] = extractelement <2 x ptr> [[TMP3:%.*]], 
i32 0
+; NEON_INTERLEAVE:[[TMP7:%.*]] = call <2 x i64> 
@vec_foo_linear8_nomask_neon(ptr [[TMP6]])
 ; NEON_INTERLEAVE:[[DATA:%.*]] = call i64 @foo(ptr [[GEPB:%.*]]) 
#[[ATTR0:[0-9]+]]
 ;
 ; SVE_OR_NEON-LABEL: define void @test_linear8
@@ -34,8 +35,9 @@ define void @test_linear8(ptr noalias %a, ptr readnone %b, 
i64 %n) {
 ; SVE_OR_NEON_INTERLEAVE-SAME: (ptr noalias [[A:%.*]], ptr readnone [[B:%.*]], 
i64 [[N:%.*]]) #[[ATTR0:[0-9]+]] {
 ; SVE_OR_NEON_INTERLEAVE:[[TMP33:%.*]] = extractelement  
[[TMP31:%.*]], i32 0
 ; SVE_OR_NEON_INTERLEAVE:[[TMP34:%.*]] = call  
@vec_foo_linear8_mask_sve(ptr [[TMP33]],  
[[ACTIVE_LANE_MASK:%.*]])
-; SVE_OR_NEON_INTERLEAVE:[[TMP35:%.*]] = call  
@vec_foo_linear8_mask_sve(ptr [[TMP33]],  
[[ACTIVE_LANE_MASK2:%.*]])
-; SVE_OR_NEON_INTERLEAVE:[[TMP47:%.*]] = extractelement  
[[TMP45:%.*]], i32 0
+; SVE_OR_NEON_INTERLEAVE:[[TMP35:%.*]] = extractelement  
[[TMP32:%.*]], i32 0
+; SVE_OR_NEON_INTERLEAVE:[[TMP36:%.*]] = call  
@vec_foo_linear8_mask_sve(ptr [[TMP35]],  
[[ACTIVE_LANE_MASK2:%.*]])
+; SVE_OR_NEON_INTERLEAVE:[[TMP48:%.*]] = extractelement  
[[TMP46:%.*]], i32 0
 ; SVE_OR_NEON_INTERLEAVE:[[DATA:%.*]] = call i64 @foo(ptr [[GEPB:%.*]]) 
#[[ATTR4:[0-9]+]]
 ;
 ; SVE_TF-LABEL: define void @test_linear8
@@ -49,8 +51,9 @@ define void @test_linear8(ptr noalias %a, ptr readnone %b, 
i64 %n) {
 ; SVE_TF_INTERLEAVE-SAME: (ptr noalias [[A:%.*]], ptr readnone [[B:%.*]], i64 
[[N:%.*]]) #[[ATTR0:[0-9]+]] {
 ; SVE_TF_INTERLEAVE:[[TMP33:%.*]] = extractelement  
[[TMP31:%.*]], i32 0
 ; SVE_TF_INTERLEAVE:[[TMP34:%.*]] = call  
@vec_foo_linear8_mask_sve(ptr [[TMP33]],  
[[ACTIVE_LANE_MASK:%.*]])
-; SVE_TF_INTERLEAVE:[[TMP35:%.*]] = call  
@vec_foo_linear8_mask_sve(ptr [[TMP33]],  
[[ACTIVE_LANE_MASK2:%.*]])
-; SVE_TF_INTERLEAVE:[[TMP47:%.*]] = extractelement  
[[TMP45:%.*]], i32 0
+; SVE_TF_INTER

[llvm-branch-commits] [llvm] PR for llvm/llvm-project#78725 (PR #79986)

2024-01-30 Thread via llvm-branch-commits

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


[llvm-branch-commits] [llvm] PR for llvm/llvm-project#78725 (PR #79986)

2024-01-30 Thread via llvm-branch-commits

llvmbot wrote:

@labrinea What do you think about merging this PR to the release branch?

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


[llvm-branch-commits] [llvm] PR for llvm/llvm-project#78725 (PR #79986)

2024-01-30 Thread via llvm-branch-commits

llvmbot wrote:




@llvm/pr-subscribers-llvm-transforms

Author: None (llvmbot)


Changes

resolves llvm/llvm-project#78725

---
Full diff: https://github.com/llvm/llvm-project/pull/79986.diff


2 Files Affected:

- (modified) llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp (+7-5) 
- (modified) 
llvm/test/Transforms/LoopVectorize/AArch64/vector-call-linear-args.ll (+35-19) 


``diff
diff --git a/llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp 
b/llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp
index bbeb5da2cfec..ae2fc522ba40 100644
--- a/llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp
+++ b/llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp
@@ -597,13 +597,15 @@ void VPWidenCallRecipe::execute(VPTransformState &State) {
 for (const auto &I : enumerate(operands())) {
   // Some intrinsics have a scalar argument - don't replace it with a
   // vector.
-  // Some vectorized function variants may also take a scalar argument,
-  // e.g. linear parameters for pointers.
   Value *Arg;
-  if ((VFTy && !VFTy->getParamType(I.index())->isVectorTy()) ||
-  (UseIntrinsic &&
-   isVectorIntrinsicWithScalarOpAtArg(VectorIntrinsicID, I.index(
+  if (UseIntrinsic &&
+  isVectorIntrinsicWithScalarOpAtArg(VectorIntrinsicID, I.index()))
 Arg = State.get(I.value(), VPIteration(0, 0));
+  // Some vectorized function variants may also take a scalar argument,
+  // e.g. linear parameters for pointers. This needs to be the scalar value
+  // from the start of the respective part when interleaving.
+  else if (VFTy && !VFTy->getParamType(I.index())->isVectorTy())
+Arg = State.get(I.value(), VPIteration(Part, 0));
   else
 Arg = State.get(I.value(), Part);
   if (UseIntrinsic &&
diff --git 
a/llvm/test/Transforms/LoopVectorize/AArch64/vector-call-linear-args.ll 
b/llvm/test/Transforms/LoopVectorize/AArch64/vector-call-linear-args.ll
index 29440ca17424..f60ab5e848dd 100644
--- a/llvm/test/Transforms/LoopVectorize/AArch64/vector-call-linear-args.ll
+++ b/llvm/test/Transforms/LoopVectorize/AArch64/vector-call-linear-args.ll
@@ -21,7 +21,8 @@ define void @test_linear8(ptr noalias %a, ptr readnone %b, 
i64 %n) {
 ; NEON_INTERLEAVE-SAME: (ptr noalias [[A:%.*]], ptr readnone [[B:%.*]], i64 
[[N:%.*]]) {
 ; NEON_INTERLEAVE:[[TMP4:%.*]] = extractelement <2 x ptr> [[TMP2:%.*]], 
i32 0
 ; NEON_INTERLEAVE:[[TMP5:%.*]] = call <2 x i64> 
@vec_foo_linear8_nomask_neon(ptr [[TMP4]])
-; NEON_INTERLEAVE:[[TMP6:%.*]] = call <2 x i64> 
@vec_foo_linear8_nomask_neon(ptr [[TMP4]])
+; NEON_INTERLEAVE:[[TMP6:%.*]] = extractelement <2 x ptr> [[TMP3:%.*]], 
i32 0
+; NEON_INTERLEAVE:[[TMP7:%.*]] = call <2 x i64> 
@vec_foo_linear8_nomask_neon(ptr [[TMP6]])
 ; NEON_INTERLEAVE:[[DATA:%.*]] = call i64 @foo(ptr [[GEPB:%.*]]) 
#[[ATTR0:[0-9]+]]
 ;
 ; SVE_OR_NEON-LABEL: define void @test_linear8
@@ -34,8 +35,9 @@ define void @test_linear8(ptr noalias %a, ptr readnone %b, 
i64 %n) {
 ; SVE_OR_NEON_INTERLEAVE-SAME: (ptr noalias [[A:%.*]], ptr readnone [[B:%.*]], 
i64 [[N:%.*]]) #[[ATTR0:[0-9]+]] {
 ; SVE_OR_NEON_INTERLEAVE:[[TMP33:%.*]] = extractelement  
[[TMP31:%.*]], i32 0
 ; SVE_OR_NEON_INTERLEAVE:[[TMP34:%.*]] = call  
@vec_foo_linear8_mask_sve(ptr [[TMP33]],  
[[ACTIVE_LANE_MASK:%.*]])
-; SVE_OR_NEON_INTERLEAVE:[[TMP35:%.*]] = call  
@vec_foo_linear8_mask_sve(ptr [[TMP33]],  
[[ACTIVE_LANE_MASK2:%.*]])
-; SVE_OR_NEON_INTERLEAVE:[[TMP47:%.*]] = extractelement  
[[TMP45:%.*]], i32 0
+; SVE_OR_NEON_INTERLEAVE:[[TMP35:%.*]] = extractelement  
[[TMP32:%.*]], i32 0
+; SVE_OR_NEON_INTERLEAVE:[[TMP36:%.*]] = call  
@vec_foo_linear8_mask_sve(ptr [[TMP35]],  
[[ACTIVE_LANE_MASK2:%.*]])
+; SVE_OR_NEON_INTERLEAVE:[[TMP48:%.*]] = extractelement  
[[TMP46:%.*]], i32 0
 ; SVE_OR_NEON_INTERLEAVE:[[DATA:%.*]] = call i64 @foo(ptr [[GEPB:%.*]]) 
#[[ATTR4:[0-9]+]]
 ;
 ; SVE_TF-LABEL: define void @test_linear8
@@ -49,8 +51,9 @@ define void @test_linear8(ptr noalias %a, ptr readnone %b, 
i64 %n) {
 ; SVE_TF_INTERLEAVE-SAME: (ptr noalias [[A:%.*]], ptr readnone [[B:%.*]], i64 
[[N:%.*]]) #[[ATTR0:[0-9]+]] {
 ; SVE_TF_INTERLEAVE:[[TMP33:%.*]] = extractelement  
[[TMP31:%.*]], i32 0
 ; SVE_TF_INTERLEAVE:[[TMP34:%.*]] = call  
@vec_foo_linear8_mask_sve(ptr [[TMP33]],  
[[ACTIVE_LANE_MASK:%.*]])
-; SVE_TF_INTERLEAVE:[[TMP35:%.*]] = call  
@vec_foo_linear8_mask_sve(ptr [[TMP33]],  
[[ACTIVE_LANE_MASK2:%.*]])
-; SVE_TF_INTERLEAVE:[[TMP47:%.*]] = extractelement  
[[TMP45:%.*]], i32 0
+; SVE_TF_INTERLEAVE:[[TMP35:%.*]] = extractelement  
[[TMP32:%.*]], i32 0
+; SVE_TF_INTERLEAVE:[[TMP36:%.*]] = call  
@vec_foo_linear8_mask_sve(ptr [[TMP35]],  
[[ACTIVE_LANE_MASK2:%.*]])
+; SVE_TF_INTERLEAVE:[[TMP48:%.*]] = extractelement  
[[TMP46:%.*]], i32 0
 ; SVE_TF_INTERLEAVE:[[DATA:%.*]] = call i64 @foo(ptr [[GEPB:%.*]]) 
#[[ATTR4:[0-9]+]]
 ;
 entry:
@@ -81,7 +84,8 @@ define void @test_vector_linear4(ptr noalias

[llvm-branch-commits] [llvm] PR for llvm/llvm-project#78725 (PR #79986)

2024-01-30 Thread Maciej Gabka via llvm-branch-commits

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


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


[llvm-branch-commits] [clang] PR for llvm/llvm-project#79992 (PR #79997)

2024-01-30 Thread via llvm-branch-commits

https://github.com/llvmbot created 
https://github.com/llvm/llvm-project/pull/79997

resolves llvm/llvm-project#79992

>From 2437bc0682490d0bac7267bd14e11b9b22817306 Mon Sep 17 00:00:00 2001
From: Andrey Ali Khan Bolshakov
 <32954549+bolshako...@users.noreply.github.com>
Date: Tue, 30 Jan 2024 15:03:55 +0300
Subject: [PATCH] Fix analyzer crash on 'StructuralValue' (#79764)

`OpaqueValueExpr` doesn't necessarily contain a source expression.
Particularly, after #78041, it is used to carry the type and the value
kind of a non-type template argument of floating-point type or referring
to a subobject (those are so called `StructuralValue` arguments).

This fixes #79575.

(cherry picked from commit ef67f63fa5f950f4056b5783e92e137342805d74)
---
 clang/lib/Sema/SemaDecl.cpp |  3 ++-
 clang/lib/StaticAnalyzer/Core/Environment.cpp   |  8 +---
 clang/test/Analysis/templates.cpp   | 13 +
 .../SemaTemplate/temp_arg_nontype_cxx20.cpp | 17 +
 4 files changed, 37 insertions(+), 4 deletions(-)

diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp
index f9bf1d14bdc4f..a300badc6d026 100644
--- a/clang/lib/Sema/SemaDecl.cpp
+++ b/clang/lib/Sema/SemaDecl.cpp
@@ -12752,7 +12752,8 @@ namespace {
   }
 
   if (OpaqueValueExpr *OVE = dyn_cast(E)) {
-HandleValue(OVE->getSourceExpr());
+if (Expr *SE = OVE->getSourceExpr())
+  HandleValue(SE);
 return;
   }
 
diff --git a/clang/lib/StaticAnalyzer/Core/Environment.cpp 
b/clang/lib/StaticAnalyzer/Core/Environment.cpp
index 4f989ed59bee3..427f51109853b 100644
--- a/clang/lib/StaticAnalyzer/Core/Environment.cpp
+++ b/clang/lib/StaticAnalyzer/Core/Environment.cpp
@@ -40,8 +40,11 @@ static const Expr *ignoreTransparentExprs(const Expr *E) {
 
   switch (E->getStmtClass()) {
   case Stmt::OpaqueValueExprClass:
-E = cast(E)->getSourceExpr();
-break;
+if (const Expr *SE = cast(E)->getSourceExpr()) {
+  E = SE;
+  break;
+}
+return E;
   case Stmt::ExprWithCleanupsClass:
 E = cast(E)->getSubExpr();
 break;
@@ -98,7 +101,6 @@ SVal Environment::getSVal(const EnvironmentEntry &Entry,
   case Stmt::CXXBindTemporaryExprClass:
   case Stmt::ExprWithCleanupsClass:
   case Stmt::GenericSelectionExprClass:
-  case Stmt::OpaqueValueExprClass:
   case Stmt::ConstantExprClass:
   case Stmt::ParenExprClass:
   case Stmt::SubstNonTypeTemplateParmExprClass:
diff --git a/clang/test/Analysis/templates.cpp 
b/clang/test/Analysis/templates.cpp
index 061c19fe7e044..6da1821b70f26 100644
--- a/clang/test/Analysis/templates.cpp
+++ b/clang/test/Analysis/templates.cpp
@@ -68,3 +68,16 @@ namespace rdar13954714 {
   // force instantiation
   template void blockWithStatic();
 }
+
+namespace structural_value_crash {
+  constexpr char abc[] = "abc";
+
+  template 
+  void use_template_param() {
+const char *p = in;
+  }
+
+  void force_instantiate() {
+use_template_param();
+  }
+}
diff --git a/clang/test/SemaTemplate/temp_arg_nontype_cxx20.cpp 
b/clang/test/SemaTemplate/temp_arg_nontype_cxx20.cpp
index 834174cdf6a32..ad73daa8e214c 100644
--- a/clang/test/SemaTemplate/temp_arg_nontype_cxx20.cpp
+++ b/clang/test/SemaTemplate/temp_arg_nontype_cxx20.cpp
@@ -354,3 +354,20 @@ namespace ReportedRegression1 {
 return dummy.exit_code();
   }
 }
+
+namespace ReportedRegression2 {
+  const char str[] = "dummy";
+
+  struct S {
+S operator+(const char*) const;
+  };
+
+  template 
+  void fn() {
+auto s = S{} + in;
+  }
+
+  void use() {
+fn();
+  }
+}

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


[llvm-branch-commits] [clang] PR for llvm/llvm-project#79992 (PR #79997)

2024-01-30 Thread via llvm-branch-commits

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


[llvm-branch-commits] [clang] PR for llvm/llvm-project#79992 (PR #79997)

2024-01-30 Thread via llvm-branch-commits

llvmbot wrote:

@erichkeane What do you think about merging this PR to the release branch?

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


[llvm-branch-commits] [clang] PR for llvm/llvm-project#79992 (PR #79997)

2024-01-30 Thread via llvm-branch-commits

llvmbot wrote:



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

@llvm/pr-subscribers-clang

Author: None (llvmbot)


Changes

resolves llvm/llvm-project#79992

---
Full diff: https://github.com/llvm/llvm-project/pull/79997.diff


4 Files Affected:

- (modified) clang/lib/Sema/SemaDecl.cpp (+2-1) 
- (modified) clang/lib/StaticAnalyzer/Core/Environment.cpp (+5-3) 
- (modified) clang/test/Analysis/templates.cpp (+13) 
- (modified) clang/test/SemaTemplate/temp_arg_nontype_cxx20.cpp (+17) 


``diff
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp
index f9bf1d14bdc4..a300badc6d02 100644
--- a/clang/lib/Sema/SemaDecl.cpp
+++ b/clang/lib/Sema/SemaDecl.cpp
@@ -12752,7 +12752,8 @@ namespace {
   }
 
   if (OpaqueValueExpr *OVE = dyn_cast(E)) {
-HandleValue(OVE->getSourceExpr());
+if (Expr *SE = OVE->getSourceExpr())
+  HandleValue(SE);
 return;
   }
 
diff --git a/clang/lib/StaticAnalyzer/Core/Environment.cpp 
b/clang/lib/StaticAnalyzer/Core/Environment.cpp
index 4f989ed59bee..427f51109853 100644
--- a/clang/lib/StaticAnalyzer/Core/Environment.cpp
+++ b/clang/lib/StaticAnalyzer/Core/Environment.cpp
@@ -40,8 +40,11 @@ static const Expr *ignoreTransparentExprs(const Expr *E) {
 
   switch (E->getStmtClass()) {
   case Stmt::OpaqueValueExprClass:
-E = cast(E)->getSourceExpr();
-break;
+if (const Expr *SE = cast(E)->getSourceExpr()) {
+  E = SE;
+  break;
+}
+return E;
   case Stmt::ExprWithCleanupsClass:
 E = cast(E)->getSubExpr();
 break;
@@ -98,7 +101,6 @@ SVal Environment::getSVal(const EnvironmentEntry &Entry,
   case Stmt::CXXBindTemporaryExprClass:
   case Stmt::ExprWithCleanupsClass:
   case Stmt::GenericSelectionExprClass:
-  case Stmt::OpaqueValueExprClass:
   case Stmt::ConstantExprClass:
   case Stmt::ParenExprClass:
   case Stmt::SubstNonTypeTemplateParmExprClass:
diff --git a/clang/test/Analysis/templates.cpp 
b/clang/test/Analysis/templates.cpp
index 061c19fe7e04..6da1821b70f2 100644
--- a/clang/test/Analysis/templates.cpp
+++ b/clang/test/Analysis/templates.cpp
@@ -68,3 +68,16 @@ namespace rdar13954714 {
   // force instantiation
   template void blockWithStatic();
 }
+
+namespace structural_value_crash {
+  constexpr char abc[] = "abc";
+
+  template 
+  void use_template_param() {
+const char *p = in;
+  }
+
+  void force_instantiate() {
+use_template_param();
+  }
+}
diff --git a/clang/test/SemaTemplate/temp_arg_nontype_cxx20.cpp 
b/clang/test/SemaTemplate/temp_arg_nontype_cxx20.cpp
index 834174cdf6a3..ad73daa8e214 100644
--- a/clang/test/SemaTemplate/temp_arg_nontype_cxx20.cpp
+++ b/clang/test/SemaTemplate/temp_arg_nontype_cxx20.cpp
@@ -354,3 +354,20 @@ namespace ReportedRegression1 {
 return dummy.exit_code();
   }
 }
+
+namespace ReportedRegression2 {
+  const char str[] = "dummy";
+
+  struct S {
+S operator+(const char*) const;
+  };
+
+  template 
+  void fn() {
+auto s = S{} + in;
+  }
+
+  void use() {
+fn();
+  }
+}

``




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


[llvm-branch-commits] [clang] PR for llvm/llvm-project#79992 (PR #79997)

2024-01-30 Thread Erich Keane via llvm-branch-commits

erichkeane wrote:

> @erichkeane What do you think about merging this PR to the release branch?

We absolutely should!  Please do.

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


[llvm-branch-commits] [clang] PR for llvm/llvm-project#79992 (PR #79997)

2024-01-30 Thread Erich Keane via llvm-branch-commits

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


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


[llvm-branch-commits] [llvm] [lld] [clang] [docs] Add release notes for Windows specific changes in 18.x (PR #80011)

2024-01-30 Thread Martin Storsjö via llvm-branch-commits

https://github.com/mstorsjo created 
https://github.com/llvm/llvm-project/pull/80011

None

From a09a391d4985d4adc1a5f500ba69b2f8f55aa47f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Martin=20Storsj=C3=B6?= 
Date: Tue, 30 Jan 2024 14:18:22 +0200
Subject: [PATCH] [docs] Add release notes for Windows specific changes in 18.x

---
 clang/docs/ReleaseNotes.rst |  2 ++
 lld/docs/ReleaseNotes.rst   | 16 
 llvm/docs/ReleaseNotes.rst  | 14 ++
 3 files changed, 32 insertions(+)

diff --git a/clang/docs/ReleaseNotes.rst b/clang/docs/ReleaseNotes.rst
index 060bc7669b72a..c0833a4ee7a31 100644
--- a/clang/docs/ReleaseNotes.rst
+++ b/clang/docs/ReleaseNotes.rst
@@ -1195,6 +1195,8 @@ Windows Support
   linking may succeed but the resulting executables may expose issues at
   runtime.
 
+- Clang now passes relevant LTO options to the linker (LLD) in MinGW mode.
+
 LoongArch Support
 ^
 - Added builtins support for all LSX (128-bits SIMD) and LASX (256-bits SIMD)
diff --git a/lld/docs/ReleaseNotes.rst b/lld/docs/ReleaseNotes.rst
index 01669543cd50c..c896d2bd537a2 100644
--- a/lld/docs/ReleaseNotes.rst
+++ b/lld/docs/ReleaseNotes.rst
@@ -41,9 +41,25 @@ COFF Improvements
 * Added support for ``--time-trace`` and associated 
``--time-trace-granularity``.
   This generates a .json profile trace of the linker execution.
 
+* Prefer library paths specified with ``-libpath:`` over the implicitly
+  detected toolchain paths.
+
 MinGW Improvements
 --
 
+* Added support for many LTO and ThinLTO options.
+
+* LLD no longer tries to autodetect and pick up MSVC/WinSDK installations
+  when run in MinGW mode.
+
+* The ``--icf=safe`` option now works as expected; it was previously a no-op.
+
+* More correctly handle LTO of files that define ``__imp_`` prefixed dllimport
+  redirections.
+
+* The strip flags ``-S`` and ``-s`` now can be used to strip out DWARF debug
+  info and symbol tables while emitting a PDB debug info file.
+
 MachO Improvements
 --
 
diff --git a/llvm/docs/ReleaseNotes.rst b/llvm/docs/ReleaseNotes.rst
index 7b6a3f10d6377..c46c4a3f767f7 100644
--- a/llvm/docs/ReleaseNotes.rst
+++ b/llvm/docs/ReleaseNotes.rst
@@ -319,6 +319,18 @@ Changes to the LLVM tools
 * llvm-objcopy now supports ``--gap-fill`` and ``--pad-to`` options, for
   ELF input and binary output files only.
 
+* llvm-rc and llvm-windres now accept file path references in ``.rc`` files
+  concatenated from multiple string literals.
+
+* The llvm-windres option ``--preprocessor`` now resolve its argument
+  in the PATH environment variable as expected, and options passed with
+  ``--preprocessor-arg`` are placed before the input file as they should.
+
+* The llvm-windres option ``--preprocessor`` has been updated with the
+  breaking behaviour change from GNU windres from binutils 2.36, where
+  the whole argument is considered as one path, not considered as a
+  sequence of tool name and parameters.
+
 Changes to LLDB
 -
 
@@ -359,6 +371,8 @@ Changes to LLDB
   fields are present, however this is not always possible or entirely
   accurate. If in doubt, refer to the numerical value.
 
+* On Windows, LLDB can now read the thread names.
+
 Changes to Sanitizers
 -
 * HWASan now defaults to detecting use-after-scope bugs.

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


[llvm-branch-commits] [llvm] [lld] [clang] [docs] Add release notes for Windows specific changes in 18.x (PR #80011)

2024-01-30 Thread Martin Storsjö via llvm-branch-commits

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


[llvm-branch-commits] [libcxx] [libcxx] Add a release note for Clang-cl specific features (PR #80010)

2024-01-30 Thread Louis Dionne via llvm-branch-commits

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


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


[llvm-branch-commits] [llvm] [lld] [clang] [docs] Add release notes for Windows specific changes in 18.x (PR #80011)

2024-01-30 Thread Martin Storsjö via llvm-branch-commits

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


[llvm-branch-commits] [llvm] [lld] [clang] [docs] Add release notes for Windows specific changes in 18.x (PR #80011)

2024-01-30 Thread Martin Storsjö via llvm-branch-commits


@@ -359,6 +371,8 @@ Changes to LLDB
   fields are present, however this is not always possible or entirely
   accurate. If in doubt, refer to the numerical value.
 
+* On Windows, LLDB can now read the thread names.

mstorsjo wrote:

@oltolm Is this accurate for 95e5839e06fdffd278499257c6e7679bba3d6868?

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


[llvm-branch-commits] [llvm] [lld] [clang] [docs] Add release notes for Windows specific changes in 18.x (PR #80011)

2024-01-30 Thread via llvm-branch-commits

llvmbot wrote:




@llvm/pr-subscribers-clang

Author: Martin Storsjö (mstorsjo)


Changes



---
Full diff: https://github.com/llvm/llvm-project/pull/80011.diff


3 Files Affected:

- (modified) clang/docs/ReleaseNotes.rst (+2) 
- (modified) lld/docs/ReleaseNotes.rst (+16) 
- (modified) llvm/docs/ReleaseNotes.rst (+14) 


``diff
diff --git a/clang/docs/ReleaseNotes.rst b/clang/docs/ReleaseNotes.rst
index 060bc7669b72a..c0833a4ee7a31 100644
--- a/clang/docs/ReleaseNotes.rst
+++ b/clang/docs/ReleaseNotes.rst
@@ -1195,6 +1195,8 @@ Windows Support
   linking may succeed but the resulting executables may expose issues at
   runtime.
 
+- Clang now passes relevant LTO options to the linker (LLD) in MinGW mode.
+
 LoongArch Support
 ^
 - Added builtins support for all LSX (128-bits SIMD) and LASX (256-bits SIMD)
diff --git a/lld/docs/ReleaseNotes.rst b/lld/docs/ReleaseNotes.rst
index 01669543cd50c..c896d2bd537a2 100644
--- a/lld/docs/ReleaseNotes.rst
+++ b/lld/docs/ReleaseNotes.rst
@@ -41,9 +41,25 @@ COFF Improvements
 * Added support for ``--time-trace`` and associated 
``--time-trace-granularity``.
   This generates a .json profile trace of the linker execution.
 
+* Prefer library paths specified with ``-libpath:`` over the implicitly
+  detected toolchain paths.
+
 MinGW Improvements
 --
 
+* Added support for many LTO and ThinLTO options.
+
+* LLD no longer tries to autodetect and pick up MSVC/WinSDK installations
+  when run in MinGW mode.
+
+* The ``--icf=safe`` option now works as expected; it was previously a no-op.
+
+* More correctly handle LTO of files that define ``__imp_`` prefixed dllimport
+  redirections.
+
+* The strip flags ``-S`` and ``-s`` now can be used to strip out DWARF debug
+  info and symbol tables while emitting a PDB debug info file.
+
 MachO Improvements
 --
 
diff --git a/llvm/docs/ReleaseNotes.rst b/llvm/docs/ReleaseNotes.rst
index 7b6a3f10d6377..c46c4a3f767f7 100644
--- a/llvm/docs/ReleaseNotes.rst
+++ b/llvm/docs/ReleaseNotes.rst
@@ -319,6 +319,18 @@ Changes to the LLVM tools
 * llvm-objcopy now supports ``--gap-fill`` and ``--pad-to`` options, for
   ELF input and binary output files only.
 
+* llvm-rc and llvm-windres now accept file path references in ``.rc`` files
+  concatenated from multiple string literals.
+
+* The llvm-windres option ``--preprocessor`` now resolve its argument
+  in the PATH environment variable as expected, and options passed with
+  ``--preprocessor-arg`` are placed before the input file as they should.
+
+* The llvm-windres option ``--preprocessor`` has been updated with the
+  breaking behaviour change from GNU windres from binutils 2.36, where
+  the whole argument is considered as one path, not considered as a
+  sequence of tool name and parameters.
+
 Changes to LLDB
 -
 
@@ -359,6 +371,8 @@ Changes to LLDB
   fields are present, however this is not always possible or entirely
   accurate. If in doubt, refer to the numerical value.
 
+* On Windows, LLDB can now read the thread names.
+
 Changes to Sanitizers
 -
 * HWASan now defaults to detecting use-after-scope bugs.

``




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


[llvm-branch-commits] [llvm] [clang] Backport [RISCV] Graduate Zicond to non-experimental (#79811) (PR #80018)

2024-01-30 Thread Alex Bradbury via llvm-branch-commits

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


[llvm-branch-commits] [llvm] [clang] Backport [RISCV] Graduate Zicond to non-experimental (#79811) (PR #80018)

2024-01-30 Thread Alex Bradbury via llvm-branch-commits

https://github.com/asb created https://github.com/llvm/llvm-project/pull/80018

The Zicond extension was ratified in the last few months, with no changes that 
affect the LLVM implementation. Although there's surely more tuning that could 
be done about when to select Zicond or not, there are no known correctness 
issues. Therefore, we should mark support as non-experimental.

(cherry-picked from commit d833b9d677c9dd0a35a211e2fdfada21ea9a464b)

>From 4add1cb7074c8f8a2c6295c59e45b470e1b62fc4 Mon Sep 17 00:00:00 2001
From: Alex Bradbury 
Date: Tue, 30 Jan 2024 14:21:21 +
Subject: [PATCH] [RISCV] Graduate Zicond to non-experimental (#79811)

The Zicond extension was ratified in the last few months, with no
changes that affect the LLVM implementation. Although there's surely
more tuning that could be done about when to select Zicond or not, there
are no known correctness issues. Therefore, we should mark support as
non-experimental.

(cherry-picked from commit d833b9d677c9dd0a35a211e2fdfada21ea9a464b)
---
 .../CodeGen/RISCV/riscv-func-attr-target.c|  2 +-
 .../test/Preprocessor/riscv-target-features.c | 16 +++---
 llvm/docs/RISCVUsage.rst  |  4 +-
 llvm/docs/ReleaseNotes.rst|  1 +
 llvm/lib/Support/RISCVISAInfo.cpp |  3 +-
 llvm/lib/Target/RISCV/RISCVFeatures.td|  2 +-
 llvm/lib/Target/RISCV/RISCVInstrInfoZicond.td |  2 -
 llvm/test/CodeGen/RISCV/attributes.ll |  4 +-
 llvm/test/CodeGen/RISCV/cmov-branch-opt.ll|  4 +-
 llvm/test/CodeGen/RISCV/condbinops.ll |  4 +-
 llvm/test/CodeGen/RISCV/condops.ll|  4 +-
 .../CodeGen/RISCV/select-binop-identity.ll|  4 +-
 llvm/test/CodeGen/RISCV/select.ll |  4 +-
 .../CodeGen/RISCV/short-forward-branch-opt.ll |  2 +-
 llvm/test/CodeGen/RISCV/xaluo.ll  |  4 +-
 llvm/test/MC/RISCV/rv32zicond-invalid.s   |  4 +-
 llvm/test/MC/RISCV/rv32zicond-valid.s | 12 ++---
 llvm/unittests/Support/RISCVISAInfoTest.cpp   | 52 +--
 18 files changed, 60 insertions(+), 68 deletions(-)

diff --git a/clang/test/CodeGen/RISCV/riscv-func-attr-target.c 
b/clang/test/CodeGen/RISCV/riscv-func-attr-target.c
index 7d3362e84e758..f216eaf735b4a 100644
--- a/clang/test/CodeGen/RISCV/riscv-func-attr-target.c
+++ b/clang/test/CodeGen/RISCV/riscv-func-attr-target.c
@@ -39,7 +39,7 @@ __attribute__((target("cpu=sifive-u54"))) void 
testAttrCpuOnly() {}
 // CHECK: attributes #0 = { 
{{.*}}"target-features"="+64bit,+a,+m,+save-restore,+zifencei,-relax,-zbb,-zfa" 
}
 // CHECK: attributes #1 = { {{.*}}"target-cpu"="rocket-rv64" 
"target-features"="+64bit,+a,+d,+f,+m,+save-restore,+v,+zicsr,+zifencei,+zve32f,+zve32x,+zve64d,+zve64f,+zve64x,+zvl128b,+zvl32b,+zvl64b,-relax,-zbb,-zfa"
 "tune-cpu"="generic-rv64" }
 // CHECK: attributes #2 = { 
{{.*}}"target-features"="+64bit,+a,+m,+save-restore,+zbb,+zifencei,-relax,-zfa" 
}
-// CHECK: attributes #3 = { 
{{.*}}"target-features"="+64bit,+a,+d,+experimental-zicond,+f,+m,+save-restore,+v,+zbb,+zicsr,+zifencei,+zve32f,+zve32x,+zve64d,+zve64f,+zve64x,+zvl128b,+zvl32b,+zvl64b,-relax,-zfa"
 }
+// CHECK: attributes #3 = { 
{{.*}}"target-features"="+64bit,+a,+d,+f,+m,+save-restore,+v,+zbb,+zicond,+zicsr,+zifencei,+zve32f,+zve32x,+zve64d,+zve64f,+zve64x,+zvl128b,+zvl32b,+zvl64b,-relax,-zfa"
 }
 // Make sure we append negative features if we override the arch
 // CHECK: attributes #4 = { 
{{.*}}"target-features"="+64bit,+a,+c,+d,+f,+m,+save-restore,+zbb,+zicsr,+zifencei,{{(-[[:alnum:]-]+)(,-[[:alnum:]-]+)*}}"
 }
 // CHECK: attributes #5 = { 
{{.*}}"target-features"="+64bit,+m,+save-restore,{{(-[[:alnum:]-]+)(,-[[:alnum:]-]+)*}}"
 }
diff --git a/clang/test/Preprocessor/riscv-target-features.c 
b/clang/test/Preprocessor/riscv-target-features.c
index 39d2c66f14b23..30697af89c2eb 100644
--- a/clang/test/Preprocessor/riscv-target-features.c
+++ b/clang/test/Preprocessor/riscv-target-features.c
@@ -764,6 +764,14 @@
 // RUN: -o - | FileCheck --check-prefix=CHECK-ZICNTR-EXT %s
 // CHECK-ZICNTR-EXT: __riscv_zicntr 200{{$}}
 
+// RUN: %clang --target=riscv32 \
+// RUN: -march=rv32i_zicond1p0 -x c -E -dM %s \
+// RUN: -o - | FileCheck --check-prefix=CHECK-ZICOND-EXT %s
+// RUN: %clang --target=riscv64 \
+// RUN: -march=rv64i_zicond1p0 -x c -E -dM %s \
+// RUN: -o - | FileCheck --check-prefix=CHECK-ZICOND-EXT %s
+// CHECK-ZICOND-EXT: __riscv_zicond  100{{$}}
+
 // RUN: %clang --target=riscv32-unknown-linux-gnu \
 // RUN: -march=rv32izicsr2p0 -x c -E -dM %s \
 // RUN: -o - | FileCheck --check-prefix=CHECK-ZICSR-EXT %s
@@ -1332,14 +1340,6 @@
 // RUN: -o - | FileCheck --check-prefix=CHECK-ZICFILP-EXT %s
 // CHECK-ZICFILP-EXT: __riscv_zicfilp 4000{{$}}
 
-// RUN: %clang --target=riscv32 -menable-experimental-extensions \
-// RUN: -march=rv32i_zicond1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZICOND-EXT %s
-// RUN: %clang --target=riscv64 -menable-experimental-extensions \
-// RUN: -march=rv64i_zicond1p0 -x c -

[llvm-branch-commits] [llvm] [clang] Backport [RISCV] Graduate Zicond to non-experimental (#79811) (PR #80018)

2024-01-30 Thread Alex Bradbury via llvm-branch-commits

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


[llvm-branch-commits] [llvm] [clang] Backport [RISCV] Graduate Zicond to non-experimental (#79811) (PR #80018)

2024-01-30 Thread via llvm-branch-commits

llvmbot wrote:




@llvm/pr-subscribers-clang

Author: Alex Bradbury (asb)


Changes

The Zicond extension was ratified in the last few months, with no changes that 
affect the LLVM implementation. Although there's surely more tuning that could 
be done about when to select Zicond or not, there are no known correctness 
issues. Therefore, we should mark support as non-experimental.

(cherry-picked from commit d833b9d677c9dd0a35a211e2fdfada21ea9a464b)

---

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


18 Files Affected:

- (modified) clang/test/CodeGen/RISCV/riscv-func-attr-target.c (+1-1) 
- (modified) clang/test/Preprocessor/riscv-target-features.c (+8-8) 
- (modified) llvm/docs/RISCVUsage.rst (+1-3) 
- (modified) llvm/docs/ReleaseNotes.rst (+1) 
- (modified) llvm/lib/Support/RISCVISAInfo.cpp (+1-2) 
- (modified) llvm/lib/Target/RISCV/RISCVFeatures.td (+1-1) 
- (modified) llvm/lib/Target/RISCV/RISCVInstrInfoZicond.td (-2) 
- (modified) llvm/test/CodeGen/RISCV/attributes.ll (+2-2) 
- (modified) llvm/test/CodeGen/RISCV/cmov-branch-opt.ll (+2-2) 
- (modified) llvm/test/CodeGen/RISCV/condbinops.ll (+2-2) 
- (modified) llvm/test/CodeGen/RISCV/condops.ll (+2-2) 
- (modified) llvm/test/CodeGen/RISCV/select-binop-identity.ll (+2-2) 
- (modified) llvm/test/CodeGen/RISCV/select.ll (+2-2) 
- (modified) llvm/test/CodeGen/RISCV/short-forward-branch-opt.ll (+1-1) 
- (modified) llvm/test/CodeGen/RISCV/xaluo.ll (+2-2) 
- (modified) llvm/test/MC/RISCV/rv32zicond-invalid.s (+2-2) 
- (modified) llvm/test/MC/RISCV/rv32zicond-valid.s (+6-6) 
- (modified) llvm/unittests/Support/RISCVISAInfoTest.cpp (+24-28) 


``diff
diff --git a/clang/test/CodeGen/RISCV/riscv-func-attr-target.c 
b/clang/test/CodeGen/RISCV/riscv-func-attr-target.c
index 7d3362e84e758..f216eaf735b4a 100644
--- a/clang/test/CodeGen/RISCV/riscv-func-attr-target.c
+++ b/clang/test/CodeGen/RISCV/riscv-func-attr-target.c
@@ -39,7 +39,7 @@ __attribute__((target("cpu=sifive-u54"))) void 
testAttrCpuOnly() {}
 // CHECK: attributes #0 = { 
{{.*}}"target-features"="+64bit,+a,+m,+save-restore,+zifencei,-relax,-zbb,-zfa" 
}
 // CHECK: attributes #1 = { {{.*}}"target-cpu"="rocket-rv64" 
"target-features"="+64bit,+a,+d,+f,+m,+save-restore,+v,+zicsr,+zifencei,+zve32f,+zve32x,+zve64d,+zve64f,+zve64x,+zvl128b,+zvl32b,+zvl64b,-relax,-zbb,-zfa"
 "tune-cpu"="generic-rv64" }
 // CHECK: attributes #2 = { 
{{.*}}"target-features"="+64bit,+a,+m,+save-restore,+zbb,+zifencei,-relax,-zfa" 
}
-// CHECK: attributes #3 = { 
{{.*}}"target-features"="+64bit,+a,+d,+experimental-zicond,+f,+m,+save-restore,+v,+zbb,+zicsr,+zifencei,+zve32f,+zve32x,+zve64d,+zve64f,+zve64x,+zvl128b,+zvl32b,+zvl64b,-relax,-zfa"
 }
+// CHECK: attributes #3 = { 
{{.*}}"target-features"="+64bit,+a,+d,+f,+m,+save-restore,+v,+zbb,+zicond,+zicsr,+zifencei,+zve32f,+zve32x,+zve64d,+zve64f,+zve64x,+zvl128b,+zvl32b,+zvl64b,-relax,-zfa"
 }
 // Make sure we append negative features if we override the arch
 // CHECK: attributes #4 = { 
{{.*}}"target-features"="+64bit,+a,+c,+d,+f,+m,+save-restore,+zbb,+zicsr,+zifencei,{{(-[[:alnum:]-]+)(,-[[:alnum:]-]+)*}}"
 }
 // CHECK: attributes #5 = { 
{{.*}}"target-features"="+64bit,+m,+save-restore,{{(-[[:alnum:]-]+)(,-[[:alnum:]-]+)*}}"
 }
diff --git a/clang/test/Preprocessor/riscv-target-features.c 
b/clang/test/Preprocessor/riscv-target-features.c
index 39d2c66f14b23..30697af89c2eb 100644
--- a/clang/test/Preprocessor/riscv-target-features.c
+++ b/clang/test/Preprocessor/riscv-target-features.c
@@ -764,6 +764,14 @@
 // RUN: -o - | FileCheck --check-prefix=CHECK-ZICNTR-EXT %s
 // CHECK-ZICNTR-EXT: __riscv_zicntr 200{{$}}
 
+// RUN: %clang --target=riscv32 \
+// RUN: -march=rv32i_zicond1p0 -x c -E -dM %s \
+// RUN: -o - | FileCheck --check-prefix=CHECK-ZICOND-EXT %s
+// RUN: %clang --target=riscv64 \
+// RUN: -march=rv64i_zicond1p0 -x c -E -dM %s \
+// RUN: -o - | FileCheck --check-prefix=CHECK-ZICOND-EXT %s
+// CHECK-ZICOND-EXT: __riscv_zicond  100{{$}}
+
 // RUN: %clang --target=riscv32-unknown-linux-gnu \
 // RUN: -march=rv32izicsr2p0 -x c -E -dM %s \
 // RUN: -o - | FileCheck --check-prefix=CHECK-ZICSR-EXT %s
@@ -1332,14 +1340,6 @@
 // RUN: -o - | FileCheck --check-prefix=CHECK-ZICFILP-EXT %s
 // CHECK-ZICFILP-EXT: __riscv_zicfilp 4000{{$}}
 
-// RUN: %clang --target=riscv32 -menable-experimental-extensions \
-// RUN: -march=rv32i_zicond1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZICOND-EXT %s
-// RUN: %clang --target=riscv64 -menable-experimental-extensions \
-// RUN: -march=rv64i_zicond1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZICOND-EXT %s
-// CHECK-ZICOND-EXT: __riscv_zicond  100{{$}}
-
 // RUN: %clang --target=riscv32 -menable-experimental-extensions \
 // RUN: -march=rv32i_zimop0p1 -x c -E -dM %s \
 // RUN: -o - | FileCheck --check-prefix=CHECK-ZIMOP-EXT %s
diff --git a/llvm/docs/RISCVUsage.rst b/llvm/docs/RISCVUsage.rst
index 6fdc945ad

[llvm-branch-commits] [llvm] [clang] Backport [RISCV] Graduate Zicond to non-experimental (#79811) (PR #80018)

2024-01-30 Thread Alex Bradbury via llvm-branch-commits

asb wrote:

This patch came after the branch, but really it's cleaning up something we 
should have done a while ago once the extension was ratified at the end of last 
year.

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


[llvm-branch-commits] [llvm] [clang] Backport [RISCV] Graduate Zicond to non-experimental (#79811) (PR #80018)

2024-01-30 Thread via llvm-branch-commits

github-actions[bot] wrote:




:warning: C/C++ code formatter, clang-format found issues in your code. 
:warning:



You can test this locally with the following command:


``bash
git-clang-format --diff bab01aead7d7a34436bc8e1639b90227374f079e 
4add1cb7074c8f8a2c6295c59e45b470e1b62fc4 -- 
clang/test/CodeGen/RISCV/riscv-func-attr-target.c 
clang/test/Preprocessor/riscv-target-features.c 
llvm/lib/Support/RISCVISAInfo.cpp llvm/unittests/Support/RISCVISAInfoTest.cpp
``





View the diff from clang-format here.


``diff
diff --git a/llvm/lib/Support/RISCVISAInfo.cpp 
b/llvm/lib/Support/RISCVISAInfo.cpp
index db2e4ca92a..e9e568488f 100644
--- a/llvm/lib/Support/RISCVISAInfo.cpp
+++ b/llvm/lib/Support/RISCVISAInfo.cpp
@@ -198,15 +198,13 @@ static const RISCVSupportedExtension 
SupportedExperimentalExtensions[] = {
 
 {"zfbfmin", {1, 0}},
 
-{"zicfilp", {0, 4}},
-{"zicfiss", {0, 4}},
+{"zicfilp", {0, 4}},  {"zicfiss", {0, 4}},
 
 {"zimop", {0, 1}},
 
 {"ztso", {0, 1}},
 
-{"zvfbfmin", {1, 0}},
-{"zvfbfwma", {1, 0}},
+{"zvfbfmin", {1, 0}}, {"zvfbfwma", {1, 0}},
 };
 
 static void verifyTables() {

``




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


[llvm-branch-commits] [mlir] [flang] [mlir][flang][openmp] Rework wsloop reduction operations (PR #80019)

2024-01-30 Thread David Truby via llvm-branch-commits

DavidTruby wrote:

Note: I have marked this as a draft as I have not yet changed the SCF to OpenMP 
lowering, meaning that those tests fail.

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


[llvm-branch-commits] [clang] PR for llvm/llvm-project#79992 (PR #79997)

2024-01-30 Thread Gábor Horváth via llvm-branch-commits

https://github.com/Xazax-hun approved this pull request.


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


[llvm-branch-commits] [llvm] [lld] [clang] [docs] Add release notes for Windows specific changes in 18.x (PR #80011)

2024-01-30 Thread David Spickett via llvm-branch-commits


@@ -41,9 +41,25 @@ COFF Improvements
 * Added support for ``--time-trace`` and associated 
``--time-trace-granularity``.
   This generates a .json profile trace of the linker execution.
 
+* Prefer library paths specified with ``-libpath:`` over the implicitly

DavidSpickett wrote:

This should be clarified. Is this telling me the reader that I should use 
-libpath instead of letting it be implicit?

Seems like it's missing a noun like " now prefers ".

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


[llvm-branch-commits] [llvm] [lld] [clang] [docs] Add release notes for Windows specific changes in 18.x (PR #80011)

2024-01-30 Thread David Spickett via llvm-branch-commits


@@ -41,9 +41,25 @@ COFF Improvements
 * Added support for ``--time-trace`` and associated 
``--time-trace-granularity``.
   This generates a .json profile trace of the linker execution.
 
+* Prefer library paths specified with ``-libpath:`` over the implicitly
+  detected toolchain paths.
+
 MinGW Improvements
 --
 
+* Added support for many LTO and ThinLTO options.

DavidSpickett wrote:

Dare I ask what options. If it's < 10 maybe just list them?

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


[llvm-branch-commits] [lld] [clang] [llvm] [docs] Add release notes for Windows specific changes in 18.x (PR #80011)

2024-01-30 Thread David Spickett via llvm-branch-commits


@@ -41,9 +41,25 @@ COFF Improvements
 * Added support for ``--time-trace`` and associated 
``--time-trace-granularity``.
   This generates a .json profile trace of the linker execution.
 
+* Prefer library paths specified with ``-libpath:`` over the implicitly
+  detected toolchain paths.
+
 MinGW Improvements
 --
 
+* Added support for many LTO and ThinLTO options.
+
+* LLD no longer tries to autodetect and pick up MSVC/WinSDK installations

DavidSpickett wrote:

"autodetect and use" maybe? "pick up" can mean noticing something as well as 
literally picking it up and using it.

Also, does a user have to now opt into this detection or supply their own paths 
or is this not needed for Mingw mode now?

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


[llvm-branch-commits] [lld] [clang] [llvm] [docs] Add release notes for Windows specific changes in 18.x (PR #80011)

2024-01-30 Thread David Spickett via llvm-branch-commits


@@ -319,6 +319,18 @@ Changes to the LLVM tools
 * llvm-objcopy now supports ``--gap-fill`` and ``--pad-to`` options, for
   ELF input and binary output files only.
 
+* llvm-rc and llvm-windres now accept file path references in ``.rc`` files
+  concatenated from multiple string literals.
+
+* The llvm-windres option ``--preprocessor`` now resolve its argument
+  in the PATH environment variable as expected, and options passed with
+  ``--preprocessor-arg`` are placed before the input file as they should.

DavidSpickett wrote:

"now resolves"
"as they should be."

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


[llvm-branch-commits] [clang] [llvm] Backport [RISCV] Graduate Zicond to non-experimental (#79811) (PR #80018)

2024-01-30 Thread Alex Bradbury via llvm-branch-commits

asb wrote:

The proposed formatting change is undesired. `main` has this section of code 
bracketed by `// clang-format off` and on. It doesn't seem worth cherry-picking 
that too for this backport, but I can if wanted.

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


[llvm-branch-commits] [lld] [clang] [llvm] [docs] Add release notes for Windows specific changes in 18.x (PR #80011)

2024-01-30 Thread via llvm-branch-commits


@@ -359,6 +371,8 @@ Changes to LLDB
   fields are present, however this is not always possible or entirely
   accurate. If in doubt, refer to the numerical value.
 
+* On Windows, LLDB can now read the thread names.

oltolm wrote:

Yes, in the sense that if a thread has a name, it will display it.

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


[llvm-branch-commits] [mlir] 12a631b - Revert "[mlir][MLProgram] Add MLProgram to MemRef bufferization pass"

2024-01-30 Thread via llvm-branch-commits

Author: Mehdi Amini
Date: 2024-01-30T07:54:13-08:00
New Revision: 12a631b2df7ffcb172f259ad521d92cd6948513c

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

LOG: Revert "[mlir][MLProgram] Add MLProgram to MemRef bufferization pass"

Added: 


Modified: 
mlir/include/mlir/InitAllDialects.h
mlir/lib/Dialect/Bufferization/Transforms/Bufferize.cpp
mlir/lib/Dialect/Bufferization/Transforms/OneShotModuleBufferize.cpp
mlir/lib/Dialect/MLProgram/Transforms/CMakeLists.txt

Removed: 
mlir/include/mlir/Dialect/MLProgram/Transforms/BufferizableOpInterfaceImpl.h
mlir/lib/Dialect/MLProgram/Transforms/BufferizableOpInterfaceImpl.cpp
mlir/test/Dialect/MLProgram/one-shot-bufferize.mlir



diff  --git 
a/mlir/include/mlir/Dialect/MLProgram/Transforms/BufferizableOpInterfaceImpl.h 
b/mlir/include/mlir/Dialect/MLProgram/Transforms/BufferizableOpInterfaceImpl.h
deleted file mode 100644
index ca541238cf63b..0
--- 
a/mlir/include/mlir/Dialect/MLProgram/Transforms/BufferizableOpInterfaceImpl.h
+++ /dev/null
@@ -1,20 +0,0 @@
-//===- BufferizableOpInterfaceImpl.h - Impl. of BufferizableOpInterface 
---===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM 
Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===--===//
-
-#ifndef MLIR_DIALECT_MLPROGRAM_BUFFERIZABLEOPINTERFACEIMPL_H
-#define MLIR_DIALECT_MLPROGRAM_BUFFERIZABLEOPINTERFACEIMPL_H
-
-namespace mlir {
-class DialectRegistry;
-
-namespace ml_program {
-void registerBufferizableOpInterfaceExternalModels(DialectRegistry ®istry);
-} // namespace ml_program
-} // namespace mlir
-
-#endif // MLIR_DIALECT_MLPROGRAM_BUFFERIZABLEOPINTERFACEIMPL_H

diff  --git a/mlir/include/mlir/InitAllDialects.h 
b/mlir/include/mlir/InitAllDialects.h
index 0d21ecb4ebb44..19a62cadaa2e0 100644
--- a/mlir/include/mlir/InitAllDialects.h
+++ b/mlir/include/mlir/InitAllDialects.h
@@ -48,7 +48,6 @@
 #include "mlir/Dialect/Linalg/Transforms/SubsetInsertionOpInterfaceImpl.h"
 #include "mlir/Dialect/Linalg/Transforms/TilingInterfaceImpl.h"
 #include "mlir/Dialect/MLProgram/IR/MLProgram.h"
-#include "mlir/Dialect/MLProgram/Transforms/BufferizableOpInterfaceImpl.h"
 #include "mlir/Dialect/Math/IR/Math.h"
 #include "mlir/Dialect/MemRef/IR/MemRef.h"
 #include "mlir/Dialect/MemRef/IR/MemRefMemorySlot.h"
@@ -161,7 +160,6 @@ inline void registerAllDialects(DialectRegistry ®istry) {
   memref::registerRuntimeVerifiableOpInterfaceExternalModels(registry);
   memref::registerValueBoundsOpInterfaceExternalModels(registry);
   memref::registerMemorySlotExternalModels(registry);
-  ml_program::registerBufferizableOpInterfaceExternalModels(registry);
   scf::registerBufferDeallocationOpInterfaceExternalModels(registry);
   scf::registerBufferizableOpInterfaceExternalModels(registry);
   scf::registerValueBoundsOpInterfaceExternalModels(registry);

diff  --git a/mlir/lib/Dialect/Bufferization/Transforms/Bufferize.cpp 
b/mlir/lib/Dialect/Bufferization/Transforms/Bufferize.cpp
index dc94b72edcdf0..2758d554712b9 100644
--- a/mlir/lib/Dialect/Bufferization/Transforms/Bufferize.cpp
+++ b/mlir/lib/Dialect/Bufferization/Transforms/Bufferize.cpp
@@ -498,10 +498,6 @@ LogicalResult bufferization::bufferizeOp(Operation *op,
<< "\n//===---===//\n");
   }
 
-  // Return early if the top-level op is entirely gone.
-  if (erasedOps.contains(op))
-return success();
-
   // Fold all to_memref(to_tensor(x)) pairs.
   for (Operation *op : toMemrefOps) {
 rewriter.setInsertionPoint(op);

diff  --git 
a/mlir/lib/Dialect/Bufferization/Transforms/OneShotModuleBufferize.cpp 
b/mlir/lib/Dialect/Bufferization/Transforms/OneShotModuleBufferize.cpp
index 33feea0b956ca..aeda995fd585a 100644
--- a/mlir/lib/Dialect/Bufferization/Transforms/OneShotModuleBufferize.cpp
+++ b/mlir/lib/Dialect/Bufferization/Transforms/OneShotModuleBufferize.cpp
@@ -459,7 +459,7 @@ LogicalResult mlir::bufferization::bufferizeModuleOp(
   }
 
   // Bufferize all other ops.
-  for (Operation &op : llvm::make_early_inc_range(moduleOp.getOps())) {
+  for (Operation &op : moduleOp.getOps()) {
 // Functions were already bufferized.
 if (isa(&op))
   continue;

diff  --git 
a/mlir/lib/Dialect/MLProgram/Transforms/BufferizableOpInterfaceImpl.cpp 
b/mlir/lib/Dialect/MLProgram/Transforms/BufferizableOpInterfaceImpl.cpp
deleted file mode 100644
index 3ab17871ed907..0
--- a/mlir/lib/Dialect/MLProgram/Transforms/BufferizableOpInterfaceImpl.cpp
+++ /dev/null
@@ -1,159 +0,0 @@
-//===- BufferizableOpInterfaceImpl.cpp - Impl. of BufferizableOpInterface 
-===//
-//
-

[llvm-branch-commits] [llvm] PR for llvm/llvm-project#80024 (PR #80025)

2024-01-30 Thread via llvm-branch-commits

https://github.com/llvmbot created 
https://github.com/llvm/llvm-project/pull/80025

resolves llvm/llvm-project#80024

>From 7a6086b7de94dfb707bc0a1651f6bdcb9fa36f71 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20Gr=C3=A4nitz?= 
Date: Tue, 30 Jan 2024 17:00:28 +0100
Subject: [PATCH] [llvm-jitlink] Fix detectStubKind() for big endian systems
 (#79970)

This function is used in `jitlink-check` lines in LIT tests. In #78371 I
missed to swap initial instruction bytes for systems that store the
constants as big-endian.

(cherry picked from commit 8a5bdd899f3cb57024d92b96c16e805ca9924ac7)
---
 llvm/tools/llvm-jitlink/llvm-jitlink.cpp | 9 +
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/llvm/tools/llvm-jitlink/llvm-jitlink.cpp 
b/llvm/tools/llvm-jitlink/llvm-jitlink.cpp
index b2a133860197d..769ed17ac4cbd 100644
--- a/llvm/tools/llvm-jitlink/llvm-jitlink.cpp
+++ b/llvm/tools/llvm-jitlink/llvm-jitlink.cpp
@@ -1294,10 +1294,11 @@ class MemoryMatcher {
 };
 
 static StringRef detectStubKind(const Session::MemoryRegionInfo &Stub) {
-  constexpr uint32_t Armv7MovWTle = 0xe300c000;
-  constexpr uint32_t Armv7BxR12le = 0xe12fff1c;
-  constexpr uint32_t Thumbv7MovWTle = 0x0c00f240;
-  constexpr uint16_t Thumbv7BxR12le = 0x4760;
+  using namespace support::endian;
+  auto Armv7MovWTle = byte_swap(0xe300c000);
+  auto Armv7BxR12le = byte_swap(0xe12fff1c);
+  auto Thumbv7MovWTle = byte_swap(0x0c00f240);
+  auto Thumbv7BxR12le = byte_swap(0x4760);
 
   MemoryMatcher M(Stub.getContent());
   if (M.matchMask(Thumbv7MovWTle)) {

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


[llvm-branch-commits] [llvm] PR for llvm/llvm-project#80024 (PR #80025)

2024-01-30 Thread via llvm-branch-commits

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


[llvm-branch-commits] [llvm] PR for llvm/llvm-project#80024 (PR #80025)

2024-01-30 Thread via llvm-branch-commits

llvmbot wrote:

@maryammo What do you think about merging this PR to the release branch?

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


[llvm-branch-commits] [llvm] PR for llvm/llvm-project#80024 (PR #80025)

2024-01-30 Thread Maryam Moghadas via llvm-branch-commits

maryammo wrote:




> @maryammo What do you think about merging this PR to the release branch?

Yes, thanks.

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


[llvm-branch-commits] [llvm] PR for llvm/llvm-project#80024 (PR #80025)

2024-01-30 Thread Maryam Moghadas via llvm-branch-commits

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


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


[llvm-branch-commits] [llvm] PR for llvm/llvm-project#79860 (PR #79969)

2024-01-30 Thread Igor Kirillov via llvm-branch-commits

https://github.com/igogo-x86 approved this pull request.


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


[llvm-branch-commits] [flang] PR for llvm/llvm-project#80028 (PR #80031)

2024-01-30 Thread via llvm-branch-commits

llvmbot wrote:




@llvm/pr-subscribers-flang-semantics

Author: None (llvmbot)


Changes

resolves llvm/llvm-project#80028

---
Full diff: https://github.com/llvm/llvm-project/pull/80031.diff


3 Files Affected:

- (modified) flang/docs/Intrinsics.md (+7-7) 
- (modified) flang/lib/Evaluate/intrinsics.cpp (+14-7) 
- (added) flang/test/Semantics/execute_command_line.f90 (+29) 


``diff
diff --git a/flang/docs/Intrinsics.md b/flang/docs/Intrinsics.md
index 5ade257403297..5ad6d01e8a8ed 100644
--- a/flang/docs/Intrinsics.md
+++ b/flang/docs/Intrinsics.md
@@ -852,13 +852,13 @@ used in constant expressions have currently no folding 
support at all.
 - **Syntax:** `CALL EXECUTE_COMMAND_LINE(COMMAND [, WAIT, EXITSTAT, CMDSTAT, 
CMDMSG ])`
 - **Arguments:**
 
-  | Argument  | Description  |
-  |---|--|
-  | `COMMAND` | Shall be a default CHARACTER scalar. |
-  | `WAIT`| (Optional) Shall be a default LOGICAL scalar.|
-  | `EXITSTAT`| (Optional) Shall be an INTEGER of the default kind.  |
-  | `CMDSTAT` | (Optional) Shall be an INTEGER of the default kind.  |
-  | `CMDMSG`  | (Optional) Shall be a CHARACTER scalar of the default kind.  |
+| Argument   | Description 
  |
+||---|
+| `COMMAND`  | Shall be a default CHARACTER scalar.
  |
+| `WAIT` | (Optional) Shall be a default LOGICAL scalar.   
  |
+| `EXITSTAT` | (Optional) Shall be an INTEGER with kind greater than or equal 
to 4.  |
+| `CMDSTAT`  | (Optional) Shall be an INTEGER with kind greater than or equal 
to 2.  |
+| `CMDMSG`   | (Optional) Shall be a CHARACTER scalar of the default kind. 
  |
 
  Implementation Specifics
 
diff --git a/flang/lib/Evaluate/intrinsics.cpp 
b/flang/lib/Evaluate/intrinsics.cpp
index da6d597008988..1701a475942ff 100644
--- a/flang/lib/Evaluate/intrinsics.cpp
+++ b/flang/lib/Evaluate/intrinsics.cpp
@@ -78,6 +78,8 @@ static constexpr CategorySet AnyType{IntrinsicType | 
DerivedType};
 ENUM_CLASS(KindCode, none, defaultIntegerKind,
 defaultRealKind, // is also the default COMPLEX kind
 doublePrecision, defaultCharKind, defaultLogicalKind,
+greaterOrEqualToKind, // match kind value greater than or equal to a single
+  // explicit kind value
 any, // matches any kind value; each instance is independent
 // match any kind, but all "same" kinds must be equal. For characters, also
 // implies that lengths must be equal.
@@ -104,7 +106,7 @@ ENUM_CLASS(KindCode, none, defaultIntegerKind,
 struct TypePattern {
   CategorySet categorySet;
   KindCode kindCode{KindCode::none};
-  int exactKindValue{0}; // for KindCode::exactKind
+  int kindValue{0}; // for KindCode::exactKind and greaterOrEqualToKind
   llvm::raw_ostream &Dump(llvm::raw_ostream &) const;
 };
 
@@ -1314,10 +1316,11 @@ static const IntrinsicInterface intrinsicSubroutine[]{
 {"execute_command_line",
 {{"command", DefaultChar, Rank::scalar},
 {"wait", AnyLogical, Rank::scalar, Optionality::optional},
-{"exitstat", AnyInt, Rank::scalar, Optionality::optional,
-common::Intent::InOut},
-{"cmdstat", AnyInt, Rank::scalar, Optionality::optional,
-common::Intent::Out},
+{"exitstat",
+TypePattern{IntType, KindCode::greaterOrEqualToKind, 4},
+Rank::scalar, Optionality::optional, common::Intent::InOut},
+{"cmdstat", TypePattern{IntType, KindCode::greaterOrEqualToKind, 
2},
+Rank::scalar, Optionality::optional, common::Intent::Out},
 {"cmdmsg", DefaultChar, Rank::scalar, Optionality::optional,
 common::Intent::InOut}},
 {}, Rank::elemental, IntrinsicClass::impureSubroutine},
@@ -1834,7 +1837,10 @@ std::optional IntrinsicInterface::Match(
   argOk = true;
   break;
 case KindCode::exactKind:
-  argOk = type->kind() == d.typePattern.exactKindValue;
+  argOk = type->kind() == d.typePattern.kindValue;
+  break;
+case KindCode::greaterOrEqualToKind:
+  argOk = type->kind() >= d.typePattern.kindValue;
   break;
 case KindCode::sameAtom:
   if (!sameArg) {
@@ -2177,8 +2183,9 @@ std::optional IntrinsicInterface::Match(
   resultType = DynamicType{
   GetBuiltinDerivedType(builtinsScope, "__builtin_team_type")};
   break;
+case KindCode::greaterOrEqualToKind:
 case KindCode::exactKind:
-  resultType = DynamicType{*category, result.exactKindValue};
+  resultType = DynamicType{*category, result.kindValue};
   break;
 case KindCode::typeless:
 case KindCode::any:
diff --git a/flang/test/Semantics/execute

[llvm-branch-commits] [flang] PR for llvm/llvm-project#80028 (PR #80031)

2024-01-30 Thread Yi Wu via llvm-branch-commits

yi-wu-arm wrote:

> @yi-wu-arm What do you think about merging this PR to the release branch?

Yes, thanks. We need this fix for execut_command_line so it will follow the 
standard.

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


[llvm-branch-commits] [flang] PR for llvm/llvm-project#80028 (PR #80031)

2024-01-30 Thread Yi Wu via llvm-branch-commits

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


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


[llvm-branch-commits] [lld] [llvm] [clang] [docs] Add release notes for Windows specific changes in 18.x (PR #80011)

2024-01-30 Thread Martin Storsjö via llvm-branch-commits


@@ -41,9 +41,25 @@ COFF Improvements
 * Added support for ``--time-trace`` and associated 
``--time-trace-granularity``.
   This generates a .json profile trace of the linker execution.
 
+* Prefer library paths specified with ``-libpath:`` over the implicitly

mstorsjo wrote:

Thanks, will change so it says "LLD now prefers ...".

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


[llvm-branch-commits] [lld] [llvm] [clang] [docs] Add release notes for Windows specific changes in 18.x (PR #80011)

2024-01-30 Thread Martin Storsjö via llvm-branch-commits


@@ -41,9 +41,25 @@ COFF Improvements
 * Added support for ``--time-trace`` and associated 
``--time-trace-granularity``.
   This generates a .json profile trace of the linker execution.
 
+* Prefer library paths specified with ``-libpath:`` over the implicitly
+  detected toolchain paths.
+
 MinGW Improvements
 --
 
+* Added support for many LTO and ThinLTO options.

mstorsjo wrote:

It's a bunch, a bit over 20 options, if counting all the aliases - added in 
5c92c9f34a7dba804479acef62c576d1a170ef1f, 
0b51e648307cf6c21c463d3e73e51c03aaa8c9e2 and 
a08506e374f5938e30a9c13b61a697e8c0e12aa3.

The vague "many" in this case is mostly meant to be "every LTO option that the 
ELF driver supports, that also is supported in the COFF linker at the moment".

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


[llvm-branch-commits] [llvm] PR for llvm/llvm-project#80024 (PR #80025)

2024-01-30 Thread Stefan Gränitz via llvm-branch-commits

weliveindetail wrote:

Great, I think we can consider this done. IIRC the PR is waiting here for 
someone to merge it and then the ticket will be closed automatically.

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


[llvm-branch-commits] [clang] [llvm] [lld] [docs] Add release notes for Windows specific changes in 18.x (PR #80011)

2024-01-30 Thread Martin Storsjö via llvm-branch-commits


@@ -41,9 +41,25 @@ COFF Improvements
 * Added support for ``--time-trace`` and associated 
``--time-trace-granularity``.
   This generates a .json profile trace of the linker execution.
 
+* Prefer library paths specified with ``-libpath:`` over the implicitly
+  detected toolchain paths.
+
 MinGW Improvements
 --
 
+* Added support for many LTO and ThinLTO options.
+
+* LLD no longer tries to autodetect and pick up MSVC/WinSDK installations

mstorsjo wrote:

In mingw mode, one shouldn't use MSVC/WinSDK (headers/)libraries - there's 
really no use case for that.

The root cause is that in mingw mode, one always link by calling the compiler 
driver (just like for regular unix targets), which passes all the necessary 
search paths to the linker. In MSVC style environments, one usually invokes the 
linker directly (`link.exe` or `lld-link`), and it picks up a bunch of implicit 
search paths (from the environment variable `LIB`, and LLD can also look for 
MSVC installs in default paths and/or based on registry or other things, IIRC). 
When operating in mingw mode, those implicit default paths are only a potential 
source of unexpected behaviours and surprises, so there's no opt-in.

What about:
> LLD no longer tries to autodetect and use library paths from MSVC/WinSDK 
> installations when run in MinGW mode; that mode of operation shouldn't ever 
> be needed in MinGW mode, and could be a source of unexpected behaviours.


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


[llvm-branch-commits] [clang] [llvm] [lld] [docs] Add release notes for Windows specific changes in 18.x (PR #80011)

2024-01-30 Thread Martin Storsjö via llvm-branch-commits

https://github.com/mstorsjo updated 
https://github.com/llvm/llvm-project/pull/80011

From a09a391d4985d4adc1a5f500ba69b2f8f55aa47f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Martin=20Storsj=C3=B6?= 
Date: Tue, 30 Jan 2024 14:18:22 +0200
Subject: [PATCH 1/2] [docs] Add release notes for Windows specific changes in
 18.x

---
 clang/docs/ReleaseNotes.rst |  2 ++
 lld/docs/ReleaseNotes.rst   | 16 
 llvm/docs/ReleaseNotes.rst  | 14 ++
 3 files changed, 32 insertions(+)

diff --git a/clang/docs/ReleaseNotes.rst b/clang/docs/ReleaseNotes.rst
index 060bc7669b72a..c0833a4ee7a31 100644
--- a/clang/docs/ReleaseNotes.rst
+++ b/clang/docs/ReleaseNotes.rst
@@ -1195,6 +1195,8 @@ Windows Support
   linking may succeed but the resulting executables may expose issues at
   runtime.
 
+- Clang now passes relevant LTO options to the linker (LLD) in MinGW mode.
+
 LoongArch Support
 ^
 - Added builtins support for all LSX (128-bits SIMD) and LASX (256-bits SIMD)
diff --git a/lld/docs/ReleaseNotes.rst b/lld/docs/ReleaseNotes.rst
index 01669543cd50c..c896d2bd537a2 100644
--- a/lld/docs/ReleaseNotes.rst
+++ b/lld/docs/ReleaseNotes.rst
@@ -41,9 +41,25 @@ COFF Improvements
 * Added support for ``--time-trace`` and associated 
``--time-trace-granularity``.
   This generates a .json profile trace of the linker execution.
 
+* Prefer library paths specified with ``-libpath:`` over the implicitly
+  detected toolchain paths.
+
 MinGW Improvements
 --
 
+* Added support for many LTO and ThinLTO options.
+
+* LLD no longer tries to autodetect and pick up MSVC/WinSDK installations
+  when run in MinGW mode.
+
+* The ``--icf=safe`` option now works as expected; it was previously a no-op.
+
+* More correctly handle LTO of files that define ``__imp_`` prefixed dllimport
+  redirections.
+
+* The strip flags ``-S`` and ``-s`` now can be used to strip out DWARF debug
+  info and symbol tables while emitting a PDB debug info file.
+
 MachO Improvements
 --
 
diff --git a/llvm/docs/ReleaseNotes.rst b/llvm/docs/ReleaseNotes.rst
index 7b6a3f10d6377..c46c4a3f767f7 100644
--- a/llvm/docs/ReleaseNotes.rst
+++ b/llvm/docs/ReleaseNotes.rst
@@ -319,6 +319,18 @@ Changes to the LLVM tools
 * llvm-objcopy now supports ``--gap-fill`` and ``--pad-to`` options, for
   ELF input and binary output files only.
 
+* llvm-rc and llvm-windres now accept file path references in ``.rc`` files
+  concatenated from multiple string literals.
+
+* The llvm-windres option ``--preprocessor`` now resolve its argument
+  in the PATH environment variable as expected, and options passed with
+  ``--preprocessor-arg`` are placed before the input file as they should.
+
+* The llvm-windres option ``--preprocessor`` has been updated with the
+  breaking behaviour change from GNU windres from binutils 2.36, where
+  the whole argument is considered as one path, not considered as a
+  sequence of tool name and parameters.
+
 Changes to LLDB
 -
 
@@ -359,6 +371,8 @@ Changes to LLDB
   fields are present, however this is not always possible or entirely
   accurate. If in doubt, refer to the numerical value.
 
+* On Windows, LLDB can now read the thread names.
+
 Changes to Sanitizers
 -
 * HWASan now defaults to detecting use-after-scope bugs.

From 366716fe1814fbe37407913f8d5b0e0438773afb Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Martin=20Storsj=C3=B6?= 
Date: Tue, 30 Jan 2024 19:13:33 +0200
Subject: [PATCH 2/2] Apply review suggestions

---
 lld/docs/ReleaseNotes.rst  | 12 
 llvm/docs/ReleaseNotes.rst |  5 +++--
 2 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/lld/docs/ReleaseNotes.rst b/lld/docs/ReleaseNotes.rst
index c896d2bd537a2..3ff811d6d749f 100644
--- a/lld/docs/ReleaseNotes.rst
+++ b/lld/docs/ReleaseNotes.rst
@@ -41,16 +41,20 @@ COFF Improvements
 * Added support for ``--time-trace`` and associated 
``--time-trace-granularity``.
   This generates a .json profile trace of the linker execution.
 
-* Prefer library paths specified with ``-libpath:`` over the implicitly
+* LLD now prefers library paths specified with ``-libpath:`` over the 
implicitly
   detected toolchain paths.
 
 MinGW Improvements
 --
 
-* Added support for many LTO and ThinLTO options.
+* Added support for many LTO and ThinLTO options (most LTO options supported
+  by the ELF driver, that are implemented by the COFF backend as well,
+  should be supported now).
 
-* LLD no longer tries to autodetect and pick up MSVC/WinSDK installations
-  when run in MinGW mode.
+* LLD no longer tries to autodetect and use library paths from MSVC/WinSDK
+  installations when run in MinGW mode; that mode of operation shouldn't
+  ever be needed in MinGW mode, and could be a source of unexpected
+  behaviours.
 
 * The ``--icf=safe`` option now works as expected; it was previously a no-op.
 
diff --git a/llvm/docs/ReleaseNotes.rst b/llvm/docs/ReleaseNotes.

[llvm-branch-commits] [llvm] [BPF] expand cttz, ctlz for i32, i64 (PR #73668)

2024-01-30 Thread via llvm-branch-commits

eddyz87 wrote:

Nevermind, I missed the "depends" part :(
Will retest.

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


[llvm-branch-commits] [clang] [18.x][Docs] Add release note about Clang-defined target OS macros (PR #80044)

2024-01-30 Thread Zixu Wang via llvm-branch-commits

https://github.com/zixu-w created 
https://github.com/llvm/llvm-project/pull/80044

The change is included in the 18.x release. Move the release note to the 
release branch and reformat.

(cherry picked from commit b40d5b1b08564d23d5e0769892ebbc32447b2987)

>From f0f63d3276307f930ee94920e5f7f3228b05dd88 Mon Sep 17 00:00:00 2001
From: Zixu Wang <9819235+zix...@users.noreply.github.com>
Date: Tue, 30 Jan 2024 09:30:20 -0800
Subject: [PATCH] [Docs] Add release note about Clang-defined target OS macros
 (#79879)

(cherry picked from commit b40d5b1b08564d23d5e0769892ebbc32447b2987)
---
 clang/docs/ReleaseNotes.rst | 24 
 1 file changed, 24 insertions(+)

diff --git a/clang/docs/ReleaseNotes.rst b/clang/docs/ReleaseNotes.rst
index 060bc7669b72a..015578a6d688e 100644
--- a/clang/docs/ReleaseNotes.rst
+++ b/clang/docs/ReleaseNotes.rst
@@ -171,6 +171,22 @@ AST Dumping Potentially Breaking Changes
   "qualType": "foo"
 }
 
+Clang Frontend Potentially Breaking Changes
+---
+- Target OS macros extension
+  A new Clang extension (see :ref:`here `) is enabled for
+  Darwin (Apple platform) targets. Clang now defines ``TARGET_OS_*`` macros for
+  these targets, which could break existing code bases with improper checks for
+  the ``TARGET_OS_`` macros. For example, existing checks might fail to include
+  the ``TargetConditionals.h`` header from Apple SDKs and therefore leaving the
+  macros undefined and guarded code unexercised.
+
+  Affected code should be checked to see if it's still intended for the 
specific
+  target and fixed accordingly.
+
+  The extension can be turned off by the option 
``-fno-define-target-os-macros``
+  as a workaround.
+
 What's New in Clang |release|?
 ==
 Some of the major new features and improvements to Clang are listed
@@ -344,6 +360,14 @@ New Compiler Flags
   (like other functions) with respect to visibility attributes, pragmas and
   options (e.g ``--fvisibility=``).
 
+.. _target_os_detail:
+* ``-fdefine-target-os-macros`` and its complement
+  ``-fno-define-target-os-macros``. Enables or disables the Clang extension to
+  provide built-in definitions of a list of ``TARGET_OS_*`` macros based on the
+  target triple.
+
+  The extension is enabled by default for Darwin (Apple platform) targets.
+
 Deprecated Compiler Flags
 -
 

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


[llvm-branch-commits] [clang] [18.x][Docs] Add release note about Clang-defined target OS macros (PR #80044)

2024-01-30 Thread via llvm-branch-commits

llvmbot wrote:




@llvm/pr-subscribers-clang

Author: Zixu Wang (zixu-w)


Changes

The change is included in the 18.x release. Move the release note to the 
release branch and reformat.

(cherry picked from commit b40d5b1b08564d23d5e0769892ebbc32447b2987)

---
Full diff: https://github.com/llvm/llvm-project/pull/80044.diff


1 Files Affected:

- (modified) clang/docs/ReleaseNotes.rst (+24) 


``diff
diff --git a/clang/docs/ReleaseNotes.rst b/clang/docs/ReleaseNotes.rst
index 060bc7669b72a..015578a6d688e 100644
--- a/clang/docs/ReleaseNotes.rst
+++ b/clang/docs/ReleaseNotes.rst
@@ -171,6 +171,22 @@ AST Dumping Potentially Breaking Changes
   "qualType": "foo"
 }
 
+Clang Frontend Potentially Breaking Changes
+---
+- Target OS macros extension
+  A new Clang extension (see :ref:`here `) is enabled for
+  Darwin (Apple platform) targets. Clang now defines ``TARGET_OS_*`` macros for
+  these targets, which could break existing code bases with improper checks for
+  the ``TARGET_OS_`` macros. For example, existing checks might fail to include
+  the ``TargetConditionals.h`` header from Apple SDKs and therefore leaving the
+  macros undefined and guarded code unexercised.
+
+  Affected code should be checked to see if it's still intended for the 
specific
+  target and fixed accordingly.
+
+  The extension can be turned off by the option 
``-fno-define-target-os-macros``
+  as a workaround.
+
 What's New in Clang |release|?
 ==
 Some of the major new features and improvements to Clang are listed
@@ -344,6 +360,14 @@ New Compiler Flags
   (like other functions) with respect to visibility attributes, pragmas and
   options (e.g ``--fvisibility=``).
 
+.. _target_os_detail:
+* ``-fdefine-target-os-macros`` and its complement
+  ``-fno-define-target-os-macros``. Enables or disables the Clang extension to
+  provide built-in definitions of a list of ``TARGET_OS_*`` macros based on the
+  target triple.
+
+  The extension is enabled by default for Darwin (Apple platform) targets.
+
 Deprecated Compiler Flags
 -
 

``




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


[llvm-branch-commits] [clang] [18.x][Docs] Add release note about Clang-defined target OS macros (PR #80044)

2024-01-30 Thread Ian Anderson via llvm-branch-commits

https://github.com/ian-twilightcoder approved this pull request.


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


[llvm-branch-commits] [compiler-rt] PR for llvm/llvm-project#79283 (PR #80068)

2024-01-30 Thread via llvm-branch-commits

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


[llvm-branch-commits] [compiler-rt] PR for llvm/llvm-project#79283 (PR #80068)

2024-01-30 Thread via llvm-branch-commits

https://github.com/llvmbot created 
https://github.com/llvm/llvm-project/pull/80068

resolves llvm/llvm-project#79283

>From ebe024a11464ba70ada0c7297eb6d5d8cedc1085 Mon Sep 17 00:00:00 2001
From: Fangrui Song 
Date: Tue, 30 Jan 2024 13:58:40 -0800
Subject: [PATCH] [dfsan] Wrap glibc 2.38 __isoc23_* functions (#79958)

Fix #79283: `test/dfsan/custom.cpp` has undefined symbol linker errors
on glibc 2.38 due to lack of wrappers for `__isoc23_strtol` and
`__isoc23_scanf` family functions.

Implement these wrappers as aliases to existing wrappers, similar to
https://reviews.llvm.org/D158943 for other sanitizers.

`strtol` in a user program, whether or not `_ISOC2X_SOURCE` is defined,
uses the C23 semantics (`strtol("0b1", 0, 0)` => 1), when
`libclang_rt.dfsan.a` is built on glibc 2.38+.

(cherry picked from commit 648560062af8deb4e6478130deb1dd8fa62929a8)
---
 compiler-rt/lib/dfsan/dfsan_custom.cpp| 203 +-
 compiler-rt/lib/dfsan/done_abilist.txt|   6 +
 .../lib/dfsan/libc_ubuntu1404_abilist.txt |   5 +
 3 files changed, 59 insertions(+), 155 deletions(-)

diff --git a/compiler-rt/lib/dfsan/dfsan_custom.cpp 
b/compiler-rt/lib/dfsan/dfsan_custom.cpp
index 85b796bd6349c..3af26e9f64c92 100644
--- a/compiler-rt/lib/dfsan/dfsan_custom.cpp
+++ b/compiler-rt/lib/dfsan/dfsan_custom.cpp
@@ -55,6 +55,10 @@ using namespace __dfsan;
 #define DECLARE_WEAK_INTERCEPTOR_HOOK(f, ...) \
 SANITIZER_INTERFACE_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE void f(__VA_ARGS__);
 
+#define WRAPPER_ALIAS(fun, real)  \
+  SANITIZER_INTERFACE_ATTRIBUTE void __dfsw_##fun() ALIAS(__dfsw_##real); \
+  SANITIZER_INTERFACE_ATTRIBUTE void __dfso_##fun() ALIAS(__dfso_##real);
+
 // Async-safe, non-reentrant spin lock.
 class SignalSpinLocker {
  public:
@@ -1197,16 +1201,20 @@ char *__dfso_strcpy(char *dest, const char *src, 
dfsan_label dst_label,
   *ret_origin = dst_origin;
   return ret;
 }
+}
 
-static long int dfsan_strtol(const char *nptr, char **endptr, int base,
- char **tmp_endptr) {
+template 
+static ALWAYS_INLINE auto dfsan_strtol_impl(
+Fn real, const char *nptr, char **endptr, int base,
+char **tmp_endptr) -> decltype(real(nullptr, nullptr, 0)) {
   assert(tmp_endptr);
-  long int ret = strtol(nptr, tmp_endptr, base);
+  auto ret = real(nptr, tmp_endptr, base);
   if (endptr)
 *endptr = *tmp_endptr;
   return ret;
 }
 
+extern "C" {
 static void dfsan_strtolong_label(const char *nptr, const char *tmp_endptr,
   dfsan_label base_label,
   dfsan_label *ret_label) {
@@ -1236,30 +1244,6 @@ static void dfsan_strtolong_origin(const char *nptr, 
const char *tmp_endptr,
   }
 }
 
-SANITIZER_INTERFACE_ATTRIBUTE
-long int __dfsw_strtol(const char *nptr, char **endptr, int base,
-   dfsan_label nptr_label, dfsan_label endptr_label,
-   dfsan_label base_label, dfsan_label *ret_label) {
-  char *tmp_endptr;
-  long int ret = dfsan_strtol(nptr, endptr, base, &tmp_endptr);
-  dfsan_strtolong_label(nptr, tmp_endptr, base_label, ret_label);
-  return ret;
-}
-
-SANITIZER_INTERFACE_ATTRIBUTE
-long int __dfso_strtol(const char *nptr, char **endptr, int base,
-   dfsan_label nptr_label, dfsan_label endptr_label,
-   dfsan_label base_label, dfsan_label *ret_label,
-   dfsan_origin nptr_origin, dfsan_origin endptr_origin,
-   dfsan_origin base_origin, dfsan_origin *ret_origin) {
-  char *tmp_endptr;
-  long int ret = dfsan_strtol(nptr, endptr, base, &tmp_endptr);
-  dfsan_strtolong_label(nptr, tmp_endptr, base_label, ret_label);
-  dfsan_strtolong_origin(nptr, tmp_endptr, base_label, ret_label, base_origin,
- ret_origin);
-  return ret;
-}
-
 static double dfsan_strtod(const char *nptr, char **endptr, char **tmp_endptr) 
{
   assert(tmp_endptr);
   double ret = strtod(nptr, tmp_endptr);
@@ -1307,108 +1291,40 @@ double __dfso_strtod(const char *nptr, char **endptr, 
dfsan_label nptr_label,
   return ret;
 }
 
-static long long int dfsan_strtoll(const char *nptr, char **endptr, int base,
-   char **tmp_endptr) {
-  assert(tmp_endptr);
-  long long int ret = strtoll(nptr, tmp_endptr, base);
-  if (endptr)
-*endptr = *tmp_endptr;
-  return ret;
-}
-
-SANITIZER_INTERFACE_ATTRIBUTE
-long long int __dfsw_strtoll(const char *nptr, char **endptr, int base,
- dfsan_label nptr_label, dfsan_label endptr_label,
- dfsan_label base_label, dfsan_label *ret_label) {
-  char *tmp_endptr;
-  long long int ret = dfsan_strtoll(nptr, endptr, base, &tmp_endptr);
-  dfsan_strtolong_label(nptr, tmp_endptr, base_label, ret_label);
-  return ret;
-}
-
-SANITIZER_INTERFACE_ATTRIBUTE
-long long int __dfso_strtoll(const char *nptr, char **endptr, int base,
- 

[llvm-branch-commits] [compiler-rt] PR for llvm/llvm-project#79283 (PR #80068)

2024-01-30 Thread via llvm-branch-commits

llvmbot wrote:

@vitalybuka What do you think about merging this PR to the release branch?

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


[llvm-branch-commits] [compiler-rt] PR for llvm/llvm-project#79283 (PR #80068)

2024-01-30 Thread via llvm-branch-commits

llvmbot wrote:




@llvm/pr-subscribers-compiler-rt-sanitizer

Author: None (llvmbot)


Changes

resolves llvm/llvm-project#79283

---
Full diff: https://github.com/llvm/llvm-project/pull/80068.diff


3 Files Affected:

- (modified) compiler-rt/lib/dfsan/dfsan_custom.cpp (+48-155) 
- (modified) compiler-rt/lib/dfsan/done_abilist.txt (+6) 
- (modified) compiler-rt/lib/dfsan/libc_ubuntu1404_abilist.txt (+5) 


``diff
diff --git a/compiler-rt/lib/dfsan/dfsan_custom.cpp 
b/compiler-rt/lib/dfsan/dfsan_custom.cpp
index 85b796bd6349c..3af26e9f64c92 100644
--- a/compiler-rt/lib/dfsan/dfsan_custom.cpp
+++ b/compiler-rt/lib/dfsan/dfsan_custom.cpp
@@ -55,6 +55,10 @@ using namespace __dfsan;
 #define DECLARE_WEAK_INTERCEPTOR_HOOK(f, ...) \
 SANITIZER_INTERFACE_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE void f(__VA_ARGS__);
 
+#define WRAPPER_ALIAS(fun, real)  \
+  SANITIZER_INTERFACE_ATTRIBUTE void __dfsw_##fun() ALIAS(__dfsw_##real); \
+  SANITIZER_INTERFACE_ATTRIBUTE void __dfso_##fun() ALIAS(__dfso_##real);
+
 // Async-safe, non-reentrant spin lock.
 class SignalSpinLocker {
  public:
@@ -1197,16 +1201,20 @@ char *__dfso_strcpy(char *dest, const char *src, 
dfsan_label dst_label,
   *ret_origin = dst_origin;
   return ret;
 }
+}
 
-static long int dfsan_strtol(const char *nptr, char **endptr, int base,
- char **tmp_endptr) {
+template 
+static ALWAYS_INLINE auto dfsan_strtol_impl(
+Fn real, const char *nptr, char **endptr, int base,
+char **tmp_endptr) -> decltype(real(nullptr, nullptr, 0)) {
   assert(tmp_endptr);
-  long int ret = strtol(nptr, tmp_endptr, base);
+  auto ret = real(nptr, tmp_endptr, base);
   if (endptr)
 *endptr = *tmp_endptr;
   return ret;
 }
 
+extern "C" {
 static void dfsan_strtolong_label(const char *nptr, const char *tmp_endptr,
   dfsan_label base_label,
   dfsan_label *ret_label) {
@@ -1236,30 +1244,6 @@ static void dfsan_strtolong_origin(const char *nptr, 
const char *tmp_endptr,
   }
 }
 
-SANITIZER_INTERFACE_ATTRIBUTE
-long int __dfsw_strtol(const char *nptr, char **endptr, int base,
-   dfsan_label nptr_label, dfsan_label endptr_label,
-   dfsan_label base_label, dfsan_label *ret_label) {
-  char *tmp_endptr;
-  long int ret = dfsan_strtol(nptr, endptr, base, &tmp_endptr);
-  dfsan_strtolong_label(nptr, tmp_endptr, base_label, ret_label);
-  return ret;
-}
-
-SANITIZER_INTERFACE_ATTRIBUTE
-long int __dfso_strtol(const char *nptr, char **endptr, int base,
-   dfsan_label nptr_label, dfsan_label endptr_label,
-   dfsan_label base_label, dfsan_label *ret_label,
-   dfsan_origin nptr_origin, dfsan_origin endptr_origin,
-   dfsan_origin base_origin, dfsan_origin *ret_origin) {
-  char *tmp_endptr;
-  long int ret = dfsan_strtol(nptr, endptr, base, &tmp_endptr);
-  dfsan_strtolong_label(nptr, tmp_endptr, base_label, ret_label);
-  dfsan_strtolong_origin(nptr, tmp_endptr, base_label, ret_label, base_origin,
- ret_origin);
-  return ret;
-}
-
 static double dfsan_strtod(const char *nptr, char **endptr, char **tmp_endptr) 
{
   assert(tmp_endptr);
   double ret = strtod(nptr, tmp_endptr);
@@ -1307,108 +1291,40 @@ double __dfso_strtod(const char *nptr, char **endptr, 
dfsan_label nptr_label,
   return ret;
 }
 
-static long long int dfsan_strtoll(const char *nptr, char **endptr, int base,
-   char **tmp_endptr) {
-  assert(tmp_endptr);
-  long long int ret = strtoll(nptr, tmp_endptr, base);
-  if (endptr)
-*endptr = *tmp_endptr;
-  return ret;
-}
-
-SANITIZER_INTERFACE_ATTRIBUTE
-long long int __dfsw_strtoll(const char *nptr, char **endptr, int base,
- dfsan_label nptr_label, dfsan_label endptr_label,
- dfsan_label base_label, dfsan_label *ret_label) {
-  char *tmp_endptr;
-  long long int ret = dfsan_strtoll(nptr, endptr, base, &tmp_endptr);
-  dfsan_strtolong_label(nptr, tmp_endptr, base_label, ret_label);
-  return ret;
-}
-
-SANITIZER_INTERFACE_ATTRIBUTE
-long long int __dfso_strtoll(const char *nptr, char **endptr, int base,
- dfsan_label nptr_label, dfsan_label endptr_label,
- dfsan_label base_label, dfsan_label *ret_label,
- dfsan_origin nptr_origin,
- dfsan_origin endptr_origin,
- dfsan_origin base_origin,
- dfsan_origin *ret_origin) {
-  char *tmp_endptr;
-  long long int ret = dfsan_strtoll(nptr, endptr, base, &tmp_endptr);
-  dfsan_strtolong_label(nptr, tmp_endptr, base_label, ret_label);
-  dfsan_strtolong_origin(nptr, tmp_endptr, base_label, ret_label, base_origin,
- ret_origin);
-  return ret;
-}
-
-static unsigned lo

[llvm-branch-commits] [compiler-rt] PR for llvm/llvm-project#79283 (PR #80068)

2024-01-30 Thread via llvm-branch-commits

github-actions[bot] wrote:




:warning: C/C++ code formatter, clang-format found issues in your code. 
:warning:



You can test this locally with the following command:


``bash
git-clang-format --diff bab01aead7d7a34436bc8e1639b90227374f079e 
ebe024a11464ba70ada0c7297eb6d5d8cedc1085 -- 
compiler-rt/lib/dfsan/dfsan_custom.cpp
``





View the diff from clang-format here.


``diff
diff --git a/compiler-rt/lib/dfsan/dfsan_custom.cpp 
b/compiler-rt/lib/dfsan/dfsan_custom.cpp
index 3af26e9f64..14173b2b96 100644
--- a/compiler-rt/lib/dfsan/dfsan_custom.cpp
+++ b/compiler-rt/lib/dfsan/dfsan_custom.cpp
@@ -1204,9 +1204,10 @@ char *__dfso_strcpy(char *dest, const char *src, 
dfsan_label dst_label,
 }
 
 template 
-static ALWAYS_INLINE auto dfsan_strtol_impl(
-Fn real, const char *nptr, char **endptr, int base,
-char **tmp_endptr) -> decltype(real(nullptr, nullptr, 0)) {
+static ALWAYS_INLINE auto dfsan_strtol_impl(Fn real, const char *nptr,
+char **endptr, int base,
+char **tmp_endptr)
+-> decltype(real(nullptr, nullptr, 0)) {
   assert(tmp_endptr);
   auto ret = real(nptr, tmp_endptr, base);
   if (endptr)

``




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


[llvm-branch-commits] [clang] [18.x][Docs] Add release note about Clang-defined target OS macros (PR #80044)

2024-01-30 Thread Zixu Wang via llvm-branch-commits

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


[llvm-branch-commits] [flang] a2d4a4c - Apply kind code check on exitstat and cmdstat (#78286)

2024-01-30 Thread via llvm-branch-commits

Author: Yi Wu
Date: 2024-01-30T16:45:35Z
New Revision: a2d4a4c0b24ebb8b4194a2bb4e2a315bdbd0e90e

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

LOG: Apply kind code check on exitstat and cmdstat  (#78286)

When testing on gcc, both exitstat and cmdstat must be a kind=4 integer,
e.g. DefaultInt. This patch changes the input arg requirement from
`AnyInt` to `TypePattern{IntType, KindCode::greaterOrEqualToKind, n}`.

The standard stated in 16.9.73
- EXITSTAT (optional) shall be a scalar of type integer with a decimal
exponent range of at least nine.
- CMDSTAT (optional) shall be a scalar of type integer with a decimal
exponent range of at least four.

```fortran
program bug
  implicit none
  integer(kind = 2) :: exitstatvar
  integer(kind = 4) :: cmdstatvar
  character(len=256) :: msg
  character(len=:), allocatable :: command
  command='echo hello'
  call execute_command_line(command, exitstat=exitstatvar, cmdstat=cmdstatvar)
end program
```
When testing the above program with exitstatvar kind<4, an error would
occur:
```
$ ../build-release/bin/flang-new test.f90
error: Semantic errors in test.f90
./test.f90:8:47: error: Actual argument for 'exitstat=' has bad type or kind 
'INTEGER(2)'
call execute_command_line(command, exitstat=exitstatvar)
```

When testing the above program with exitstatvar kind<2, an error would
occur:
```
$ ../build-release/bin/flang-new test.f90
error: Semantic errors in test.f90
./test.f90:8:47: error: Actual argument for 'cmdstat=' has bad type or kind 
'INTEGER(1)'
call execute_command_line(command, cmdstat=cmdstatvar)
```

Test file for this semantics has been added to `flang/test/Semantic`
Fixes: https://github.com/llvm/llvm-project/issues/77990

(cherry picked from commit 14a15103cc9dbdb3e95c04627e0b96b5e3aa4944)

Added: 
flang/test/Semantics/execute_command_line.f90

Modified: 
flang/docs/Intrinsics.md
flang/lib/Evaluate/intrinsics.cpp

Removed: 




diff  --git a/flang/docs/Intrinsics.md b/flang/docs/Intrinsics.md
index 5ade257403297..5ad6d01e8a8ed 100644
--- a/flang/docs/Intrinsics.md
+++ b/flang/docs/Intrinsics.md
@@ -852,13 +852,13 @@ used in constant expressions have currently no folding 
support at all.
 - **Syntax:** `CALL EXECUTE_COMMAND_LINE(COMMAND [, WAIT, EXITSTAT, CMDSTAT, 
CMDMSG ])`
 - **Arguments:**
 
-  | Argument  | Description  |
-  |---|--|
-  | `COMMAND` | Shall be a default CHARACTER scalar. |
-  | `WAIT`| (Optional) Shall be a default LOGICAL scalar.|
-  | `EXITSTAT`| (Optional) Shall be an INTEGER of the default kind.  |
-  | `CMDSTAT` | (Optional) Shall be an INTEGER of the default kind.  |
-  | `CMDMSG`  | (Optional) Shall be a CHARACTER scalar of the default kind.  |
+| Argument   | Description 
  |
+||---|
+| `COMMAND`  | Shall be a default CHARACTER scalar.
  |
+| `WAIT` | (Optional) Shall be a default LOGICAL scalar.   
  |
+| `EXITSTAT` | (Optional) Shall be an INTEGER with kind greater than or equal 
to 4.  |
+| `CMDSTAT`  | (Optional) Shall be an INTEGER with kind greater than or equal 
to 2.  |
+| `CMDMSG`   | (Optional) Shall be a CHARACTER scalar of the default kind. 
  |
 
  Implementation Specifics
 

diff  --git a/flang/lib/Evaluate/intrinsics.cpp 
b/flang/lib/Evaluate/intrinsics.cpp
index da6d597008988..1701a475942ff 100644
--- a/flang/lib/Evaluate/intrinsics.cpp
+++ b/flang/lib/Evaluate/intrinsics.cpp
@@ -78,6 +78,8 @@ static constexpr CategorySet AnyType{IntrinsicType | 
DerivedType};
 ENUM_CLASS(KindCode, none, defaultIntegerKind,
 defaultRealKind, // is also the default COMPLEX kind
 doublePrecision, defaultCharKind, defaultLogicalKind,
+greaterOrEqualToKind, // match kind value greater than or equal to a single
+  // explicit kind value
 any, // matches any kind value; each instance is independent
 // match any kind, but all "same" kinds must be equal. For characters, also
 // implies that lengths must be equal.
@@ -104,7 +106,7 @@ ENUM_CLASS(KindCode, none, defaultIntegerKind,
 struct TypePattern {
   CategorySet categorySet;
   KindCode kindCode{KindCode::none};
-  int exactKindValue{0}; // for KindCode::exactKind
+  int kindValue{0}; // for KindCode::exactKind and greaterOrEqualToKind
   llvm::raw_ostream &Dump(llvm::raw_ostream &) const;
 };
 
@@ -1314,10 +1316,11 @@ static const IntrinsicInterface intrinsicSubroutine[]{
 {"execute_command_line",
 {{"comma

[llvm-branch-commits] [flang] PR for llvm/llvm-project#80028 (PR #80031)

2024-01-30 Thread Tom Stellard via llvm-branch-commits

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


[llvm-branch-commits] [clang] [flang] [llvm] Backport [RISCV] Graduate Zicond to non-experimental (#79811) (PR #80018)

2024-01-30 Thread Tom Stellard via llvm-branch-commits

https://github.com/tstellar updated 
https://github.com/llvm/llvm-project/pull/80018

>From 4add1cb7074c8f8a2c6295c59e45b470e1b62fc4 Mon Sep 17 00:00:00 2001
From: Alex Bradbury 
Date: Tue, 30 Jan 2024 14:21:21 +
Subject: [PATCH] [RISCV] Graduate Zicond to non-experimental (#79811)

The Zicond extension was ratified in the last few months, with no
changes that affect the LLVM implementation. Although there's surely
more tuning that could be done about when to select Zicond or not, there
are no known correctness issues. Therefore, we should mark support as
non-experimental.

(cherry-picked from commit d833b9d677c9dd0a35a211e2fdfada21ea9a464b)
---
 .../CodeGen/RISCV/riscv-func-attr-target.c|  2 +-
 .../test/Preprocessor/riscv-target-features.c | 16 +++---
 llvm/docs/RISCVUsage.rst  |  4 +-
 llvm/docs/ReleaseNotes.rst|  1 +
 llvm/lib/Support/RISCVISAInfo.cpp |  3 +-
 llvm/lib/Target/RISCV/RISCVFeatures.td|  2 +-
 llvm/lib/Target/RISCV/RISCVInstrInfoZicond.td |  2 -
 llvm/test/CodeGen/RISCV/attributes.ll |  4 +-
 llvm/test/CodeGen/RISCV/cmov-branch-opt.ll|  4 +-
 llvm/test/CodeGen/RISCV/condbinops.ll |  4 +-
 llvm/test/CodeGen/RISCV/condops.ll|  4 +-
 .../CodeGen/RISCV/select-binop-identity.ll|  4 +-
 llvm/test/CodeGen/RISCV/select.ll |  4 +-
 .../CodeGen/RISCV/short-forward-branch-opt.ll |  2 +-
 llvm/test/CodeGen/RISCV/xaluo.ll  |  4 +-
 llvm/test/MC/RISCV/rv32zicond-invalid.s   |  4 +-
 llvm/test/MC/RISCV/rv32zicond-valid.s | 12 ++---
 llvm/unittests/Support/RISCVISAInfoTest.cpp   | 52 +--
 18 files changed, 60 insertions(+), 68 deletions(-)

diff --git a/clang/test/CodeGen/RISCV/riscv-func-attr-target.c 
b/clang/test/CodeGen/RISCV/riscv-func-attr-target.c
index 7d3362e84e758..f216eaf735b4a 100644
--- a/clang/test/CodeGen/RISCV/riscv-func-attr-target.c
+++ b/clang/test/CodeGen/RISCV/riscv-func-attr-target.c
@@ -39,7 +39,7 @@ __attribute__((target("cpu=sifive-u54"))) void 
testAttrCpuOnly() {}
 // CHECK: attributes #0 = { 
{{.*}}"target-features"="+64bit,+a,+m,+save-restore,+zifencei,-relax,-zbb,-zfa" 
}
 // CHECK: attributes #1 = { {{.*}}"target-cpu"="rocket-rv64" 
"target-features"="+64bit,+a,+d,+f,+m,+save-restore,+v,+zicsr,+zifencei,+zve32f,+zve32x,+zve64d,+zve64f,+zve64x,+zvl128b,+zvl32b,+zvl64b,-relax,-zbb,-zfa"
 "tune-cpu"="generic-rv64" }
 // CHECK: attributes #2 = { 
{{.*}}"target-features"="+64bit,+a,+m,+save-restore,+zbb,+zifencei,-relax,-zfa" 
}
-// CHECK: attributes #3 = { 
{{.*}}"target-features"="+64bit,+a,+d,+experimental-zicond,+f,+m,+save-restore,+v,+zbb,+zicsr,+zifencei,+zve32f,+zve32x,+zve64d,+zve64f,+zve64x,+zvl128b,+zvl32b,+zvl64b,-relax,-zfa"
 }
+// CHECK: attributes #3 = { 
{{.*}}"target-features"="+64bit,+a,+d,+f,+m,+save-restore,+v,+zbb,+zicond,+zicsr,+zifencei,+zve32f,+zve32x,+zve64d,+zve64f,+zve64x,+zvl128b,+zvl32b,+zvl64b,-relax,-zfa"
 }
 // Make sure we append negative features if we override the arch
 // CHECK: attributes #4 = { 
{{.*}}"target-features"="+64bit,+a,+c,+d,+f,+m,+save-restore,+zbb,+zicsr,+zifencei,{{(-[[:alnum:]-]+)(,-[[:alnum:]-]+)*}}"
 }
 // CHECK: attributes #5 = { 
{{.*}}"target-features"="+64bit,+m,+save-restore,{{(-[[:alnum:]-]+)(,-[[:alnum:]-]+)*}}"
 }
diff --git a/clang/test/Preprocessor/riscv-target-features.c 
b/clang/test/Preprocessor/riscv-target-features.c
index 39d2c66f14b23..30697af89c2eb 100644
--- a/clang/test/Preprocessor/riscv-target-features.c
+++ b/clang/test/Preprocessor/riscv-target-features.c
@@ -764,6 +764,14 @@
 // RUN: -o - | FileCheck --check-prefix=CHECK-ZICNTR-EXT %s
 // CHECK-ZICNTR-EXT: __riscv_zicntr 200{{$}}
 
+// RUN: %clang --target=riscv32 \
+// RUN: -march=rv32i_zicond1p0 -x c -E -dM %s \
+// RUN: -o - | FileCheck --check-prefix=CHECK-ZICOND-EXT %s
+// RUN: %clang --target=riscv64 \
+// RUN: -march=rv64i_zicond1p0 -x c -E -dM %s \
+// RUN: -o - | FileCheck --check-prefix=CHECK-ZICOND-EXT %s
+// CHECK-ZICOND-EXT: __riscv_zicond  100{{$}}
+
 // RUN: %clang --target=riscv32-unknown-linux-gnu \
 // RUN: -march=rv32izicsr2p0 -x c -E -dM %s \
 // RUN: -o - | FileCheck --check-prefix=CHECK-ZICSR-EXT %s
@@ -1332,14 +1340,6 @@
 // RUN: -o - | FileCheck --check-prefix=CHECK-ZICFILP-EXT %s
 // CHECK-ZICFILP-EXT: __riscv_zicfilp 4000{{$}}
 
-// RUN: %clang --target=riscv32 -menable-experimental-extensions \
-// RUN: -march=rv32i_zicond1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZICOND-EXT %s
-// RUN: %clang --target=riscv64 -menable-experimental-extensions \
-// RUN: -march=rv64i_zicond1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZICOND-EXT %s
-// CHECK-ZICOND-EXT: __riscv_zicond  100{{$}}
-
 // RUN: %clang --target=riscv32 -menable-experimental-extensions \
 // RUN: -march=rv32i_zimop0p1 -x c -E -dM %s \
 // RUN: -o - | FileCheck --check-prefix=CHECK-ZIMOP-EXT %s
diff --git a/llvm/docs/RISCVUsage.rst b/llvm/docs/RISCVUsage.rs

[llvm-branch-commits] [clang] fe2fca3 - Backport [RISCV] Graduate Zicond to non-experimental (#79811) (#80018)

2024-01-30 Thread via llvm-branch-commits

Author: Alex Bradbury
Date: 2024-01-30T15:31:38-08:00
New Revision: fe2fca3b8ec29ed01eb8350e6358c06da3a705fc

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

LOG: Backport [RISCV] Graduate Zicond to non-experimental (#79811) (#80018)

The Zicond extension was ratified in the last few months, with no
changes that affect the LLVM implementation. Although there's surely
more tuning that could be done about when to select Zicond or not, there
are no known correctness issues. Therefore, we should mark support as
non-experimental.

(cherry-picked from commit d833b9d677c9dd0a35a211e2fdfada21ea9a464b)

Added: 


Modified: 
clang/test/CodeGen/RISCV/riscv-func-attr-target.c
clang/test/Preprocessor/riscv-target-features.c
llvm/docs/RISCVUsage.rst
llvm/docs/ReleaseNotes.rst
llvm/lib/Support/RISCVISAInfo.cpp
llvm/lib/Target/RISCV/RISCVFeatures.td
llvm/lib/Target/RISCV/RISCVInstrInfoZicond.td
llvm/test/CodeGen/RISCV/attributes.ll
llvm/test/CodeGen/RISCV/cmov-branch-opt.ll
llvm/test/CodeGen/RISCV/condbinops.ll
llvm/test/CodeGen/RISCV/condops.ll
llvm/test/CodeGen/RISCV/select-binop-identity.ll
llvm/test/CodeGen/RISCV/select.ll
llvm/test/CodeGen/RISCV/short-forward-branch-opt.ll
llvm/test/CodeGen/RISCV/xaluo.ll
llvm/test/MC/RISCV/rv32zicond-invalid.s
llvm/test/MC/RISCV/rv32zicond-valid.s
llvm/unittests/Support/RISCVISAInfoTest.cpp

Removed: 




diff  --git a/clang/test/CodeGen/RISCV/riscv-func-attr-target.c 
b/clang/test/CodeGen/RISCV/riscv-func-attr-target.c
index 7d3362e84e758..f216eaf735b4a 100644
--- a/clang/test/CodeGen/RISCV/riscv-func-attr-target.c
+++ b/clang/test/CodeGen/RISCV/riscv-func-attr-target.c
@@ -39,7 +39,7 @@ __attribute__((target("cpu=sifive-u54"))) void 
testAttrCpuOnly() {}
 // CHECK: attributes #0 = { 
{{.*}}"target-features"="+64bit,+a,+m,+save-restore,+zifencei,-relax,-zbb,-zfa" 
}
 // CHECK: attributes #1 = { {{.*}}"target-cpu"="rocket-rv64" 
"target-features"="+64bit,+a,+d,+f,+m,+save-restore,+v,+zicsr,+zifencei,+zve32f,+zve32x,+zve64d,+zve64f,+zve64x,+zvl128b,+zvl32b,+zvl64b,-relax,-zbb,-zfa"
 "tune-cpu"="generic-rv64" }
 // CHECK: attributes #2 = { 
{{.*}}"target-features"="+64bit,+a,+m,+save-restore,+zbb,+zifencei,-relax,-zfa" 
}
-// CHECK: attributes #3 = { 
{{.*}}"target-features"="+64bit,+a,+d,+experimental-zicond,+f,+m,+save-restore,+v,+zbb,+zicsr,+zifencei,+zve32f,+zve32x,+zve64d,+zve64f,+zve64x,+zvl128b,+zvl32b,+zvl64b,-relax,-zfa"
 }
+// CHECK: attributes #3 = { 
{{.*}}"target-features"="+64bit,+a,+d,+f,+m,+save-restore,+v,+zbb,+zicond,+zicsr,+zifencei,+zve32f,+zve32x,+zve64d,+zve64f,+zve64x,+zvl128b,+zvl32b,+zvl64b,-relax,-zfa"
 }
 // Make sure we append negative features if we override the arch
 // CHECK: attributes #4 = { 
{{.*}}"target-features"="+64bit,+a,+c,+d,+f,+m,+save-restore,+zbb,+zicsr,+zifencei,{{(-[[:alnum:]-]+)(,-[[:alnum:]-]+)*}}"
 }
 // CHECK: attributes #5 = { 
{{.*}}"target-features"="+64bit,+m,+save-restore,{{(-[[:alnum:]-]+)(,-[[:alnum:]-]+)*}}"
 }

diff  --git a/clang/test/Preprocessor/riscv-target-features.c 
b/clang/test/Preprocessor/riscv-target-features.c
index 39d2c66f14b23..30697af89c2eb 100644
--- a/clang/test/Preprocessor/riscv-target-features.c
+++ b/clang/test/Preprocessor/riscv-target-features.c
@@ -764,6 +764,14 @@
 // RUN: -o - | FileCheck --check-prefix=CHECK-ZICNTR-EXT %s
 // CHECK-ZICNTR-EXT: __riscv_zicntr 200{{$}}
 
+// RUN: %clang --target=riscv32 \
+// RUN: -march=rv32i_zicond1p0 -x c -E -dM %s \
+// RUN: -o - | FileCheck --check-prefix=CHECK-ZICOND-EXT %s
+// RUN: %clang --target=riscv64 \
+// RUN: -march=rv64i_zicond1p0 -x c -E -dM %s \
+// RUN: -o - | FileCheck --check-prefix=CHECK-ZICOND-EXT %s
+// CHECK-ZICOND-EXT: __riscv_zicond  100{{$}}
+
 // RUN: %clang --target=riscv32-unknown-linux-gnu \
 // RUN: -march=rv32izicsr2p0 -x c -E -dM %s \
 // RUN: -o - | FileCheck --check-prefix=CHECK-ZICSR-EXT %s
@@ -1332,14 +1340,6 @@
 // RUN: -o - | FileCheck --check-prefix=CHECK-ZICFILP-EXT %s
 // CHECK-ZICFILP-EXT: __riscv_zicfilp 4000{{$}}
 
-// RUN: %clang --target=riscv32 -menable-experimental-extensions \
-// RUN: -march=rv32i_zicond1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZICOND-EXT %s
-// RUN: %clang --target=riscv64 -menable-experimental-extensions \
-// RUN: -march=rv64i_zicond1p0 -x c -E -dM %s \
-// RUN: -o - | FileCheck --check-prefix=CHECK-ZICOND-EXT %s
-// CHECK-ZICOND-EXT: __riscv_zicond  100{{$}}
-
 // RUN: %clang --target=riscv32 -menable-experimental-extensions \
 // RUN: -march=rv32i_zimop0p1 -x c -E -dM %s \
 // RUN: -o - | FileCheck --check-prefix=CHECK-ZIMOP-EXT %s

diff  --git a/llvm/docs/RISCVUsage.rst b/llvm/docs/RISCVUsage.rst
index 6fdc945ad2707..ba292ea39c8a8 100644
--- a/llvm/docs/RISCVUs

[llvm-branch-commits] [clang] [flang] [llvm] Backport [RISCV] Graduate Zicond to non-experimental (#79811) (PR #80018)

2024-01-30 Thread Tom Stellard via llvm-branch-commits

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


[llvm-branch-commits] [llvm] [RISCV] Backport 5cf9f2cd9888feea23a624c1de3cc37ce8ce8112 to release/18.x (PR #79931)

2024-01-30 Thread Tom Stellard via llvm-branch-commits

tstellar wrote:

@topperc @preames OK with this backport?

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


[llvm-branch-commits] [llvm] [RISCV] Backport 5cf9f2cd9888feea23a624c1de3cc37ce8ce8112 to release/18.x (PR #79931)

2024-01-30 Thread Craig Topper via llvm-branch-commits

topperc wrote:

@tstellar Backport looks good to me.

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


[llvm-branch-commits] [compiler-rt] PR for llvm/llvm-project#79838 (PR #79841)

2024-01-30 Thread via llvm-branch-commits

https://github.com/llvmbot updated 
https://github.com/llvm/llvm-project/pull/79841

>From 400a02bb281ba0de79211ab53d931e44dd76733f Mon Sep 17 00:00:00 2001
From: Sam James 
Date: Wed, 24 Jan 2024 08:23:03 +
Subject: [PATCH] [sanitizer] Handle Gentoo's libstdc++ path

On Gentoo, libc++ is indeed in /usr/include/c++/*, but libstdc++ is at
e.g. /usr/lib/gcc/x86_64-pc-linux-gnu/14/include/g++-v14.

Use '/include/g++' as it should be unique enough. Note that the omission of
a trailing slash is intentional to match g++-*.

See https://github.com/llvm/llvm-project/pull/78534#issuecomment-1904145839.

Reviewed by: mgorny
Closes: https://github.com/llvm/llvm-project/pull/79264

Signed-off-by: Sam James 
(cherry picked from commit e8f882f83acf30d9b4da8846bd26314139660430)
---
 .../lib/sanitizer_common/sanitizer_symbolizer_report.cpp  | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_report.cpp 
b/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_report.cpp
index 8438e019591b5..f6b157c07c655 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_report.cpp
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_report.cpp
@@ -34,8 +34,10 @@ static bool FrameIsInternal(const SymbolizedStack *frame) {
 return true;
   const char *file = frame->info.file;
   const char *module = frame->info.module;
+  // On Gentoo, the path is g++-*, so there's *not* a missing /.
   if (file && (internal_strstr(file, "/compiler-rt/lib/") ||
-   internal_strstr(file, "/include/c++/")))
+   internal_strstr(file, "/include/c++/") ||
+   internal_strstr(file, "/include/g++")))
 return true;
   if (module && (internal_strstr(module, "libclang_rt.")))
 return true;

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


[llvm-branch-commits] [compiler-rt] 400a02b - [sanitizer] Handle Gentoo's libstdc++ path

2024-01-30 Thread Tom Stellard via llvm-branch-commits

Author: Sam James
Date: 2024-01-30T15:47:38-08:00
New Revision: 400a02bb281ba0de79211ab53d931e44dd76733f

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

LOG: [sanitizer] Handle Gentoo's libstdc++ path

On Gentoo, libc++ is indeed in /usr/include/c++/*, but libstdc++ is at
e.g. /usr/lib/gcc/x86_64-pc-linux-gnu/14/include/g++-v14.

Use '/include/g++' as it should be unique enough. Note that the omission of
a trailing slash is intentional to match g++-*.

See https://github.com/llvm/llvm-project/pull/78534#issuecomment-1904145839.

Reviewed by: mgorny
Closes: https://github.com/llvm/llvm-project/pull/79264

Signed-off-by: Sam James 
(cherry picked from commit e8f882f83acf30d9b4da8846bd26314139660430)

Added: 


Modified: 
compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_report.cpp

Removed: 




diff  --git a/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_report.cpp 
b/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_report.cpp
index 8438e019591b5..f6b157c07c655 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_report.cpp
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_report.cpp
@@ -34,8 +34,10 @@ static bool FrameIsInternal(const SymbolizedStack *frame) {
 return true;
   const char *file = frame->info.file;
   const char *module = frame->info.module;
+  // On Gentoo, the path is g++-*, so there's *not* a missing /.
   if (file && (internal_strstr(file, "/compiler-rt/lib/") ||
-   internal_strstr(file, "/include/c++/")))
+   internal_strstr(file, "/include/c++/") ||
+   internal_strstr(file, "/include/g++")))
 return true;
   if (module && (internal_strstr(module, "libclang_rt.")))
 return true;



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


[llvm-branch-commits] [compiler-rt] PR for llvm/llvm-project#79838 (PR #79841)

2024-01-30 Thread Tom Stellard via llvm-branch-commits

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


[llvm-branch-commits] [clang-tools-extra] [clang] Backport '[clang] static operators should evaluate object argument (reland)' to release/18.x (PR #80109)

2024-01-30 Thread via llvm-branch-commits

llvmbot wrote:



@llvm/pr-subscribers-clang-codegen

@llvm/pr-subscribers-clang

Author: Tianlan Zhou (SuperSodaSea)


Changes

Cherry picked from commit ee01a2c3996f9647f3158f5acdb921a6ede94dc1.

Closes #80041.

---
Full diff: https://github.com/llvm/llvm-project/pull/80109.diff


10 Files Affected:

- (modified) clang-tools-extra/clangd/InlayHints.cpp (+1-5) 
- (modified) clang/docs/ReleaseNotes.rst (+3) 
- (modified) clang/lib/AST/ExprConstant.cpp (+7-2) 
- (modified) clang/lib/CodeGen/CGExpr.cpp (+15-2) 
- (modified) clang/lib/Sema/SemaChecking.cpp (+2-3) 
- (modified) clang/lib/Sema/SemaOverload.cpp (+18-26) 
- (added) clang/test/AST/ast-dump-static-operators.cpp (+55) 
- (modified) clang/test/CodeGenCXX/cxx2b-static-call-operator.cpp (+19-7) 
- (modified) clang/test/CodeGenCXX/cxx2b-static-subscript-operator.cpp (+9-2) 
- (added) clang/test/SemaCXX/cxx2b-static-operator.cpp (+31) 


``diff
diff --git a/clang-tools-extra/clangd/InlayHints.cpp 
b/clang-tools-extra/clangd/InlayHints.cpp
index 5722ca8f66eb7..5f3687ac58101 100644
--- a/clang-tools-extra/clangd/InlayHints.cpp
+++ b/clang-tools-extra/clangd/InlayHints.cpp
@@ -651,16 +651,12 @@ class InlayHintVisitor : public 
RecursiveASTVisitor {
 // implied object argument ([over.call.func]), the list of provided
 // arguments is preceded by the implied object argument for the purposes of
 // this correspondence...
-//
-// However, we don't have the implied object argument
-// for static operator() per clang::Sema::BuildCallToObjectOfClassType.
 llvm::ArrayRef Args = {E->getArgs(), E->getNumArgs()};
 // We don't have the implied object argument through a function pointer
 // either.
 if (const CXXMethodDecl *Method =
 dyn_cast_or_null(Callee.Decl))
-  if (Method->isInstance() &&
-  (IsFunctor || Method->hasCXXExplicitFunctionObjectParameter()))
+  if (IsFunctor || Method->hasCXXExplicitFunctionObjectParameter())
 Args = Args.drop_front(1);
 processCall(Callee, Args);
 return true;
diff --git a/clang/docs/ReleaseNotes.rst b/clang/docs/ReleaseNotes.rst
index 060bc7669b72a..96fe789452a37 100644
--- a/clang/docs/ReleaseNotes.rst
+++ b/clang/docs/ReleaseNotes.rst
@@ -1054,6 +1054,9 @@ Bug Fixes to C++ Support
   Fixes (`#78830 `_)
   Fixes (`#60085 `_)
 
+- Fix incorrect code generation caused by the object argument of ``static 
operator()`` and ``static operator[]`` calls not being evaluated.
+  Fixes (`#67976 `_)
+
 Bug Fixes to AST Handling
 ^
 - Fixed an import failure of recursive friend class template.
diff --git a/clang/lib/AST/ExprConstant.cpp b/clang/lib/AST/ExprConstant.cpp
index f1d07d022b258..edf9b5e2d52bb 100644
--- a/clang/lib/AST/ExprConstant.cpp
+++ b/clang/lib/AST/ExprConstant.cpp
@@ -7951,7 +7951,8 @@ class ExprEvaluatorBase
   // Overloaded operator calls to member functions are represented as 
normal
   // calls with '*this' as the first argument.
   const CXXMethodDecl *MD = dyn_cast(FD);
-  if (MD && MD->isImplicitObjectMemberFunction()) {
+  if (MD &&
+  (MD->isImplicitObjectMemberFunction() || (OCE && MD->isStatic( {
 // FIXME: When selecting an implicit conversion for an overloaded
 // operator delete, we sometimes try to evaluate calls to conversion
 // operators without a 'this' parameter!
@@ -7960,7 +7961,11 @@ class ExprEvaluatorBase
 
 if (!EvaluateObjectArgument(Info, Args[0], ThisVal))
   return false;
-This = &ThisVal;
+
+// If we are calling a static operator, the 'this' argument needs to be
+// ignored after being evaluated.
+if (MD->isInstance())
+  This = &ThisVal;
 
 // If this is syntactically a simple assignment using a trivial
 // assignment operator, start the lifetimes of union members as needed,
diff --git a/clang/lib/CodeGen/CGExpr.cpp b/clang/lib/CodeGen/CGExpr.cpp
index c5f6b6d3a99f0..f8f9979099775 100644
--- a/clang/lib/CodeGen/CGExpr.cpp
+++ b/clang/lib/CodeGen/CGExpr.cpp
@@ -5846,6 +5846,7 @@ RValue CodeGenFunction::EmitCall(QualType CalleeType, 
const CGCallee &OrigCallee
   // destruction order is not necessarily reverse construction order.
   // FIXME: Revisit this based on C++ committee response to unimplementability.
   EvaluationOrder Order = EvaluationOrder::Default;
+  bool StaticOperator = false;
   if (auto *OCE = dyn_cast(E)) {
 if (OCE->isAssignmentOp())
   Order = EvaluationOrder::ForceRightToLeft;
@@ -5863,10 +5864,22 @@ RValue CodeGenFunction::EmitCall(QualType CalleeType, 
const CGCallee &OrigCallee
 break;
   }
 }
+
+if (const auto *MD =
+dyn_cast_if_present(OCE->getCalleeDecl());
+MD && MD->isStatic())
+  StaticOperator = true;
   }
 
-  EmitCallArgs(