[llvm-branch-commits] [llvm] d720e58 - Add test for PR47322 (NFC)

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

Author: Nikita Popov
Date: 2020-09-15T10:21:08+02:00
New Revision: d720e5855dcf57b5b88ee6a4147ccd762115278a

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

LOG: Add test for PR47322 (NFC)

Added: 


Modified: 
llvm/test/Transforms/InstCombine/select.ll

Removed: 




diff  --git a/llvm/test/Transforms/InstCombine/select.ll 
b/llvm/test/Transforms/InstCombine/select.ll
index 185ff838b819..abdb36ab7bd4 100644
--- a/llvm/test/Transforms/InstCombine/select.ll
+++ b/llvm/test/Transforms/InstCombine/select.ll
@@ -2487,3 +2487,19 @@ define <2 x i32> @true_undef_vec(i1 %cond, <2 x i32> %x) 
{
   %s = select i1 %cond, <2 x i32> undef, <2 x i32> %x
   ret <2 x i32> %s
 }
+
+; FIXME: This is a miscompile!
+define i32 @pr47322_more_poisonous_replacement(i32 %arg) {
+; CHECK-LABEL: @pr47322_more_poisonous_replacement(
+; CHECK-NEXT:[[TRAILING:%.*]] = call i32 @llvm.cttz.i32(i32 [[ARG:%.*]], 
i1 immarg true), [[RNG0:!range !.*]]
+; CHECK-NEXT:[[SHIFTED:%.*]] = lshr i32 [[ARG]], [[TRAILING]]
+; CHECK-NEXT:ret i32 [[SHIFTED]]
+;
+  %cmp = icmp eq i32 %arg, 0
+  %trailing = call i32 @llvm.cttz.i32(i32 %arg, i1 immarg true)
+  %shifted = lshr i32 %arg, %trailing
+  %r1.sroa.0.1 = select i1 %cmp, i32 0, i32 %shifted
+  ret i32 %r1.sroa.0.1
+}
+
+declare i32 @llvm.cttz.i32(i32, i1 immarg)



___
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] 2d61b5e - Reduce code duplication in simplifySelectWithICmpCond (NFC)

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

Author: Nikita Popov
Date: 2020-09-15T10:21:08+02:00
New Revision: 2d61b5ea8079fb28db6a7b25cfc844fa6c21f8c4

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

LOG: Reduce code duplication in simplifySelectWithICmpCond (NFC)

Canonicalize icmp ne to icmp eq and implement all the folds only once.

Added: 


Modified: 
llvm/lib/Analysis/InstructionSimplify.cpp

Removed: 




diff  --git a/llvm/lib/Analysis/InstructionSimplify.cpp 
b/llvm/lib/Analysis/InstructionSimplify.cpp
index 9423ff9e3a66..0a76979f93e2 100644
--- a/llvm/lib/Analysis/InstructionSimplify.cpp
+++ b/llvm/lib/Analysis/InstructionSimplify.cpp
@@ -3965,12 +3965,18 @@ static Value *simplifySelectWithICmpCond(Value 
*CondVal, Value *TrueVal,
   if (!match(CondVal, m_ICmp(Pred, m_Value(CmpLHS), m_Value(CmpRHS
 return nullptr;
 
-  if (ICmpInst::isEquality(Pred) && match(CmpRHS, m_Zero())) {
+  // Canonicalize ne to eq predicate.
+  if (Pred == ICmpInst::ICMP_NE) {
+Pred = ICmpInst::ICMP_EQ;
+std::swap(TrueVal, FalseVal);
+  }
+
+  if (Pred == ICmpInst::ICMP_EQ && match(CmpRHS, m_Zero())) {
 Value *X;
 const APInt *Y;
 if (match(CmpLHS, m_And(m_Value(X), m_APInt(Y
   if (Value *V = simplifySelectBitTest(TrueVal, FalseVal, X, Y,
-   Pred == ICmpInst::ICMP_EQ))
+   /*TrueWhenUnset=*/true))
 return V;
 
 // Test for a bogus zero-shift-guard-op around funnel-shift or rotate.
@@ -3981,13 +3987,7 @@ static Value *simplifySelectWithICmpCond(Value *CondVal, 
Value *TrueVal,
   m_Value(ShAmt)));
 // (ShAmt == 0) ? fshl(X, *, ShAmt) : X --> X
 // (ShAmt == 0) ? fshr(*, X, ShAmt) : X --> X
-if (match(TrueVal, isFsh) && FalseVal == X && CmpLHS == ShAmt &&
-Pred == ICmpInst::ICMP_EQ)
-  return X;
-// (ShAmt != 0) ? X : fshl(X, *, ShAmt) --> X
-// (ShAmt != 0) ? X : fshr(*, X, ShAmt) --> X
-if (match(FalseVal, isFsh) && TrueVal == X && CmpLHS == ShAmt &&
-Pred == ICmpInst::ICMP_NE)
+if (match(TrueVal, isFsh) && FalseVal == X && CmpLHS == ShAmt)
   return X;
 
 // Test for a zero-shift-guard-op around rotates. These are used to
@@ -4001,11 +4001,6 @@ static Value *simplifySelectWithICmpCond(Value *CondVal, 
Value *TrueVal,
 m_Intrinsic(m_Value(X),
  m_Deferred(X),
  m_Value(ShAmt)));
-// (ShAmt != 0) ? fshl(X, X, ShAmt) : X --> fshl(X, X, ShAmt)
-// (ShAmt != 0) ? fshr(X, X, ShAmt) : X --> fshr(X, X, ShAmt)
-if (match(TrueVal, isRotate) && FalseVal == X && CmpLHS == ShAmt &&
-Pred == ICmpInst::ICMP_NE)
-  return TrueVal;
 // (ShAmt == 0) ? X : fshl(X, X, ShAmt) --> fshl(X, X, ShAmt)
 // (ShAmt == 0) ? X : fshr(X, X, ShAmt) --> fshr(X, X, ShAmt)
 if (match(FalseVal, isRotate) && TrueVal == X && CmpLHS == ShAmt &&
@@ -4032,17 +4027,6 @@ static Value *simplifySelectWithICmpCond(Value *CondVal, 
Value *TrueVal,
 SimplifyWithOpReplaced(TrueVal, CmpRHS, CmpLHS, Q, MaxRecurse) ==
 FalseVal)
   return FalseVal;
-  } else if (Pred == ICmpInst::ICMP_NE) {
-if (SimplifyWithOpReplaced(TrueVal, CmpLHS, CmpRHS, Q, MaxRecurse) ==
-FalseVal ||
-SimplifyWithOpReplaced(TrueVal, CmpRHS, CmpLHS, Q, MaxRecurse) ==
-FalseVal)
-  return TrueVal;
-if (SimplifyWithOpReplaced(FalseVal, CmpLHS, CmpRHS, Q, MaxRecurse) ==
-TrueVal ||
-SimplifyWithOpReplaced(FalseVal, CmpRHS, CmpLHS, Q, MaxRecurse) ==
-TrueVal)
-  return TrueVal;
   }
 
   return nullptr;



___
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] be31896 - Fix incorrect SimplifyWithOpReplaced transform (PR47322)

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

Author: Nikita Popov
Date: 2020-09-15T10:21:08+02:00
New Revision: be318969e245db0cd5471bff2a7cbfa3fad2b075

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

LOG: Fix incorrect SimplifyWithOpReplaced transform (PR47322)

This is a followup to D86834, which partially fixed this issue in
InstSimplify. However, InstCombine repeats the same transform while
dropping poison flags -- which does not cover cases where poison is
introduced in some other way.

The fix here is a bit more comprehensive, because things are quite
entangled, and it's hard to only partially address it without
regressing optimization. There are really two changes here:

 * Export the SimplifyWithOpReplaced API from InstSimplify, with an
   added AllowRefinement flag. For replacements inside the TrueVal
   we don't actually care whether refinement occurs or not, the
   replacement is always legal. This part of the transform is now
   done in InstSimplify only. (It should be noted that the current
   AllowRefinement check is not sufficient -- that's an issue we
   need to address separately.)
 * Change the InstCombine fold to work by temporarily dropping
   poison generating flags, running the fold and then restoring the
   flags if it didn't work out. This will ensure that the InstCombine
   fold is correct as long as the InstSimplify fold is correct.

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

Added: 


Modified: 
llvm/include/llvm/Analysis/InstructionSimplify.h
llvm/lib/Analysis/InstructionSimplify.cpp
llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp
llvm/test/Transforms/InstCombine/select.ll

Removed: 




diff  --git a/llvm/include/llvm/Analysis/InstructionSimplify.h 
b/llvm/include/llvm/Analysis/InstructionSimplify.h
index 2a39a4e09087..b5ae54fb98bc 100644
--- a/llvm/include/llvm/Analysis/InstructionSimplify.h
+++ b/llvm/include/llvm/Analysis/InstructionSimplify.h
@@ -268,6 +268,12 @@ Value *SimplifyFreezeInst(Value *Op, const SimplifyQuery 
&Q);
 Value *SimplifyInstruction(Instruction *I, const SimplifyQuery &Q,
OptimizationRemarkEmitter *ORE = nullptr);
 
+/// See if V simplifies when its operand Op is replaced with RepOp.
+/// AllowRefinement specifies whether the simplification can be a refinement,
+/// or whether it needs to be strictly identical.
+Value *SimplifyWithOpReplaced(Value *V, Value *Op, Value *RepOp,
+  const SimplifyQuery &Q, bool AllowRefinement);
+
 /// Replace all uses of 'I' with 'SimpleV' and simplify the uses recursively.
 ///
 /// This first performs a normal RAUW of I with SimpleV. It then recursively

diff  --git a/llvm/lib/Analysis/InstructionSimplify.cpp 
b/llvm/lib/Analysis/InstructionSimplify.cpp
index 0a76979f93e2..e744a966a104 100644
--- a/llvm/lib/Analysis/InstructionSimplify.cpp
+++ b/llvm/lib/Analysis/InstructionSimplify.cpp
@@ -3810,10 +3810,10 @@ Value *llvm::SimplifyFCmpInst(unsigned Predicate, Value 
*LHS, Value *RHS,
   return ::SimplifyFCmpInst(Predicate, LHS, RHS, FMF, Q, RecursionLimit);
 }
 
-/// See if V simplifies when its operand Op is replaced with RepOp.
-static const Value *SimplifyWithOpReplaced(Value *V, Value *Op, Value *RepOp,
-   const SimplifyQuery &Q,
-   unsigned MaxRecurse) {
+static Value *SimplifyWithOpReplaced(Value *V, Value *Op, Value *RepOp,
+ const SimplifyQuery &Q,
+ bool AllowRefinement,
+ unsigned MaxRecurse) {
   // Trivial replacement.
   if (V == Op)
 return RepOp;
@@ -3826,20 +3826,19 @@ static const Value *SimplifyWithOpReplaced(Value *V, 
Value *Op, Value *RepOp,
   if (!I)
 return nullptr;
 
+  // Consider:
+  //   %cmp = icmp eq i32 %x, 2147483647
+  //   %add = add nsw i32 %x, 1
+  //   %sel = select i1 %cmp, i32 -2147483648, i32 %add
+  //
+  // We can't replace %sel with %add unless we strip away the flags (which will
+  // be done in InstCombine).
+  // TODO: This is unsound, because it only catches some forms of refinement.
+  if (!AllowRefinement && canCreatePoison(I))
+return nullptr;
+
   // If this is a binary operator, try to simplify it with the replaced op.
   if (auto *B = dyn_cast(I)) {
-// Consider:
-//   %cmp = icmp eq i32 %x, 2147483647
-//   %add = add nsw i32 %x, 1
-//   %sel = select i1 %cmp, i32 -2147483648, i32 %add
-//
-// We can't replace %sel with %add unless we strip away the flags.
-// TODO: This is an unusual limitation because better analysis results in
-//   worse simplification. InstCombine can do this fold more generally
-//   by dropping the flags. Remove this fold to save co

[llvm-branch-commits] [llvm] 88e17a8 - [SelectionDAG] Remove unused FP constant in getNegatedExpression

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

Author: Qiu Chaofan
Date: 2020-09-15T13:42:41+02:00
New Revision: 88e17a8e9b49bfbcfc1fa70f867b5b56a7a64fc7

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

LOG: [SelectionDAG] Remove unused FP constant in getNegatedExpression

960cbc53 immediately removes nodes that won't be used to avoid
compilation time explosion. This patch adds the removal to constants to
fix PR47517.

Reviewed By: RKSimon, steven.zhang

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

(cherry picked from commit 2508ef014e8b01006de4e5ee6fd451d1f68d550f)

Added: 
llvm/test/CodeGen/X86/pr47517.ll

Modified: 
llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp

Removed: 




diff  --git a/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp 
b/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
index 819e608c6896..4ebb99c97841 100644
--- a/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
@@ -5751,8 +5751,10 @@ SDValue TargetLowering::getNegatedExpression(SDValue Op, 
SelectionDAG &DAG,
 
 // If we already have the use of the negated floating constant, it is free
 // to negate it even it has multiple uses.
-if (!Op.hasOneUse() && CFP.use_empty())
+if (!Op.hasOneUse() && CFP.use_empty()) {
+  RemoveDeadNode(CFP);
   break;
+}
 Cost = NegatibleCost::Neutral;
 return CFP;
   }

diff  --git a/llvm/test/CodeGen/X86/pr47517.ll 
b/llvm/test/CodeGen/X86/pr47517.ll
new file mode 100644
index ..6b508acf15dd
--- /dev/null
+++ b/llvm/test/CodeGen/X86/pr47517.ll
@@ -0,0 +1,28 @@
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
+; RUN: llc -mtriple x86_64 < %s | FileCheck %s
+
+; To ensure unused floating point constant is removed in negation
+define float @test(float %src, float* %p) {
+; CHECK-LABEL: test:
+; CHECK:   # %bb.0: # %entry
+; CHECK-NEXT:movq $0, (%rdi)
+; CHECK-NEXT:xorps %xmm0, %xmm0
+; CHECK-NEXT:retq
+entry:
+  %a0 = getelementptr inbounds float, float* %p, i32 0
+  %a1 = getelementptr inbounds float, float* %p, i32 1
+  store float 0.00e+00, float* %a0
+  store float 0.00e+00, float* %a1
+  %zero = load float, float* %a0
+  %fmul1 = fmul fast float %zero, %src
+  %fadd1 = fadd fast float %fmul1, %zero
+  %fmul2 = fmul fast float %fadd1, 2.00e+00
+  %fmul3 = fmul fast float %fmul2, %fmul2
+  %fmul4 = fmul fast float %fmul2, 2.00e+00
+  %fadd2 = fadd fast float %fmul4, -3.00e+00
+  %fmul5 = fmul fast float %fadd2, %fmul2
+  %fadd3 = fadd fast float %fmul2, %src
+  %fadd4 = fadd fast float %fadd3, %fmul5
+  %fmul6 = fmul fast float %fmul3, %fadd4
+  ret float %fmul6
+}



___
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] d754173 - [clangd] Use string[] for allCommitCharacters

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

Author: Kirill Bobyrev
Date: 2020-09-15T13:51:03+02:00
New Revision: d754173a98309b25562b5624dc108a3b46e990fe

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

LOG: [clangd] Use string[] for allCommitCharacters

As per LSP specification, allCommitCharacters should be string[] instead of
string:

https://microsoft.github.io/language-server-protocol/specification#textDocument_completion

Reviewed By: sammccall

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

(cherry picked from commit 9d11e6789c477ce6104e29745ca70e13c9fafeb0)

Added: 


Modified: 
clang-tools-extra/clangd/ClangdLSPServer.cpp
clang-tools-extra/clangd/test/initialize-params.test

Removed: 




diff  --git a/clang-tools-extra/clangd/ClangdLSPServer.cpp 
b/clang-tools-extra/clangd/ClangdLSPServer.cpp
index 0408b0498488..15ef89cb34fa 100644
--- a/clang-tools-extra/clangd/ClangdLSPServer.cpp
+++ b/clang-tools-extra/clangd/ClangdLSPServer.cpp
@@ -592,7 +592,10 @@ void ClangdLSPServer::onInitialize(const InitializeParams 
&Params,
 {"codeActionProvider", std::move(CodeActionProvider)},
 {"completionProvider",
  llvm::json::Object{
- {"allCommitCharacters", " \t()[]{}<>:;,+-/*%^&#?.=\"'|"},
+ {"allCommitCharacters",
+  {" ", "\t", "(", ")", "[", "]", "{",  "}", "<",
+   ">", ":",  ";", ",", "+", "-", "/",  "*", "%",
+   "^", "&",  "#", "?", ".", "=", "\"", "'", "|"}},
  {"resolveProvider", false},
  // We do extra checks, e.g. that > is part of ->.
  {"triggerCharacters", {".", "<", ">", ":", "\"", "/"}},

diff  --git a/clang-tools-extra/clangd/test/initialize-params.test 
b/clang-tools-extra/clangd/test/initialize-params.test
index f0a0f791c2f6..4125c27e4e35 100644
--- a/clang-tools-extra/clangd/test/initialize-params.test
+++ b/clang-tools-extra/clangd/test/initialize-params.test
@@ -7,7 +7,35 @@
 # CHECK-NEXT:"capabilities": {
 # CHECK-NEXT:  "codeActionProvider": true,
 # CHECK-NEXT:  "completionProvider": {
-# CHECK-NEXT:"allCommitCharacters": " \t()[]{}<>:;,+-/*%^&#?.=\"'|",
+# CHECK-NEXT:"allCommitCharacters": [
+# CHECK-NEXT:  " ",
+# CHECK-NEXT:  "\t",
+# CHECK-NEXT:  "(",
+# CHECK-NEXT:  ")",
+# CHECK-NEXT:  "[",
+# CHECK-NEXT:  "]",
+# CHECK-NEXT:  "{",
+# CHECK-NEXT:  "}",
+# CHECK-NEXT:  "<",
+# CHECK-NEXT:  ">",
+# CHECK-NEXT:  ":",
+# CHECK-NEXT:  ";",
+# CHECK-NEXT:  ",",
+# CHECK-NEXT:  "+",
+# CHECK-NEXT:  "-",
+# CHECK-NEXT:  "/",
+# CHECK-NEXT:  "*",
+# CHECK-NEXT:  "%",
+# CHECK-NEXT:  "^",
+# CHECK-NEXT:  "&",
+# CHECK-NEXT:  "#",
+# CHECK-NEXT:  "?",
+# CHECK-NEXT:  ".",
+# CHECK-NEXT:  "=",
+# CHECK-NEXT:  "\"",
+# CHECK-NEXT:  "'",
+# CHECK-NEXT:  "|"
+# CHECK-NEXT:],
 # CHECK-NEXT:"resolveProvider": false,
 # CHECK-NEXT:"triggerCharacters": [
 # CHECK-NEXT:  ".",



___
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] 2ec7739 - [FastISel] Bail out of selectGetElementPtr for vector GEPs.

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

Author: Craig Topper
Date: 2020-09-15T13:55:38+02:00
New Revision: 2ec773995076236110d4ffb1db7e6723c22519fc

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

LOG: [FastISel] Bail out of selectGetElementPtr for vector GEPs.

The code that decomposes the GEP into ADD/MUL doesn't work properly
for vector GEPs. It can create bad COPY instructions or possibly
assert.

For now just bail out to SelectionDAG.

Fixes PR45906

(cherry picked from commit 4208ea3e19f8e3e8cd35e6f5a6c43f4aa066c6ec)

Added: 


Modified: 
llvm/lib/CodeGen/SelectionDAG/FastISel.cpp
llvm/test/CodeGen/X86/masked_gather_scatter.ll

Removed: 




diff  --git a/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp 
b/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp
index fc6c3a145f13..f5948d2a20dc 100644
--- a/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp
@@ -690,6 +690,12 @@ bool FastISel::selectGetElementPtr(const User *I) {
   Register N = getRegForValue(I->getOperand(0));
   if (!N) // Unhandled operand. Halt "fast" selection and bail.
 return false;
+
+  // FIXME: The code below does not handle vector GEPs. Halt "fast" selection
+  // and bail.
+  if (isa(I->getType()))
+return false;
+
   bool NIsKill = hasTrivialKill(I->getOperand(0));
 
   // Keep a running tab of the total offset to coalesce multiple N = N + Offset

diff  --git a/llvm/test/CodeGen/X86/masked_gather_scatter.ll 
b/llvm/test/CodeGen/X86/masked_gather_scatter.ll
index df3af4c24659..b654b2a579fc 100644
--- a/llvm/test/CodeGen/X86/masked_gather_scatter.ll
+++ b/llvm/test/CodeGen/X86/masked_gather_scatter.ll
@@ -3319,3 +3319,51 @@ define void @scatter_16i64_constant_indices(i32* %ptr, 
<16 x i1> %mask, <16 x i3
   call void @llvm.masked.scatter.v16i32.v16p0i32(<16 x i32> %src0, <16 x i32*> 
%gep, i32 4, <16 x i1> %mask)
   ret void
 }
+
+%struct.foo = type { i8*, i64, i16, i16, i32 }
+
+; This used to cause fast-isel to generate bad copy instructions that would
+; cause an error in copyPhysReg.
+define <8 x i64> @pr45906(<8 x %struct.foo*> %ptr) {
+; KNL_64-LABEL: pr45906:
+; KNL_64:   # %bb.0: # %bb
+; KNL_64-NEXT:vpaddq {{.*}}(%rip){1to8}, %zmm0, %zmm1
+; KNL_64-NEXT:kxnorw %k0, %k0, %k1
+; KNL_64-NEXT:vpgatherqq (,%zmm1), %zmm0 {%k1}
+; KNL_64-NEXT:retq
+;
+; KNL_32-LABEL: pr45906:
+; KNL_32:   # %bb.0: # %bb
+; KNL_32-NEXT:vpbroadcastd {{.*#+}} ymm1 = [4,4,4,4,4,4,4,4]
+; KNL_32-NEXT:vpaddd %ymm1, %ymm0, %ymm1
+; KNL_32-NEXT:kxnorw %k0, %k0, %k1
+; KNL_32-NEXT:vpgatherdq (,%ymm1), %zmm0 {%k1}
+; KNL_32-NEXT:retl
+;
+; SKX_SMALL-LABEL: pr45906:
+; SKX_SMALL:   # %bb.0: # %bb
+; SKX_SMALL-NEXT:vpaddq {{.*}}(%rip){1to8}, %zmm0, %zmm1
+; SKX_SMALL-NEXT:kxnorw %k0, %k0, %k1
+; SKX_SMALL-NEXT:vpgatherqq (,%zmm1), %zmm0 {%k1}
+; SKX_SMALL-NEXT:retq
+;
+; SKX_LARGE-LABEL: pr45906:
+; SKX_LARGE:   # %bb.0: # %bb
+; SKX_LARGE-NEXT:movabsq ${{\.LCPI.*}}, %rax
+; SKX_LARGE-NEXT:vpaddq (%rax){1to8}, %zmm0, %zmm1
+; SKX_LARGE-NEXT:kxnorw %k0, %k0, %k1
+; SKX_LARGE-NEXT:vpgatherqq (,%zmm1), %zmm0 {%k1}
+; SKX_LARGE-NEXT:retq
+;
+; SKX_32-LABEL: pr45906:
+; SKX_32:   # %bb.0: # %bb
+; SKX_32-NEXT:vpaddd {{\.LCPI.*}}{1to8}, %ymm0, %ymm1
+; SKX_32-NEXT:kxnorw %k0, %k0, %k1
+; SKX_32-NEXT:vpgatherdq (,%ymm1), %zmm0 {%k1}
+; SKX_32-NEXT:retl
+bb:
+  %tmp = getelementptr inbounds %struct.foo, <8 x %struct.foo*> %ptr, i64 0, 
i32 1
+  %tmp1 = call <8 x i64> @llvm.masked.gather.v8i64.v8p0i64(<8 x i64*> %tmp, 
i32 8, <8 x i1> , <8 x i64> undef)
+  ret <8 x i64> %tmp1
+}
+declare <8 x i64> @llvm.masked.gather.v8i64.v8p0i64(<8 x i64*>, i32, <8 x i1>, 
<8 x i64>)



___
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] 274bb3f - Clang release notes: mention the max_tokens_here pragma

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

Author: Hans Wennborg
Date: 2020-09-15T15:45:33+02:00
New Revision: 274bb3fdddf8fe692fa13f4b3ccb06df8a72b388

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

LOG: Clang release notes: mention the max_tokens_here pragma

Added: 


Modified: 
clang/docs/ReleaseNotes.rst

Removed: 




diff  --git a/clang/docs/ReleaseNotes.rst b/clang/docs/ReleaseNotes.rst
index ba0e15deb389..c39be709d86c 100644
--- a/clang/docs/ReleaseNotes.rst
+++ b/clang/docs/ReleaseNotes.rst
@@ -311,7 +311,10 @@ Modified Compiler Flags
 New Pragmas in Clang
 
 
-- ...
+- The ``clang max_tokens_here`` pragma can be used together with
+  `-Wmax-tokens `_ to emit a warning 
when
+  the number of preprocessor tokens exceeds a limit. Such limits can be helpful
+  in limiting code growth and slow compiles due to large header files.
 
 Attribute Changes in Clang
 --



___
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] 1a8e450 - [analyzer] Add documentation for alpha.fuchsia.Lock and alpha.core.C11Lock

2020-09-15 Thread Kristóf Umann via llvm-branch-commits

Author: Kristóf Umann
Date: 2020-09-15T16:44:32+02:00
New Revision: 1a8e4505d860ad0faa898526fc6fdc861c981516

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

LOG: [analyzer] Add documentation for alpha.fuchsia.Lock and alpha.core.C11Lock

Added: 


Modified: 
clang/docs/analyzer/checkers.rst
clang/docs/analyzer/user-docs/CrossTranslationUnit.rst

Removed: 




diff  --git a/clang/docs/analyzer/checkers.rst 
b/clang/docs/analyzer/checkers.rst
index 1583da7aff09..ca5aec677178 100644
--- a/clang/docs/analyzer/checkers.rst
+++ b/clang/docs/analyzer/checkers.rst
@@ -1472,6 +1472,23 @@ Warn about assigning non-{0,1} values to boolean 
variables.
 alpha.core
 ^^
 
+.. _alpha-core-C11Lock:
+
+alpha.core.C11Lock
+""
+Similarly to :ref:`alpha.unix.PthreadLock `, checks for
+the locking/unlocking of ``mtx_t`` mutexes.
+
+.. code-block:: cpp
+
+ mtx_t mtx1;
+
+ void bad1(void)
+ {
+   mtx_lock(&mtx1);
+   mtx_lock(&mtx1); // warn: This lock has already been acquired
+ }
+
 .. _alpha-core-CallAndMessageUnInitRefArg:
 
 alpha.core.CallAndMessageUnInitRefArg (C,C++, ObjC)
@@ -1849,6 +1866,26 @@ Check for dereference of null smart pointers.
*P; // warn: dereference of a default constructed smart unique_ptr
  }
 
+alpha.fuchsia
+^
+
+.. _alpha-fuchsia-lock:
+
+alpha.fuchsia.Lock
+""
+Similarly to :ref:`alpha.unix.PthreadLock `, checks for
+the locking/unlocking of fuchsia mutexes.
+
+.. code-block:: cpp
+
+ spin_lock_t mtx1;
+
+ void bad1(void)
+ {
+   spin_lock(&mtx1);
+   spin_lock(&mtx1);   // warn: This lock has already been acquired
+ }
+
 alpha.llvm
 ^^
 

diff  --git a/clang/docs/analyzer/user-docs/CrossTranslationUnit.rst 
b/clang/docs/analyzer/user-docs/CrossTranslationUnit.rst
index 36be82f209ef..0606185f39e6 100644
--- a/clang/docs/analyzer/user-docs/CrossTranslationUnit.rst
+++ b/clang/docs/analyzer/user-docs/CrossTranslationUnit.rst
@@ -201,6 +201,8 @@ Example usage of scan-build-py:
   ^C
   $
 
+.. _ctu-on-demand:
+
 On-demand analysis
 __
 The analysis produces the necessary AST structure of external TUs during 
analysis. This requires the



___
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] e62452b - Revert "Double check that passes correctly set their Modified status"

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

Author: Hans Wennborg
Date: 2020-09-15T16:47:29+02:00
New Revision: e62452bb3e1e163daf75914cdf2e86deb4debf50

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

LOG: Revert "Double check that passes correctly set their Modified status"

This check fires during self-host.

> The approach is simple: if a pass reports that it's not modifying a
> Function/Module, compute a loose hash of that Function/Module and compare it
> with the original one. If we report no change but there's a hash change, then 
> we
> have an error.
>
> This approach misses a lot of change but it's not super intrusive and can
> detect most of the simple mistakes.
>
> Differential Revision: https://reviews.llvm.org/D80916

This reverts commit 3667d87a33d3c8d4072a41fd84bb880c59347dc0.

Added: 


Modified: 
llvm/lib/IR/LegacyPassManager.cpp
llvm/unittests/IR/LegacyPassManagerTest.cpp

Removed: 




diff  --git a/llvm/lib/IR/LegacyPassManager.cpp 
b/llvm/lib/IR/LegacyPassManager.cpp
index 74869fa62c66..4189aea46294 100644
--- a/llvm/lib/IR/LegacyPassManager.cpp
+++ b/llvm/lib/IR/LegacyPassManager.cpp
@@ -1475,74 +1475,6 @@ void FPPassManager::dumpPassStructure(unsigned Offset) {
   }
 }
 
-#ifdef EXPENSIVE_CHECKS
-namespace {
-namespace details {
-
-// Basic hashing mechanism to detect structural change to the IR, used to 
verify
-// pass return status consistency with actual change. Loosely copied from
-// llvm/lib/Transforms/Utils/FunctionComparator.cpp
-
-class StructuralHash {
-  uint64_t Hash = 0x6acaa36bef8325c5ULL;
-
-  void update(uint64_t V) { Hash = hashing::detail::hash_16_bytes(Hash, V); }
-
-public:
-  StructuralHash() = default;
-
-  void update(Function &F) {
-if (F.empty())
-  return;
-
-update(F.isVarArg());
-update(F.arg_size());
-
-SmallVector BBs;
-SmallPtrSet VisitedBBs;
-
-BBs.push_back(&F.getEntryBlock());
-VisitedBBs.insert(BBs[0]);
-while (!BBs.empty()) {
-  const BasicBlock *BB = BBs.pop_back_val();
-  update(45798); // Block header
-  for (auto &Inst : *BB)
-update(Inst.getOpcode());
-
-  const Instruction *Term = BB->getTerminator();
-  for (unsigned i = 0, e = Term->getNumSuccessors(); i != e; ++i) {
-if (!VisitedBBs.insert(Term->getSuccessor(i)).second)
-  continue;
-BBs.push_back(Term->getSuccessor(i));
-  }
-}
-  }
-
-  void update(Module &M) {
-for (Function &F : M)
-  update(F);
-  }
-
-  uint64_t getHash() const { return Hash; }
-};
-
-} // namespace details
-
-uint64_t StructuralHash(Function &F) {
-  details::StructuralHash H;
-  H.update(F);
-  return H.getHash();
-}
-
-uint64_t StructuralHash(Module &M) {
-  details::StructuralHash H;
-  H.update(M);
-  return H.getHash();
-}
-
-} // end anonymous namespace
-
-#endif
 
 /// Execute all of the passes scheduled for execution by invoking
 /// runOnFunction method.  Keep track of whether any of the passes modifies
@@ -1581,16 +1513,7 @@ bool FPPassManager::runOnFunction(Function &F) {
 {
   PassManagerPrettyStackEntry X(FP, F);
   TimeRegion PassTimer(getPassTimer(FP));
-#ifdef EXPENSIVE_CHECKS
-  uint64_t RefHash = StructuralHash(F);
-#endif
   LocalChanged |= FP->runOnFunction(F);
-
-#ifdef EXPENSIVE_CHECKS
-  assert((LocalChanged || (RefHash == StructuralHash(F))) &&
- "Pass modifies its input and doesn't report it.");
-#endif
-
   if (EmitICRemark) {
 unsigned NewSize = F.getInstructionCount();
 
@@ -1691,17 +1614,7 @@ MPPassManager::runOnModule(Module &M) {
   PassManagerPrettyStackEntry X(MP, M);
   TimeRegion PassTimer(getPassTimer(MP));
 
-#ifdef EXPENSIVE_CHECKS
-  uint64_t RefHash = StructuralHash(M);
-#endif
-
   LocalChanged |= MP->runOnModule(M);
-
-#ifdef EXPENSIVE_CHECKS
-  assert((LocalChanged || (RefHash == StructuralHash(M))) &&
- "Pass modifies its input and doesn't report it.");
-#endif
-
   if (EmitICRemark) {
 // Update the size of the module.
 unsigned ModuleCount = M.getInstructionCount();

diff  --git a/llvm/unittests/IR/LegacyPassManagerTest.cpp 
b/llvm/unittests/IR/LegacyPassManagerTest.cpp
index 8dda94b1b032..b7801b52481d 100644
--- a/llvm/unittests/IR/LegacyPassManagerTest.cpp
+++ b/llvm/unittests/IR/LegacyPassManagerTest.cpp
@@ -680,7 +680,7 @@ namespace llvm {
   ASSERT_EQ(M->getFunctionList().size(), 4U);
   Function *F = M->getFunction("test2");
   Function *SF = splitSimpleFunction(*F);
-  CallInst::Create(F, "", &*SF->getEntryBlock().getFirstInsertionPt());
+  CallInst::Create(F, "", &SF->getEntryBlock());
   ASSERT_EQ(M->getFunctionList().size(), 5U);
   CGModifierPass *P = new CGModifierPass();
   legacy::PassManager Passes;



__

[llvm-branch-commits] [clang] 791b7e9 - [release][docs] Add 11.0.0. release notes for the Clang Static Analyzer

2020-09-15 Thread Kristóf Umann via llvm-branch-commits

Author: Kristóf Umann
Date: 2020-09-15T16:49:35+02:00
New Revision: 791b7e9f73e0064153a7c3db8045a7333a8c390c

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

LOG: [release][docs] Add 11.0.0. release notes for the Clang Static Analyzer

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

Added: 


Modified: 
clang/docs/ReleaseNotes.rst

Removed: 




diff  --git a/clang/docs/ReleaseNotes.rst b/clang/docs/ReleaseNotes.rst
index c39be709d86c..ee257194d57f 100644
--- a/clang/docs/ReleaseNotes.rst
+++ b/clang/docs/ReleaseNotes.rst
@@ -603,10 +603,77 @@ libclang
 
 - ...
 
+.. _release-notes-clang-static-analyzer:
+
 Static Analyzer
 ---
 
-- ...
+- Improved the analyzer's understanding of inherited C++ constructors.
+
+- Improved the analyzer's understanding of dynamic class method dispatching in
+  Objective-C.
+
+- Greatly improved the analyzer's constraint solver by better understanding
+  when constraints are imposed on multiple symbolic values that are known to be
+  equal or known to be non-equal. It will now also efficiently reject 
impossible
+  if-branches between known comparison expressions.
+
+- Added :ref:`on-demand parsing ` capability to Cross 
Translation
+  Unit (CTU) analysis.
+
+- Numerous fixes and improvements for the HTML output.
+
+- New checker: :ref:`alpha.core.C11Lock ` and
+  :ref:`alpha.fuchsia.Lock ` checks for their respective
+  locking APIs.
+
+- New checker: :ref:`alpha.security.cert.pos.34c `
+  finds calls to ``putenv`` where a pointer to an autmoatic variable is passed
+  as an argument.
+
+- New checker: :ref:`webkit.NoUncountedMemberChecker
+  ` to enforce the existence of virtual
+  destructors for all uncounted types used as base classes.
+
+- New checker: :ref:`webkit.RefCntblBaseVirtualDtor
+  ` checks that only ref-counted types
+  are used as class members, not raw pointers and references to uncounted
+  types.
+
+- New checker: :ref:`alpha.cplusplus.SmartPtr ` check
+  for dereference of null smart pointers.
+
+- Moved ``PlacementNewChecker`` out of alpha, making it enabled by default.
+
+- Added support for multi-dimensional variadic arrays in ``core.VLASize``.
+
+- Added a check for insufficient storage in array placement new calls, as well
+  as support for alignment variants to ``cplusplus.PlacementNew``.
+
+- While still in alpha, ``alpha.unix.PthreadLock``, the iterator and container
+  modeling infrastructure, ``alpha.unix.Stream``, and taint analysis were
+  improved greatly. An ongoing, currently off-by-default improvement was made 
on
+  the pre-condition modeling of several functions defined in the POSIX 
standard.
+
+- Improved the warning messages of several checkers.
+
+- Fixed a few remaining cases of checkers emitting reports under incorrect
+  checker names, and employed a few restrictions to more easily identify and
+  avoid such errors.
+
+- Moved several non-reporting checkers (those that model, among other things,
+  standard functions, but emit no diagnostics) to be listed under
+  ``-analyzer-checker-help-developer`` instead of ``-analyzer-checker-help``.
+  Manually enabling or disabling checkers found on this list is not supported
+  in production.
+
+- Numerous fixes for crashes, false positives and false negatives in
+  ``unix.Malloc``, ``osx.cocoa.NSError``, and several other checkers.
+
+- Implemented a dockerized testing system to more easily determine the
+  correctness and performance impact of a change to the static analyzer itself.
+  The currently beta-version tool is found in
+  ``(llvm-project repository)/clang/utils/analyzer/SATest.py``.
 
 .. _release-notes-ubsan:
 



___
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] 22dab21 - Revert "[SelectionDAG] Remove unused FP constant in getNegatedExpression"

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

Author: Qiu Chaofan
Date: 2020-09-15T16:57:03+02:00
New Revision: 22dab218407e159631fd0689cb4412646b51515a

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

LOG: Revert "[SelectionDAG] Remove unused FP constant in getNegatedExpression"

2508ef01 doesn't totally fix the issue since we did not handle the case
when unused temporary negated result is the same with the result, which
is found by address sanitizer.

(cherry picked from commit e1669843f2aaf1e4929afdd8f125c14536d27664)

Added: 


Modified: 
llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp

Removed: 
llvm/test/CodeGen/X86/pr47517.ll



diff  --git a/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp 
b/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
index 4ebb99c97841..819e608c6896 100644
--- a/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
@@ -5751,10 +5751,8 @@ SDValue TargetLowering::getNegatedExpression(SDValue Op, 
SelectionDAG &DAG,
 
 // If we already have the use of the negated floating constant, it is free
 // to negate it even it has multiple uses.
-if (!Op.hasOneUse() && CFP.use_empty()) {
-  RemoveDeadNode(CFP);
+if (!Op.hasOneUse() && CFP.use_empty())
   break;
-}
 Cost = NegatibleCost::Neutral;
 return CFP;
   }

diff  --git a/llvm/test/CodeGen/X86/pr47517.ll 
b/llvm/test/CodeGen/X86/pr47517.ll
deleted file mode 100644
index 6b508acf15dd..
--- a/llvm/test/CodeGen/X86/pr47517.ll
+++ /dev/null
@@ -1,28 +0,0 @@
-; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
-; RUN: llc -mtriple x86_64 < %s | FileCheck %s
-
-; To ensure unused floating point constant is removed in negation
-define float @test(float %src, float* %p) {
-; CHECK-LABEL: test:
-; CHECK:   # %bb.0: # %entry
-; CHECK-NEXT:movq $0, (%rdi)
-; CHECK-NEXT:xorps %xmm0, %xmm0
-; CHECK-NEXT:retq
-entry:
-  %a0 = getelementptr inbounds float, float* %p, i32 0
-  %a1 = getelementptr inbounds float, float* %p, i32 1
-  store float 0.00e+00, float* %a0
-  store float 0.00e+00, float* %a1
-  %zero = load float, float* %a0
-  %fmul1 = fmul fast float %zero, %src
-  %fadd1 = fadd fast float %fmul1, %zero
-  %fmul2 = fmul fast float %fadd1, 2.00e+00
-  %fmul3 = fmul fast float %fmul2, %fmul2
-  %fmul4 = fmul fast float %fmul2, 2.00e+00
-  %fadd2 = fadd fast float %fmul4, -3.00e+00
-  %fmul5 = fmul fast float %fadd2, %fmul2
-  %fadd3 = fadd fast float %fmul2, %src
-  %fadd4 = fadd fast float %fadd3, %fmul5
-  %fmul6 = fmul fast float %fmul3, %fadd4
-  ret float %fmul6
-}



___
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] d3f1f58 - [Docs] Add/update release notes for D71913 (LTO WPD changes)

2020-09-15 Thread Teresa Johnson via llvm-branch-commits

Author: Teresa Johnson
Date: 2020-09-15T08:51:56-07:00
New Revision: d3f1f588f902a968f102d6cdaf052674efc257aa

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

LOG: [Docs] Add/update release notes for D71913 (LTO WPD changes)

This adds documentation for the options added / changed by D71913, which
enabled aggressive WPD under LTO. The lld release notes already
mentioned it, but I expanded the note.

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

Added: 


Modified: 
clang/docs/ReleaseNotes.rst
lld/docs/ReleaseNotes.rst
llvm/docs/ReleaseNotes.rst

Removed: 




diff  --git a/clang/docs/ReleaseNotes.rst b/clang/docs/ReleaseNotes.rst
index ee257194d57f..d90b8f182ef9 100644
--- a/clang/docs/ReleaseNotes.rst
+++ b/clang/docs/ReleaseNotes.rst
@@ -306,7 +306,8 @@ Modified Compiler Flags
 - -mcpu is now supported for RISC-V, and recognises the generic-rv32,
   rocket-rv32, sifive-e31, generic-rv64, rocket-rv64, and sifive-u54 target
   CPUs.
-
+- ``-fwhole-program-vtables`` (along with ``-flto*``) now prepares all classes 
for possible whole program visibility if specified during the LTO link.
+  (`D71913 `_)
 
 New Pragmas in Clang
 

diff  --git a/lld/docs/ReleaseNotes.rst b/lld/docs/ReleaseNotes.rst
index 466a7f707354..880f933e51be 100644
--- a/lld/docs/ReleaseNotes.rst
+++ b/lld/docs/ReleaseNotes.rst
@@ -26,7 +26,7 @@ ELF Improvements
 
 * ``--lto-emit-asm`` is added to emit assembly output for debugging purposes.
   (`D77231 `_)
-* ``--lto-whole-program-visibility`` is added to support LTO whole-program 
devirtualization.
+* ``--lto-whole-program-visibility`` is added to specify that classes have 
hidden LTO visibility in LTO and ThinLTO links of source files compiled with 
``-fwhole-program-vtables``. See `LTOVisibility 
`_ for details.
   (`D71913 `_)
 * ``--print-archive-stats=`` is added to print the number of members and the 
number of fetched members for each archive.
   The feature is similar to GNU gold's ``--print-symbol-counts=``.

diff  --git a/llvm/docs/ReleaseNotes.rst b/llvm/docs/ReleaseNotes.rst
index 0d5e0137bbc4..e87bf3d146f5 100644
--- a/llvm/docs/ReleaseNotes.rst
+++ b/llvm/docs/ReleaseNotes.rst
@@ -333,6 +333,12 @@ Changes to the Debug Info
   passed to the callee. The feature improves the debugging user experience when
   debugging optimized code.
 
+Changes to the Gold Plugin
+--
+
+* ``--plugin-opt=whole-program-visibility`` is added to specify that classes 
have hidden LTO visibility in LTO and ThinLTO links of source files compiled 
with ``-fwhole-program-vtables``. See `LTOVisibility 
`_ for details.
+  (`D71913 `_)
+
 Changes to the LLVM tools
 -
 



___
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] 1596c2d - Fix -allow-enabling-analyzer-alpha-checkers always being passed to run-clang-tidy.py

2020-09-15 Thread Andi-Bogdan Postelnicu via llvm-branch-commits

Author: Joachim Priesner
Date: 2020-09-15T19:26:57+03:00
New Revision: 1596c2dfd548b21cf33ad3353882ac465d78c1bb

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

LOG: Fix -allow-enabling-analyzer-alpha-checkers always being passed to 
run-clang-tidy.py

The action='store_true' option of argparse.add_argument implicitly
generates a default value of False if the argument is not specified.
Thus, the allow_enabling_alpha_checkers argument of
get_tidy_invocation is never None.

Added: 


Modified: 
clang-tools-extra/clang-tidy/tool/run-clang-tidy.py

Removed: 




diff  --git a/clang-tools-extra/clang-tidy/tool/run-clang-tidy.py 
b/clang-tools-extra/clang-tidy/tool/run-clang-tidy.py
index 4272ae0957fe..7e23419cd916 100755
--- a/clang-tools-extra/clang-tidy/tool/run-clang-tidy.py
+++ b/clang-tools-extra/clang-tidy/tool/run-clang-tidy.py
@@ -84,7 +84,7 @@ def get_tidy_invocation(f, clang_tidy_binary, checks, tmpdir, 
build_path,
 extra_arg, extra_arg_before, quiet, config):
   """Gets a command line for clang-tidy."""
   start = [clang_tidy_binary]
-  if allow_enabling_alpha_checkers is not None:
+  if allow_enabling_alpha_checkers:
 start.append('-allow-enabling-analyzer-alpha-checkers')
   if header_filter is not None:
 start.append('-header-filter=' + header_filter)



___
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] 4b23932 - [OPENMP][NFC]Release notes for OpenMP in clang (11.x).

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

Author: Hans Wennborg
Date: 2020-09-15T18:39:40+02:00
New Revision: 4b23932e230dd48a7bfc6fadb461d0ef81aeba94

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

LOG: [OPENMP][NFC]Release notes for OpenMP in clang (11.x).

By Alexey Bataev!

Differential revision: https://reviews.llvm.org/D86562

Added: 


Modified: 
clang/docs/ReleaseNotes.rst

Removed: 




diff  --git a/clang/docs/ReleaseNotes.rst b/clang/docs/ReleaseNotes.rst
index d90b8f182ef9c..1c02c478be688 100644
--- a/clang/docs/ReleaseNotes.rst
+++ b/clang/docs/ReleaseNotes.rst
@@ -439,7 +439,52 @@ ABI Changes in Clang
 OpenMP Support in Clang
 ---
 
-- ...
+New features for OpenMP 5.0 were implemented.
+
+- OpenMP 5.0 is the default version supported by the compiler. User can switch
+  to OpenMP 4.5 using ``-fopenmp-version=45`` option.
+
+- Added support for declare variant directive.
+
+- Improved support of math functions and complex types for NVPTX target.
+
+- Added support for parallel execution of target regions for NVPTX target.
+
+- Added support for ``scan`` directives and ``inscan`` modifier in 
``reduction``
+  clauses.
+
+- Added support for ``iterator`` construct.
+
+- Added support for ``depobj`` construct.
+
+- Added support for ``detach`` clauses in task-based directives.
+
+- Added support for array shaping operations.
+
+- Added support for cancellation constructs in ``taskloop`` directives.
+
+- Nonmonotonic modifier is allowed with all schedule kinds.
+
+- Added support for ``task`` and ``default`` modifiers in ``reduction`` 
clauses.
+
+- Added support for strides in array sections.
+
+- Added support for ``use_device_addr`` clause.
+
+- Added support for ``uses_allocators`` clause.
+
+- Added support for ``defaultmap`` clause.
+
+- Added basic support for ``hint`` clause in ``atomic`` directives.
+
+- Added basic support for ``affinity`` clause.
+
+- Added basic support for ``ancestor`` modifier in ``device`` clause.
+
+- Added support for ``default(firstprivate)`` clause. This clause is the part 
of
+  upcoming OpenMP 5.1 and can be enabled using ``-fopenmp-version=51`` option.
+
+- Bug fixes and optimizations.
 
 CUDA Support in Clang
 -



___
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] 1585817 - ReleaseNotes: PowerPC changes

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

Author: Hans Wennborg
Date: 2020-09-15T20:18:03+02:00
New Revision: 158581772fc8f3d6c601ceba14a08285e46cb7e9

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

LOG: ReleaseNotes: PowerPC changes

By Ahsan Saghir!

Added: 


Modified: 
llvm/docs/ReleaseNotes.rst

Removed: 




diff  --git a/llvm/docs/ReleaseNotes.rst b/llvm/docs/ReleaseNotes.rst
index e87bf3d146f5..977ba26f9e23 100644
--- a/llvm/docs/ReleaseNotes.rst
+++ b/llvm/docs/ReleaseNotes.rst
@@ -188,7 +188,41 @@ During this release ...
 Changes to the PowerPC Target
 -
 
-During this release ...
+Optimization:
+
+* Improved Loop Unroll-and-Jam legality checks, allowing it to handle more 
than two level loop nests
+* Improved Loop Unroll to be able to unroll more loops
+* Implemented an option to allow loop fusion to work on loops with 
diff erent constant trip counts
+
+Codegen:
+
+* POWER10 support
+* Added PC Relative addressing
+* Added __int128 vector bool support
+* Security enhancement via probe-stack attribute support to protect against 
stack clash
+* Floating point support enhancements
+* Improved half precision and quad precision support, including GLIBC
+* constrained FP operation support for arithmetic/rounding/max/min
+* cleaning up fast math flags checks in DAGCombine, Legalizer, and Lowering
+* Performance improvements from instruction exploitation, especially for 
vector permute on LE
+* Scheduling enhancements
+* Added MacroFusion for POWER8
+* Added post-ra heuristics for POWER9
+* Target dependent passes tuning
+* Updated LoopStrengthReduce to use instruction number as first priority
+* Enhanced MachineCombiner to expose more ILP
+* Code quality and maintenance enhancements
+* Enabled more machine verification passes
+* Added ability to parse and emit additional extended mnemonics
+* Numerous bug fixes
+
+AIX Support Improvements:
+
+* Enabled compile and link such that a simple  "Hello World" program 
works with standard headers
+* Added support for the C calling convention for non-vector code
+* Implemented correct stack frame layout for functions
+* In llvm-objdump, added support for relocations, improved selection of symbol 
labels, and added the --symbol-description option
+
 
 Changes to the RISC-V Target
 



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