[llvm-branch-commits] [llvm] dda0a18 - [LLVM 11] Add SystemZ changes to release notes

2020-09-29 Thread Ulrich Weigand via llvm-branch-commits

Author: Ulrich Weigand
Date: 2020-09-29T14:59:38+02:00
New Revision: dda0a1867cc0c4ace4535f179aec85c3ff8cfa96

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

LOG: [LLVM 11] Add SystemZ changes to release notes

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

Added: 


Modified: 
llvm/docs/ReleaseNotes.rst

Removed: 




diff  --git a/llvm/docs/ReleaseNotes.rst b/llvm/docs/ReleaseNotes.rst
index d724ba09502a..db64fa281018 100644
--- a/llvm/docs/ReleaseNotes.rst
+++ b/llvm/docs/ReleaseNotes.rst
@@ -241,6 +241,21 @@ Bug fixes:
 * The correct libcall is now emitted for converting a float/double to a 32-bit
   signed or unsigned integer on RV64 targets lacking the F or D extensions.
 
+Changes to the SystemZ Target
+-
+
+* Added support for the MemorySanitizer and the LeakSanitizer.
+* Added support for the ``-fstack-clash-protection`` command line option.
+* Enhanced the assembler parser to allow using `%r0` even in an address
+  register context, and to allow specifying registers using plain integer
+  numbers instead of register names everywhere.
+* Fixed wrong code generation violating the platform ABI when passing
+  a C++ class (not struct) type having only a single member of
+  floating-point type.
+* Fixed wrong code generation when using the `vec_store_len_r` or
+  `vec_load_len_r` intrinsics with an immediate length argument of
+  16 or larger.
+* Miscellaneous codegen enhancements, in particular to improve vector code.
 
 Changes to the X86 Target
 -



___
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] db04bec - [SDAG] Do not convert undef to 0 when folding CONCAT/BUILD_VECTOR

2020-09-29 Thread Krzysztof Parzyszek via llvm-branch-commits

Author: Krzysztof Parzyszek
Date: 2020-09-29T09:12:26-05:00
New Revision: db04bec5f1eeb581ee1470e5f444cc7b918c6d93

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

LOG: [SDAG] Do not convert undef to 0 when folding CONCAT/BUILD_VECTOR

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

Added: 
llvm/test/CodeGen/Hexagon/autohvx/isel-undef-not-zero.ll

Modified: 
llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
llvm/test/CodeGen/X86/vec-strict-cmp-sub128.ll

Removed: 




diff  --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp 
b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
index cfb4aa2f0bb5..b9362f1e762d 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
@@ -4370,11 +4370,16 @@ static SDValue foldCONCAT_VECTORS(const SDLoc &DL, EVT 
VT,
   for (SDValue Op : Elts)
 SVT = (SVT.bitsLT(Op.getValueType()) ? Op.getValueType() : SVT);
 
-  if (SVT.bitsGT(VT.getScalarType()))
-for (SDValue &Op : Elts)
-  Op = DAG.getTargetLoweringInfo().isZExtFree(Op.getValueType(), SVT)
-   ? DAG.getZExtOrTrunc(Op, DL, SVT)
-   : DAG.getSExtOrTrunc(Op, DL, SVT);
+  if (SVT.bitsGT(VT.getScalarType())) {
+for (SDValue &Op : Elts) {
+  if (Op.isUndef())
+Op = DAG.getUNDEF(SVT);
+  else
+Op = DAG.getTargetLoweringInfo().isZExtFree(Op.getValueType(), SVT)
+ ? DAG.getZExtOrTrunc(Op, DL, SVT)
+ : DAG.getSExtOrTrunc(Op, DL, SVT);
+}
+  }
 
   SDValue V = DAG.getBuildVector(VT, DL, Elts);
   NewSDValueDbgMsg(V, "New node fold concat vectors: ", &DAG);

diff  --git a/llvm/test/CodeGen/Hexagon/autohvx/isel-undef-not-zero.ll 
b/llvm/test/CodeGen/Hexagon/autohvx/isel-undef-not-zero.ll
new file mode 100644
index ..f8f0a7211a63
--- /dev/null
+++ b/llvm/test/CodeGen/Hexagon/autohvx/isel-undef-not-zero.ll
@@ -0,0 +1,32 @@
+; RUN: llc -march=hexagon -hexagon-hvx-widen=32 < %s | FileCheck %s
+
+; Check that we don't generate lots of vinserts (of 0 that should be undef).
+; CHECK: vinsert
+; CHECK: vinsert
+; CHECK-NOT: vinsert
+
+target datalayout = 
"e-m:e-p:32:32:32-a:0-n16:32-i64:64:64-i32:32:32-i16:16:16-i1:8:8-f32:32:32-f64:64:64-v32:32:32-v64:64:64-v512:512:512-v1024:1024:1024-v2048:2048:2048"
+target triple = "hexagon"
+
+define dllexport void @f0(i8* noalias align 128 %a0) #0 {
+b0:
+  %v0 = bitcast i8* %a0 to i32*
+  %v1 = getelementptr inbounds i32, i32* %v0, i32 undef
+  %v2 = bitcast i32* %v1 to <7 x i32>*
+  br label %b1
+
+b1:   ; preds = %b0
+  %v3 = load i8, i8* undef, align 1
+  %v4 = insertelement <7 x i8> undef, i8 %v3, i32 0
+  %v5 = shufflevector <7 x i8> %v4, <7 x i8> undef, <7 x i32> zeroinitializer
+  %v6 = zext <7 x i8> %v5 to <7 x i32>
+  %v7 = load <7 x i8>, <7 x i8>* undef, align 1
+  %v8 = zext <7 x i8> %v7 to <7 x i32>
+  %v9 = mul nsw <7 x i32> %v6, %v8
+  %v10 = add nsw <7 x i32> %v9, zeroinitializer
+  store <7 x i32> %v10, <7 x i32>* %v2, align 4
+  ret void
+}
+
+attributes #0 = { nounwind "target-cpu"="hexagonv66" 
"target-features"="+hvx,+hvx-length128b" }
+

diff  --git a/llvm/test/CodeGen/X86/vec-strict-cmp-sub128.ll 
b/llvm/test/CodeGen/X86/vec-strict-cmp-sub128.ll
index 97997018cff9..da8dbe32e840 100644
--- a/llvm/test/CodeGen/X86/vec-strict-cmp-sub128.ll
+++ b/llvm/test/CodeGen/X86/vec-strict-cmp-sub128.ll
@@ -101,7 +101,6 @@ define <2 x i32> @test_v2f32_ogt_s(<2 x i32> %a, <2 x i32> 
%b, <2 x float> %f1,
 ; AVX512-32-NEXT:kmovw %eax, %k0
 ; AVX512-32-NEXT:vcomiss 8(%ebp), %xmm2
 ; AVX512-32-NEXT:seta %al
-; AVX512-32-NEXT:andl $1, %eax
 ; AVX512-32-NEXT:kmovw %eax, %k1
 ; AVX512-32-NEXT:kandw %k0, %k1, %k0
 ; AVX512-32-NEXT:vmovshdup {{.*#+}} xmm2 = xmm2[1,1,3,3]
@@ -122,7 +121,6 @@ define <2 x i32> @test_v2f32_ogt_s(<2 x i32> %a, <2 x i32> 
%b, <2 x float> %f1,
 ; AVX512-64-NEXT:kmovw %eax, %k0
 ; AVX512-64-NEXT:vcomiss %xmm3, %xmm2
 ; AVX512-64-NEXT:seta %al
-; AVX512-64-NEXT:andl $1, %eax
 ; AVX512-64-NEXT:kmovw %eax, %k1
 ; AVX512-64-NEXT:kandw %k0, %k1, %k0
 ; AVX512-64-NEXT:vmovshdup {{.*#+}} xmm3 = xmm3[1,1,3,3]
@@ -148,7 +146,6 @@ define <2 x i32> @test_v2f32_ogt_s(<2 x i32> %a, <2 x i32> 
%b, <2 x float> %f1,
 ; AVX512F-32-NEXT:kmovw %eax, %k0
 ; AVX512F-32-NEXT:vcomiss 8(%ebp), %xmm2
 ; AVX512F-32-NEXT:seta %al
-; AVX512F-32-NEXT:andl $1, %eax
 ; AVX512F-32-NEXT:kmovw %eax, %k1
 ; AVX512F-32-NEXT:kandw %k0, %k1, %k0
 ; AVX512F-32-NEXT:vmovshdup {{.*#+}} xmm2 = xmm2[1,1,3,3]
@@ -173,7 +170,6 @@ define <2 x i32> @test_v2f32_ogt_s(<2 x i32> %a, <2 x i32> 
%b, <2 x float> %f1,
 ; AVX512F-64-NEXT:kmovw %eax, %k0
 ; AVX512F-64-NEXT:vcomiss %xmm3, %xmm2
 ;

[llvm-branch-commits] [clang-tools-extra] d8ba6b4 - [clangd] findNearbyIdentifier(): guaranteed to give up after 2^N lines

2020-09-29 Thread Aleksandr Platonov via llvm-branch-commits

Author: Aleksandr Platonov
Date: 2020-09-29T19:54:55+03:00
New Revision: d8ba6b4ab3eceb6bbcdf4371d4ffaab9d1a5cebe

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

LOG: [clangd] findNearbyIdentifier(): guaranteed to give up after 2^N lines

As @kadircet mentions in D84912#2184144, `findNearbyIdentifier()` traverses the 
whole file if there is no identifier for the word.
This patch ensures give up after 2^N lines in any case.

Reviewed By: sammccall

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

Added: 


Modified: 
clang-tools-extra/clangd/XRefs.cpp
clang-tools-extra/clangd/unittests/XRefsTests.cpp

Removed: 




diff  --git a/clang-tools-extra/clangd/XRefs.cpp 
b/clang-tools-extra/clangd/XRefs.cpp
index 9e8791c2a765..9532e1418cca 100644
--- a/clang-tools-extra/clangd/XRefs.cpp
+++ b/clang-tools-extra/clangd/XRefs.cpp
@@ -562,19 +562,34 @@ const syntax::Token *findNearbyIdentifier(const 
SpelledWord &Word,
   auto Cost = [&](SourceLocation Loc) -> unsigned {
 assert(SM.getFileID(Loc) == File && "spelled token in wrong file?");
 unsigned Line = SM.getSpellingLineNumber(Loc);
-if (Line > WordLine)
-  return 1 + llvm::Log2_64(Line - WordLine);
-if (Line < WordLine)
-  return 2 + llvm::Log2_64(WordLine - Line);
-return 0;
+return Line >= WordLine ? Line - WordLine : 2 * (WordLine - Line);
   };
   const syntax::Token *BestTok = nullptr;
-  // Search bounds are based on word length: 2^N lines forward.
-  unsigned BestCost = Word.Text.size() + 1;
+  unsigned BestCost = -1;
+  // Search bounds are based on word length:
+  // - forward: 2^N lines
+  // - backward: 2^(N-1) lines.
+  unsigned MaxDistance =
+  1U << std::min(Word.Text.size(),
+   std::numeric_limits::digits - 1);
+  // Line number for SM.translateLineCol() should be one-based, also
+  // SM.translateLineCol() can handle line number greater than
+  // number of lines in the file.
+  // - LineMin = max(1, WordLine + 1 - 2^(N-1))
+  // - LineMax = WordLine + 1 + 2^N
+  unsigned LineMin =
+  WordLine + 1 <= MaxDistance / 2 ? 1 : WordLine + 1 - MaxDistance / 2;
+  unsigned LineMax = WordLine + 1 + MaxDistance;
+  SourceLocation LocMin = SM.translateLineCol(File, LineMin, 1);
+  assert(LocMin.isValid());
+  SourceLocation LocMax = SM.translateLineCol(File, LineMax, 1);
+  assert(LocMax.isValid());
 
   // Updates BestTok and BestCost if Tok is a good candidate.
   // May return true if the cost is too high for this token.
   auto Consider = [&](const syntax::Token &Tok) {
+if (Tok.location() < LocMin || Tok.location() > LocMax)
+  return true; // we are too far from the word, break the outer loop.
 if (!(Tok.kind() == tok::identifier && Tok.text(SM) == Word.Text))
   return false;
 // No point guessing the same location we started with.

diff  --git a/clang-tools-extra/clangd/unittests/XRefsTests.cpp 
b/clang-tools-extra/clangd/unittests/XRefsTests.cpp
index a48bb9c8c182..40637b5fa758 100644
--- a/clang-tools-extra/clangd/unittests/XRefsTests.cpp
+++ b/clang-tools-extra/clangd/unittests/XRefsTests.cpp
@@ -1428,6 +1428,11 @@ TEST(LocateSymbol, NearbyIdentifier) {
 
 
   // h^i
+
+
+
+
+  int x = hi;
 )cpp",
   R"cpp(
   // prefer nearest occurrence even if several matched tokens



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