[llvm-branch-commits] [compiler-rt] d024df4 - [compiler-rt] [netbsd] Reintroduce __sanitizer_protoent

2020-09-11 Thread Hans Wennborg via llvm-branch-commits

Author: Kamil Rytarowski
Date: 2020-09-11T11:06:44+02:00
New Revision: d024df40a192407eb54c5f8c17a7eb3b49e3f6da

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

LOG: [compiler-rt] [netbsd] Reintroduce __sanitizer_protoent

Partial revert of https://reviews.llvm.org/D82424

(cherry picked from commit f51e55e09eefbbc57fdd802f5f17e34749ba03ec)

Added: 


Modified: 
compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_netbsd.h

Removed: 




diff  --git 
a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_netbsd.h 
b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_netbsd.h
index ae54a8cf105e..d80280d9bf8c 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_netbsd.h
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_netbsd.h
@@ -129,6 +129,12 @@ struct __sanitizer_shmid_ds {
   void *_shm_internal;
 };
 
+struct __sanitizer_protoent {
+  char *p_name;
+  char **p_aliases;
+  int p_proto;
+};
+
 struct __sanitizer_netent {
   char *n_name;
   char **n_aliases;



___
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] 29d700a - [DebugInfo] Fixing CodeView assert related to lowerBound field of DISubrange.

2020-09-11 Thread Hans Wennborg via llvm-branch-commits

Author: Alok Kumar Sharma
Date: 2020-09-11T11:41:34+02:00
New Revision: 29d700a8132088ee6320702b601c0479a710a3ec

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

LOG: [DebugInfo] Fixing CodeView assert related to lowerBound field of 
DISubrange.

This is to fix CodeView build failure 
https://bugs.llvm.org/show_bug.cgi?id=47287
after DIsSubrange upgrade D80197

Assert condition is now removed and Count is calculated in case LowerBound
is absent or zero and Count or UpperBound is constant. If Count is unknown
it is later handled as VLA (currently Count is set to zero).

Reviewed By: rnk

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

(cherry picked from commit e45b0708ae81ace27de53f12b32a80601cb12bf3)

Added: 


Modified: 
llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp

Removed: 




diff  --git a/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp 
b/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
index 3f053c7a38c7..39069e24e061 100644
--- a/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
@@ -1592,11 +1592,16 @@ TypeIndex CodeViewDebug::lowerTypeArray(const 
DICompositeType *Ty) {
 assert(Element->getTag() == dwarf::DW_TAG_subrange_type);
 
 const DISubrange *Subrange = cast(Element);
-assert(!Subrange->getRawLowerBound() &&
-   "codeview doesn't support subranges with lower bounds");
 int64_t Count = -1;
-if (auto *CI = Subrange->getCount().dyn_cast())
-  Count = CI->getSExtValue();
+// Calculate the count if either LowerBound is absent or is zero and
+// either of Count or UpperBound are constant.
+auto *LI = Subrange->getLowerBound().dyn_cast();
+if (!Subrange->getRawLowerBound() || (LI && (LI->getSExtValue() == 0))) {
+  if (auto *CI = Subrange->getCount().dyn_cast())
+Count = CI->getSExtValue();
+  else if (auto *UI = Subrange->getUpperBound().dyn_cast())
+Count = UI->getSExtValue() + 1; // LowerBound is zero
+}
 
 // Forward declarations of arrays without a size and VLAs use a count of 
-1.
 // Emit a count of zero in these cases to match what MSVC does for arrays



___
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] bff8d98 - [clang][aarch64] Fix mangling of bfloat16 neon vectors

2020-09-11 Thread Hans Wennborg via llvm-branch-commits

Author: Cullen Rhodes
Date: 2020-09-11T13:34:42+02:00
New Revision: bff8d98129e8512ce9dcaed04e49c4f32f3a7e71

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

LOG: [clang][aarch64] Fix mangling of bfloat16 neon vectors

The AAPCS64 specifies the internal type is used for c++ mangling. For
bfloat16 it was defined as `BFloat16` when it should be `Bfloat16`, i.e.
lowercase 'f'.

For more information, see:

https://github.com/ARM-software/abi-aa/blob/master/aapcs64/aapcs64.rst#appendix-support-for-advanced-simd-extensions

Reviewed By: stuij

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

(cherry picked from commit cabd60c26b5df34f096a5a915bde3b1d8ee1)

Added: 


Modified: 
clang/lib/AST/ItaniumMangle.cpp
clang/test/CodeGenCXX/mangle-neon-vectors.cpp

Removed: 




diff  --git a/clang/lib/AST/ItaniumMangle.cpp b/clang/lib/AST/ItaniumMangle.cpp
index ddfbe9f86499..8b1419074df5 100644
--- a/clang/lib/AST/ItaniumMangle.cpp
+++ b/clang/lib/AST/ItaniumMangle.cpp
@@ -3248,7 +3248,7 @@ static StringRef mangleAArch64VectorBase(const 
BuiltinType *EltType) {
   case BuiltinType::Double:
 return "Float64";
   case BuiltinType::BFloat16:
-return "BFloat16";
+return "Bfloat16";
   default:
 llvm_unreachable("Unexpected vector element base type");
   }

diff  --git a/clang/test/CodeGenCXX/mangle-neon-vectors.cpp 
b/clang/test/CodeGenCXX/mangle-neon-vectors.cpp
index 6faf6226efd2..cb5e40be6a6d 100644
--- a/clang/test/CodeGenCXX/mangle-neon-vectors.cpp
+++ b/clang/test/CodeGenCXX/mangle-neon-vectors.cpp
@@ -1,6 +1,7 @@
 // RUN: %clang_cc1 -triple armv7-apple-ios -target-feature +neon  %s 
-emit-llvm -o - | FileCheck %s
 // RUN: %clang_cc1 -triple arm64-apple-ios -target-feature +neon %s -emit-llvm 
-o - | FileCheck %s
 // RUN: %clang_cc1 -triple arm64-linux-gnu -target-feature +neon %s -emit-llvm 
-o - | FileCheck %s --check-prefix=CHECK-AARCH64
+// RUN: %clang_cc1 -triple arm64-linux-gnu -target-feature +neon 
-target-feature +bf16 %s -emit-llvm -o - | FileCheck %s 
--check-prefix=CHECK-AARCH64-BF16
 
 typedef float float32_t;
 typedef double float64_t;
@@ -14,6 +15,10 @@ typedef short poly16_t;
 #endif
 typedef unsigned __INT64_TYPE__ uint64_t;
 
+#if defined(__ARM_FEATURE_BF16)
+typedef __bf16 bfloat16_t;
+#endif
+
 typedef __attribute__((neon_vector_type(2))) int int32x2_t;
 typedef __attribute__((neon_vector_type(4))) int int32x4_t;
 typedef __attribute__((neon_vector_type(1))) uint64_t uint64x1_t;
@@ -28,6 +33,10 @@ typedef __attribute__((neon_vector_type(2))) float64_t 
float64x2_t;
 typedef __attribute__((neon_polyvector_type(16))) poly8_t  poly8x16_t;
 typedef __attribute__((neon_polyvector_type(8)))  poly16_t poly16x8_t;
 
+#if defined(__ARM_FEATURE_BF16)
+typedef __attribute__((neon_vector_type(4))) __bf16 bfloat16x4_t;
+#endif
+
 // CHECK: 16__simd64_int32_t
 // CHECK-AARCH64: 11__Int32x2_t
 void f1(int32x2_t v) { }
@@ -72,3 +81,8 @@ void f10(poly16x8_t v) {}
 // CHECK-AARCH64: 13__Float64x2_t
 void f11(float64x2_t v) { }
 #endif
+
+#if defined(__ARM_FEATURE_BF16)
+// CHECK-AARCH64-BF16: 14__Bfloat16x4_t
+void f12(bfloat16x4_t v) {}
+#endif



___
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] 6af8758 - [libcxx] Handle target triples with dashes in platform name

2020-09-11 Thread Mikhail Maltsev via llvm-branch-commits

Author: Mikhail Maltsev
Date: 2020-09-11T14:42:05+01:00
New Revision: 6af8758ba4d7c42298a14fcc2433f9ab49215ac1

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

LOG: [libcxx] Handle target triples with dashes in platform name

Target triples may contain a dash in the platform name (e.g.
"aarch64-arm-none-eabi"). Account for it when splitting the triple
into components.

Reviewed By: ldionne, #libc

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

Added: 


Modified: 
libcxx/utils/libcxx/test/config.py

Removed: 




diff  --git a/libcxx/utils/libcxx/test/config.py 
b/libcxx/utils/libcxx/test/config.py
index 086db1d7f560..42438b3ccf2e 100644
--- a/libcxx/utils/libcxx/test/config.py
+++ b/libcxx/utils/libcxx/test/config.py
@@ -245,7 +245,7 @@ def configure_features(self):
 # XFAIL markers for tests that are known to fail with versions of
 # libc++ as were shipped with a particular triple.
 if self.use_system_cxx_lib:
-(arch, vendor, platform) = self.config.target_triple.split('-')
+(arch, vendor, platform) = self.config.target_triple.split('-', 2)
 (sysname, version) = re.match(r'([^0-9]+)([0-9\.]*)', 
platform).groups()
 
 
self.config.available_features.add('with_system_cxx_lib={}-{}-{}{}'.format(arch,
 vendor, sysname, version))



___
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] 01be54e - [flang] Add new documentation main page

2020-09-11 Thread Richard Barton via llvm-branch-commits

Author: Richard Barton
Date: 2020-09-11T15:21:07+01:00
New Revision: 01be54e257d9f09c6bbc7fe98f8f7449b30b37da

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

LOG: [flang] Add new documentation main page

Add a new index page to be the Flang documentation mainpage instead of
Overview.md, which jumps straight into the compiler Design. The index file
needs to be in .rst format to use the toctree directive to create table of
contents.

Also use the sphinx_markdown_tables extension to generate html tables form
markdown.

A number of additional style changes to the existing docs were needed to make
this work well:
 * Convert all headings to the # style, which works better with toctree's
   titlesonly option. Ensure that there is only one top-level heading per
   document.
 * Add a title to documents that don't have one for rendering on the index.
 * Convert the grammar docs from .txt to .md. for better rendering
 * Fixed broken link to a section in another document - sphinx does not seem to
   support anchor links in markdown files.

Depends on D87226

Reviewed By: sameeranjoshi

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

Added: 
flang/docs/OpenMP-4.5-grammar.md
flang/docs/f2018-grammar.md
flang/docs/index.md

Modified: 
flang/docs/ArrayComposition.md
flang/docs/BijectiveInternalNameUniquing.md
flang/docs/C++17.md
flang/docs/C++style.md
flang/docs/Calls.md
flang/docs/Character.md
flang/docs/ControlFlowGraph.md
flang/docs/Directives.md
flang/docs/Extensions.md
flang/docs/FortranForCProgrammers.md
flang/docs/FortranIR.md
flang/docs/IORuntimeInternals.md
flang/docs/ImplementingASemanticCheck.md
flang/docs/Intrinsics.md
flang/docs/LabelResolution.md
flang/docs/ModFiles.md
flang/docs/OpenMP-semantics.md
flang/docs/OptionComparison.md
flang/docs/Overview.md
flang/docs/ParserCombinators.md
flang/docs/Parsing.md
flang/docs/Preprocessing.md
flang/docs/PullRequestChecklist.md
flang/docs/RuntimeDescriptor.md
flang/docs/Semantics.md
flang/docs/conf.py

Removed: 
flang/docs/OpenMP-4.5-grammar.txt
flang/docs/f2018-grammar.txt



diff  --git a/flang/docs/ArrayComposition.md b/flang/docs/ArrayComposition.md
index 0f30af39f9e4..9e61abe5670f 100644
--- a/flang/docs/ArrayComposition.md
+++ b/flang/docs/ArrayComposition.md
@@ -6,6 +6,13 @@
   
 -->
 
+# Array Composition
+
+```eval_rst
+.. contents::
+   :local:
+```
+
 This note attempts to describe the motivation for and design of an
 implementation of Fortran 90 (and later) array expression evaluation that
 minimizes the use of dynamically allocated temporary storage for
@@ -34,8 +41,8 @@ Other Fortran intrinsic functions are technically 
transformational (e.g.,
 `COMMAND_ARGUMENT_COUNT`) but not of interest for this note.
 The generic `REDUCE` is also not considered here.
 
-Arrays as functions
-===
+## Arrays as functions
+
 A whole array can be viewed as a function that maps its indices to the values
 of its elements.
 Specifically, it is a map from a tuple of integers to its element type.
@@ -45,8 +52,8 @@ and the shape of the array delimits the domain of the map.
 `REAL :: A(N,M)` can be seen as a function mapping ordered pairs of integers
 `(J,K)` with `1<=J<=N` and `1<=J<=M` to real values.
 
-Array expressions as functions
-==
+## Array expressions as functions
+
 The same perspective can be taken of an array expression comprising
 intrinsic operators and elemental functions.
 Fortran doesn't allow one to apply subscripts directly to an expression,
@@ -83,8 +90,8 @@ side variable as an operand of the right-hand side 
expression, and any
 function calls on the right-hand side are elemental or scalar-valued,
 we can avoid the use of a temporary.
 
-Transformational intrinsic functions as function composition
-
+## Transformational intrinsic functions as function composition
+
 Many of the transformational intrinsic functions listed above
 can, when their array arguments are viewed as functions over their
 index tuples, be seen as compositions of those functions with
@@ -127,8 +134,8 @@ More completely:
 * `SPREAD(A,DIM=d,NCOPIES=n)` for compile-time `d` simply
   applies `A` to a reduced index tuple.
 
-Determination of rank and shape
-===
+## Determination of rank and shape
+
 An important part of evaluating array expressions without the use of
 temporary storage is determining the shape of the result prior to,
 or without, evaluating the elements of the result.
@@ -173,8 +180,8 @@ In cases where the analyzed shape is known at compile time, 
we should
 be able to have the opportunity to av