[llvm-branch-commits] [clang] 99c0f85 - Re-commit: Driver: Don't warn on -mbranch-protection when linking

2022-04-01 Thread Tom Stellard via llvm-branch-commits

Author: Tom Stellard
Date: 2022-04-01T20:09:54-07:00
New Revision: 99c0f85ef992e9aa6465f27a8b05601667412bc7

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

LOG: Re-commit: Driver: Don't warn on -mbranch-protection when linking

This is a re-commit of 98fd3b359866f474ab1c097c22fb5c3be356b996.  The
newly added test was failing on the bots, and I've fixed the test now so
that it doesn't actually invoke the linker.

(cherry picked from commit fed96f31bb5b68f77dd617ee8e698dd8171ee71b)

Added: 


Modified: 
clang/include/clang/Driver/Options.td
clang/test/Driver/aarch64-security-options.c

Removed: 




diff  --git a/clang/include/clang/Driver/Options.td 
b/clang/include/clang/Driver/Options.td
index 53e68ed2cef90..602586f94603f 100644
--- a/clang/include/clang/Driver/Options.td
+++ b/clang/include/clang/Driver/Options.td
@@ -3400,6 +3400,7 @@ def msign_return_address_EQ : Joined<["-"], 
"msign-return-address=">,
   Flags<[CC1Option]>, Group, Values<"none,all,non-leaf">,
   HelpText<"Select return address signing scope">;
 def mbranch_protection_EQ : Joined<["-"], "mbranch-protection=">,
+  Group,
   HelpText<"Enforce targets of indirect branches and function returns">;
 
 def mharden_sls_EQ : Joined<["-"], "mharden-sls=">,

diff  --git a/clang/test/Driver/aarch64-security-options.c 
b/clang/test/Driver/aarch64-security-options.c
index 6ea4b8ae58385..4bd73e06d255a 100644
--- a/clang/test/Driver/aarch64-security-options.c
+++ b/clang/test/Driver/aarch64-security-options.c
@@ -27,6 +27,9 @@
 // RUN: %clang -target aarch64--none-eabi -c %s -### -mbranch-protection=bar   
  2>&1 | \
 // RUN: FileCheck %s --check-prefix=BAD-BP-PROTECTION --check-prefix=WARN
 
+// RUN: %clang -target aarch64--none-eabi -### -o /dev/null 
-mbranch-protection=standard /dev/null 2>&1 | \
+// RUN: FileCheck --allow-empty %s --check-prefix=LINKER-DRIVER
+
 // WARN-NOT: warning: ignoring '-mbranch-protection=' option because the 
'aarch64' architecture does not support it [-Wbranch-protection]
 
 // RA-OFF: "-msign-return-address=none"
@@ -46,3 +49,7 @@
 
 // BAD-B-KEY-COMBINATION: invalid branch protection option 'b-key' in 
'-mbranch-protection={{.*}}'
 // BAD-LEAF-COMBINATION: invalid branch protection option 'leaf' in 
'-mbranch-protection={{.*}}'
+
+// Check that the linker driver doesn't warn about -mbranch-protection=standard
+// as an unused option.
+// LINKER-DRIVER-NOT: warning:



___
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [llvm] fe5c24e - [docs] Fix typo in tutorial

2022-04-01 Thread Tom Stellard via llvm-branch-commits

Author: Bill Wendling
Date: 2022-04-01T20:20:06-07:00
New Revision: fe5c24e937548f97f24ec864b1c420e1cca0c110

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

LOG: [docs] Fix typo in tutorial

Use "operands" instead of "operators"

Closes #54397

(cherry picked from commit 114a8903b86929f621c6b00f15e549931d912737)

Added: 


Modified: 
llvm/docs/tutorial/MyFirstLanguageFrontend/LangImpl03.rst

Removed: 




diff  --git a/llvm/docs/tutorial/MyFirstLanguageFrontend/LangImpl03.rst 
b/llvm/docs/tutorial/MyFirstLanguageFrontend/LangImpl03.rst
index 7170b0fb25de0..fb23f9fe3f18b 100644
--- a/llvm/docs/tutorial/MyFirstLanguageFrontend/LangImpl03.rst
+++ b/llvm/docs/tutorial/MyFirstLanguageFrontend/LangImpl03.rst
@@ -197,7 +197,7 @@ suffix. Local value names for instructions are purely 
optional, but it
 makes it much easier to read the IR dumps.
 
 `LLVM instructions <../../LangRef.html#instruction-reference>`_ are 
constrained by strict
-rules: for example, the Left and Right operators of an `add
+rules: for example, the Left and Right operands of an `add
 instruction <../../LangRef.html#add-instruction>`_ must have the same type, 
and the
 result type of the add must match the operand types. Because all values
 in Kaleidoscope are doubles, this makes for very simple code for add,



___
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [clang] f3b8972 - [Driver][OpenBSD] Disable unwind tables on Arm

2022-04-01 Thread Tom Stellard via llvm-branch-commits

Author: Brad Smith
Date: 2022-04-01T21:46:01-07:00
New Revision: f3b89727716a99a48b61a0c94025e35d363ececc

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

LOG: [Driver][OpenBSD] Disable unwind tables on Arm

Arm is not quite ready for unwinding yet.

(cherry picked from commit 9abeb80e80d0f2e9dd7603491d33fa0683a33ac1)

Added: 


Modified: 
clang/lib/Driver/ToolChains/OpenBSD.cpp
clang/lib/Driver/ToolChains/OpenBSD.h
clang/test/Driver/openbsd.c

Removed: 




diff  --git a/clang/lib/Driver/ToolChains/OpenBSD.cpp 
b/clang/lib/Driver/ToolChains/OpenBSD.cpp
index bcd54bedfa897..86a10ce4b0e75 100644
--- a/clang/lib/Driver/ToolChains/OpenBSD.cpp
+++ b/clang/lib/Driver/ToolChains/OpenBSD.cpp
@@ -342,3 +342,12 @@ Tool *OpenBSD::buildAssembler() const {
 Tool *OpenBSD::buildLinker() const { return new tools::openbsd::Linker(*this); 
}
 
 bool OpenBSD::HasNativeLLVMSupport() const { return true; }
+
+bool OpenBSD::IsUnwindTablesDefault(const ArgList &Args) const {
+switch (getArch()) {
+  case llvm::Triple::arm:
+return false;
+  default:
+return true;
+}
+}

diff  --git a/clang/lib/Driver/ToolChains/OpenBSD.h 
b/clang/lib/Driver/ToolChains/OpenBSD.h
index 9d668711b91b3..2d4c4e34520b7 100644
--- a/clang/lib/Driver/ToolChains/OpenBSD.h
+++ b/clang/lib/Driver/ToolChains/OpenBSD.h
@@ -82,9 +82,7 @@ class LLVM_LIBRARY_VISIBILITY OpenBSD : public Generic_ELF {
   std::string getCompilerRT(const llvm::opt::ArgList &Args, StringRef 
Component,
 FileType Type = ToolChain::FT_Static) const 
override;
 
-  bool IsUnwindTablesDefault(const llvm::opt::ArgList &Args) const override {
-return true;
-  }
+  bool IsUnwindTablesDefault(const llvm::opt::ArgList &Args) const override;
 
   LangOptions::StackProtectorMode
   GetDefaultStackProtectorLevel(bool KernelOrKext) const override {

diff  --git a/clang/test/Driver/openbsd.c b/clang/test/Driver/openbsd.c
index e46de575aec09..8d91ce0e53e53 100644
--- a/clang/test/Driver/openbsd.c
+++ b/clang/test/Driver/openbsd.c
@@ -124,7 +124,8 @@
 
 // Check that unwind tables are enabled
 // RUN: %clang -target arm-unknown-openbsd -### -S %s 2>&1 | \
-// RUN: FileCheck -check-prefix=UNWIND-TABLES %s
+// RUN: FileCheck -check-prefix=NO-UNWIND-TABLES %s
 // RUN: %clang -target mips64-unknown-openbsd -### -S %s 2>&1 | \
 // RUN: FileCheck -check-prefix=UNWIND-TABLES %s
 // UNWIND-TABLES: "-funwind-tables=2"
+// NO-UNWIND-TABLES-NOT: "-funwind-tables=2"



___
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [clang] 63e7af7 - [Clang][NeonEmitter] emit ret decl first for -Wdeclaration-after-statement

2022-04-01 Thread Tom Stellard via llvm-branch-commits

Author: Nick Desaulniers
Date: 2022-04-01T21:50:44-07:00
New Revision: 63e7af77ec42de9ac0b2fca6f7876b6b67c40050

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

LOG: [Clang][NeonEmitter] emit ret decl first for -Wdeclaration-after-statement

The generated arm_neon.h header isn't -Wdeclaration-after-statement
compliant when targeting -mbig-endian. Update the generator to declare
the return value, if any, first before any other arguments that might
need to be "reversed" from little endian to big.

Another approach would have been to try to ignore this warning in system
headers, though that might not be precise for tokens involved in macro
expansion. See also: https://reviews.llvm.org/D116833#3236209.

Link: https://github.com/ClangBuiltLinux/linux/issues/1603
Fixes: https://github.com/llvm/llvm-project/issues/54062

Reviewed By: DavidSpickett

Differential Revision: https://reviews.llvm.org/D122189

(cherry picked from commit 5a2e56b70e2fa7ad0d82e54bc4c741b16f05e475)

Added: 
clang/test/Sema/arm-neon-decl-after-stmt.c

Modified: 
clang/test/CodeGen/aarch64-neon-ldst-one.c
clang/test/CodeGen/arm_neon_intrinsics.c
clang/utils/TableGen/NeonEmitter.cpp

Removed: 




diff  --git a/clang/test/CodeGen/aarch64-neon-ldst-one.c 
b/clang/test/CodeGen/aarch64-neon-ldst-one.c
index 1ecdd3e73724e..12f364b4425d0 100644
--- a/clang/test/CodeGen/aarch64-neon-ldst-one.c
+++ b/clang/test/CodeGen/aarch64-neon-ldst-one.c
@@ -947,8 +947,8 @@ poly64x1_t test_vld1_lane_p64(poly64_t  *a, poly64x1_t b) {
 // CHECK-LABEL: define{{.*}} %struct.int8x16x2_t @test_vld2q_lane_s8(i8* 
noundef %ptr, [2 x <16 x i8>] %src.coerce) #2 {
 // CHECK:   [[RETVAL:%.*]] = alloca %struct.int8x16x2_t, align 16
 // CHECK:   [[SRC:%.*]] = alloca %struct.int8x16x2_t, align 16
-// CHECK:   [[__S1:%.*]] = alloca %struct.int8x16x2_t, align 16
 // CHECK:   [[__RET:%.*]] = alloca %struct.int8x16x2_t, align 16
+// CHECK:   [[__S1:%.*]] = alloca %struct.int8x16x2_t, align 16
 // CHECK:   [[COERCE_DIVE:%.*]] = getelementptr inbounds %struct.int8x16x2_t, 
%struct.int8x16x2_t* [[SRC]], i32 0, i32 0
 // CHECK:   store [2 x <16 x i8>] [[SRC]].coerce, [2 x <16 x i8>]* 
[[COERCE_DIVE]], align 16
 // CHECK:   [[TMP0:%.*]] = bitcast %struct.int8x16x2_t* [[__S1]] to i8*
@@ -976,8 +976,8 @@ int8x16x2_t test_vld2q_lane_s8(int8_t const * ptr, 
int8x16x2_t src) {
 // CHECK-LABEL: define{{.*}} %struct.uint8x16x2_t @test_vld2q_lane_u8(i8* 
noundef %ptr, [2 x <16 x i8>] %src.coerce) #2 {
 // CHECK:   [[RETVAL:%.*]] = alloca %struct.uint8x16x2_t, align 16
 // CHECK:   [[SRC:%.*]] = alloca %struct.uint8x16x2_t, align 16
-// CHECK:   [[__S1:%.*]] = alloca %struct.uint8x16x2_t, align 16
 // CHECK:   [[__RET:%.*]] = alloca %struct.uint8x16x2_t, align 16
+// CHECK:   [[__S1:%.*]] = alloca %struct.uint8x16x2_t, align 16
 // CHECK:   [[COERCE_DIVE:%.*]] = getelementptr inbounds %struct.uint8x16x2_t, 
%struct.uint8x16x2_t* [[SRC]], i32 0, i32 0
 // CHECK:   store [2 x <16 x i8>] [[SRC]].coerce, [2 x <16 x i8>]* 
[[COERCE_DIVE]], align 16
 // CHECK:   [[TMP0:%.*]] = bitcast %struct.uint8x16x2_t* [[__S1]] to i8*
@@ -1005,8 +1005,8 @@ uint8x16x2_t test_vld2q_lane_u8(uint8_t const * ptr, 
uint8x16x2_t src) {
 // CHECK-LABEL: define{{.*}} %struct.poly8x16x2_t @test_vld2q_lane_p8(i8* 
noundef %ptr, [2 x <16 x i8>] %src.coerce) #2 {
 // CHECK:   [[RETVAL:%.*]] = alloca %struct.poly8x16x2_t, align 16
 // CHECK:   [[SRC:%.*]] = alloca %struct.poly8x16x2_t, align 16
-// CHECK:   [[__S1:%.*]] = alloca %struct.poly8x16x2_t, align 16
 // CHECK:   [[__RET:%.*]] = alloca %struct.poly8x16x2_t, align 16
+// CHECK:   [[__S1:%.*]] = alloca %struct.poly8x16x2_t, align 16
 // CHECK:   [[COERCE_DIVE:%.*]] = getelementptr inbounds %struct.poly8x16x2_t, 
%struct.poly8x16x2_t* [[SRC]], i32 0, i32 0
 // CHECK:   store [2 x <16 x i8>] [[SRC]].coerce, [2 x <16 x i8>]* 
[[COERCE_DIVE]], align 16
 // CHECK:   [[TMP0:%.*]] = bitcast %struct.poly8x16x2_t* [[__S1]] to i8*
@@ -1034,8 +1034,8 @@ poly8x16x2_t test_vld2q_lane_p8(poly8_t const * ptr, 
poly8x16x2_t src) {
 // CHECK-LABEL: define{{.*}} %struct.int8x16x3_t @test_vld3q_lane_s8(i8* 
noundef %ptr, [3 x <16 x i8>] %src.coerce) #2 {
 // CHECK:   [[RETVAL:%.*]] = alloca %struct.int8x16x3_t, align 16
 // CHECK:   [[SRC:%.*]] = alloca %struct.int8x16x3_t, align 16
-// CHECK:   [[__S1:%.*]] = alloca %struct.int8x16x3_t, align 16
 // CHECK:   [[__RET:%.*]] = alloca %struct.int8x16x3_t, align 16
+// CHECK:   [[__S1:%.*]] = alloca %struct.int8x16x3_t, align 16
 // CHECK:   [[COERCE_DIVE:%.*]] = getelementptr inbounds %struct.int8x16x3_t, 
%struct.int8x16x3_t* [[SRC]], i32 0, i32 0
 // CHECK:   store [3 x <16 x i8>] [[SRC]].coerce, [3 x <16 x i8>]* 
[[COERCE_DIVE]], align 16
 // CHECK:   [[TMP0:%.*]] = bitcast %struct.int8x16x3_t* [[__S

[llvm-branch-commits] [libcxx] b69247d - [libcxx] random_device, specify optimal entropy properties for all OS's using arc4random()

2022-04-01 Thread Tom Stellard via llvm-branch-commits

Author: Brad Smith
Date: 2022-04-01T22:03:51-07:00
New Revision: b69247dcbd80196af7f3b3942a51be3f2f82023b

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

LOG: [libcxx] random_device, specify optimal entropy properties for all OS's 
using arc4random()

Reviewed By: ldionne

Differential Revision: https://reviews.llvm.org/D122522

(cherry picked from commit 6e2c6c9def394c79a65bb216ac3d5261d39cc960)

Added: 


Modified: 
libcxx/src/random.cpp

Removed: 




diff  --git a/libcxx/src/random.cpp b/libcxx/src/random.cpp
index 6472a8dbcba3e..146b7c56bdebf 100644
--- a/libcxx/src/random.cpp
+++ b/libcxx/src/random.cpp
@@ -210,7 +210,7 @@ random_device::entropy() const noexcept
 return std::numeric_limits::digits;
 
   return ent;
-#elif defined(__OpenBSD__) || defined(_LIBCPP_USING_FUCHSIA_CPRNG)
+#elif defined(_LIBCPP_USING_ARC4_RANDOM) || 
defined(_LIBCPP_USING_FUCHSIA_CPRNG)
   return std::numeric_limits::digits;
 #else
   return 0;



___
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [llvm] 23d0827 - Add cmake/ to release tarballs via concatenation

2022-04-01 Thread Tom Stellard via llvm-branch-commits

Author: Aaron Puchert
Date: 2022-04-01T22:12:38-07:00
New Revision: 23d08271a4b24f21a88bfe73a5ea31c1e2c6365c

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

LOG: Add cmake/ to release tarballs via concatenation

The solution using append was reported not to work, but additionally it
would use the contents of the checked-out source tree instead of the git
tag or commit. This uses `git archive`, so it will use the right commit,
and at least for me (with GNU tar) it seems to work as intended.

Should fix #53281.

Reviewed By: kwk

Differential Revision: https://reviews.llvm.org/D121972

(cherry picked from commit 3a33664e8838e8b77acd1bbb13b1cf5e580a1077)

Added: 


Modified: 
llvm/utils/release/export.sh

Removed: 




diff  --git a/llvm/utils/release/export.sh b/llvm/utils/release/export.sh
index 43bb71d09bea8..55e38ab12bc7a 100755
--- a/llvm/utils/release/export.sh
+++ b/llvm/utils/release/export.sh
@@ -128,17 +128,21 @@ export_sources() {
 -cJf test-suite-$release$rc.src.tar.xz test-suite-$release$rc.src
 fi
 
+# Package up top-level cmake directory so that we can append it to all 
projects.
+tmp_dir=$(mktemp -d)
+cmake_archive_file=$tmp_dir/cmake.tar
+trap "rm -rv $tmp_dir" EXIT
+pushd $llvm_src_dir
+git archive -o $cmake_archive_file $tree_id cmake/
+popd
+
 for proj in $projects; do
 echo "Creating tarball for $proj ..."
 pushd $llvm_src_dir/$proj
-target_archive_file=$target_dir/$(template_file $proj)
-trap "rm -fv $target_archive_file.tmp" EXIT
-git archive --prefix=$proj-$release$rc.src/ -o 
$target_archive_file.tmp $tree_id .
-# Get relative path to top-level cmake directory to be packaged
-# alongside the project. Append that path to the tarball.
-cmake_rel_path=$(realpath --relative-to=. $llvm_src_dir/cmake)
-tar --append -f $target_archive_file.tmp $cmake_rel_path
-cat $target_archive_file.tmp | xz > $target_archive_file
+tmp_archive_file=$tmp_dir/$proj.tar
+git archive --prefix=$proj-$release$rc.src/ -o $tmp_archive_file 
$tree_id .
+tar -Af $tmp_archive_file $cmake_archive_file
+xz < $tmp_archive_file > $target_dir/$(template_file $proj)
 popd
 done
 }



___
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits