Skip to content

Commit

Permalink
Merged master:c0bc995429c into amd-gfx:68adaf5abf4
Browse files Browse the repository at this point in the history
Local branch amd-gfx 68adaf5 Merged master:169c83208f3 into amd-gfx:b84e3982f0d
Remote branch master c0bc995 [Polly] Fix prevectorization of fused loops.
  • Loading branch information
Sw authored and Sw committed Jul 10, 2020
2 parents 68adaf5 + c0bc995 commit 2ff9840
Show file tree
Hide file tree
Showing 31 changed files with 549 additions and 409 deletions.
3 changes: 0 additions & 3 deletions clang/include/clang/Basic/DiagnosticSemaKinds.td
Original file line number Diff line number Diff line change
Expand Up @@ -5395,9 +5395,6 @@ def ext_typecheck_zero_array_size : Extension<
"zero size arrays are an extension">, InGroup<ZeroLengthArray>;
def err_typecheck_zero_array_size : Error<
"zero-length arrays are not permitted in C++">;
def warn_typecheck_zero_static_array_size : Warning<
"'static' has no effect on zero-length arrays">,
InGroup<ArrayBounds>;
def err_array_size_non_int : Error<"size of array has non-integer type %0">;
def err_init_element_not_constant : Error<
"initializer element is not a compile-time constant">;
Expand Down
6 changes: 4 additions & 2 deletions clang/lib/CodeGen/CGCall.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2504,9 +2504,11 @@ void CodeGenFunction::EmitFunctionProlog(const CGFunctionInfo &FI,
ArrSize) {
llvm::AttrBuilder Attrs;
Attrs.addDereferenceableAttr(
getContext().getTypeSizeInChars(ETy).getQuantity()*ArrSize);
getContext().getTypeSizeInChars(ETy).getQuantity() *
ArrSize);
AI->addAttrs(Attrs);
} else if (getContext().getTargetAddressSpace(ETy) == 0 &&
} else if (getContext().getTargetInfo().getNullPointerValue(
ETy.getAddressSpace()) == 0 &&
!CGM.getCodeGenOpts().NullPointerIsValid) {
AI->addAttr(llvm::Attribute::NonNull);
}
Expand Down
7 changes: 0 additions & 7 deletions clang/lib/Sema/SemaType.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2393,13 +2393,6 @@ QualType Sema::BuildArrayType(QualType T, ArrayType::ArraySizeModifier ASM,
? diag::err_typecheck_zero_array_size
: diag::ext_typecheck_zero_array_size)
<< ArraySize->getSourceRange();

if (ASM == ArrayType::Static) {
Diag(ArraySize->getBeginLoc(),
diag::warn_typecheck_zero_static_array_size)
<< ArraySize->getSourceRange();
ASM = ArrayType::Normal;
}
} else if (!T->isDependentType() && !T->isVariablyModifiedType() &&
!T->isIncompleteType() && !T->isUndeducedType()) {
// Is the array too large?
Expand Down
2 changes: 1 addition & 1 deletion clang/lib/StaticAnalyzer/Core/RangeConstraintManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -672,7 +672,7 @@ class SymbolicRangeInferrer
if (!BinaryOperator::isComparisonOp(CurrentOP) || (CurrentOP == BO_Cmp))
return EmptyRangeSet;

static const OperatorRelationsTable CmpOpTable;
static const OperatorRelationsTable CmpOpTable{};

const SymExpr *LHS = SSE->getLHS();
const SymExpr *RHS = SSE->getRHS();
Expand Down
4 changes: 4 additions & 0 deletions clang/test/CodeGen/vla.c
Original file line number Diff line number Diff line change
Expand Up @@ -206,3 +206,7 @@ void test9(int n, int a[static n]) { }
// NULL-INVALID: define void @test9(i32 %n, i32* nonnull %a)
// NULL-VALID: define void @test9(i32 %n, i32* %a)

// Make sure a zero-sized static array extent is still required to be nonnull.
void test10(int a[static 0]) {}
// NULL-INVALID: define void @test10(i32* nonnull %a)
// NULL-VALID: define void @test10(i32* %a)
7 changes: 4 additions & 3 deletions clang/test/Sema/static-array.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// RUN: %clang_cc1 -triple x86_64-apple-macosx10.14.0 -fsyntax-only -fblocks -verify %s
// RUN: %clang_cc1 -triple x86_64-apple-macosx10.14.0 -fsyntax-only -fblocks -pedantic -verify %s

void cat0(int a[static 0]) {} // expected-warning {{'static' has no effect on zero-length arrays}}
void cat0(int a[static 0]) {} // expected-warning {{zero size arrays are an extension}} \
// expected-note {{callee declares array parameter as static here}}

void cat(int a[static 3]) {} // expected-note 4 {{callee declares array parameter as static here}} expected-note 2 {{passing argument to parameter 'a' here}}

Expand All @@ -9,7 +10,7 @@ void vat(int i, int a[static i]) {} // expected-note {{callee declares array par
void f(int *p) {
int a[2], b[3], c[4];

cat0(0);
cat0(0); // expected-warning {{null passed to a callee that requires a non-null argument}}

cat(0); // expected-warning {{null passed to a callee that requires a non-null argument}}
cat(a); // expected-warning {{array argument is too small; contains 2 elements, callee requires at least 3}}
Expand Down
7 changes: 6 additions & 1 deletion clang/tools/clang-shlib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,12 @@ foreach (lib ${clang_libs})
else()
list(APPEND _OBJECTS $<TARGET_OBJECTS:obj.${lib}>)
endif()
list(APPEND _DEPS $<TARGET_PROPERTY:${lib},INTERFACE_LINK_LIBRARIES>)
if (BUILD_SHARED_LIBS)
# If we are building static libraries, then we don't need to add the static
# libraries as a depedency, because we are already linking against the
# individual object files.
list(APPEND _DEPS $<TARGET_PROPERTY:${lib},INTERFACE_LINK_LIBRARIES>)
endif()

# clang libraries are redundant since we are linking all the individual
# object files into libclang-cpp.so, so filter them out from _DEPS.
Expand Down
38 changes: 32 additions & 6 deletions llvm/docs/CommandGuide/FileCheck.rst
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,37 @@ and from the command line.
-verify``. With this option FileCheck will verify that input does not contain
warnings not covered by any ``CHECK:`` patterns.

.. option:: --dump-input <mode>
.. option:: --dump-input <value>

Dump input to stderr, adding annotations representing currently enabled
diagnostics. Do this either 'always', on 'fail' (default), or 'never'.
Specify 'help' to explain the dump format and quit.
diagnostics. When there are multiple occurrences of this option, the
``<value>`` that appears earliest in the list below has precedence. The
default is ``fail``.

* ``help`` - Explain input dump and quit
* ``always`` - Always dump input
* ``fail`` - Dump input on failure
* ``never`` - Never dump input

.. option:: --dump-input-context <N>

In the dump requested by ``--dump-input``, print ``<N>`` input lines before
and ``<N>`` input lines after any lines specified by ``--dump-input-filter``.
When there are multiple occurrences of this option, the largest specified
``<N>`` has precedence. The default is 5.

.. option:: --dump-input-filter <value>

In the dump requested by ``--dump-input``, print only input lines of kind
``<value>`` plus any context specified by ``--dump-input-context``. When
there are multiple occurrences of this option, the ``<value>`` that appears
earliest in the list below has precedence. The default is ``error`` when
``--dump-input=fail``, and it's ``all`` when ``--dump-input=always``.

* ``all`` - All input lines
* ``annotation-full`` - Input lines with annotations
* ``annotation`` - Input lines with starting points of annotations
* ``error`` - Input lines with starting points of error annotations

.. option:: --enable-var-scope

Expand Down Expand Up @@ -137,15 +163,15 @@ and from the command line.

.. option:: -v

Print good directive pattern matches. However, if ``-input-dump=fail`` or
``-input-dump=always``, add those matches as input annotations instead.
Print good directive pattern matches. However, if ``-dump-input=fail`` or
``-dump-input=always``, add those matches as input annotations instead.

.. option:: -vv

Print information helpful in diagnosing internal FileCheck issues, such as
discarded overlapping ``CHECK-DAG:`` matches, implicit EOF pattern matches,
and ``CHECK-NOT:`` patterns that do not have matches. Implies ``-v``.
However, if ``-input-dump=fail`` or ``-input-dump=always``, just add that
However, if ``-dump-input=fail`` or ``-dump-input=always``, just add that
information as input annotations instead.

.. option:: --allow-deprecated-dag-overlap
Expand Down
17 changes: 3 additions & 14 deletions llvm/include/llvm/IR/IRPrintingPasses.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,10 @@
#define LLVM_IR_IRPRINTINGPASSES_H

#include "llvm/ADT/StringRef.h"
#include "llvm/IR/PassManager.h"
#include <string>

namespace llvm {
class Pass;
class Function;
class FunctionPass;
class Module;
class ModulePass;
class PreservedAnalyses;
class raw_ostream;
template <typename IRUnitT, typename... ExtraArgTs> class AnalysisManager;

/// Create and return a pass that writes the module to the specified
/// \c raw_ostream.
Expand Down Expand Up @@ -71,7 +64,7 @@ extern bool shouldPrintAfterPass(StringRef);
///
/// Note: This pass is for use with the new pass manager. Use the create...Pass
/// functions above to create passes for use with the legacy pass manager.
class PrintModulePass {
class PrintModulePass : public PassInfoMixin<PrintModulePass> {
raw_ostream &OS;
std::string Banner;
bool ShouldPreserveUseListOrder;
Expand All @@ -82,15 +75,13 @@ class PrintModulePass {
bool ShouldPreserveUseListOrder = false);

PreservedAnalyses run(Module &M, AnalysisManager<Module> &);

static StringRef name() { return "PrintModulePass"; }
};

/// Pass for printing a Function as LLVM's text IR assembly.
///
/// Note: This pass is for use with the new pass manager. Use the create...Pass
/// functions above to create passes for use with the legacy pass manager.
class PrintFunctionPass {
class PrintFunctionPass : public PassInfoMixin<PrintFunctionPass> {
raw_ostream &OS;
std::string Banner;

Expand All @@ -99,8 +90,6 @@ class PrintFunctionPass {
PrintFunctionPass(raw_ostream &OS, const std::string &Banner = "");

PreservedAnalyses run(Function &F, AnalysisManager<Function> &);

static StringRef name() { return "PrintFunctionPass"; }
};

} // End llvm namespace
Expand Down
1 change: 1 addition & 0 deletions llvm/include/llvm/module.modulemap
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,7 @@ module LLVM_intrinsic_gen {
module Analysis_PostDominators { header "Analysis/PostDominators.h" export * }
module Analysis_DomTreeUpdater { header "Analysis/DomTreeUpdater.h" export * }
module IR_IRBuilder { header "IR/IRBuilder.h" export * }
module IR_IRPrintingPasses { header "IR/IRPrintingPasses.h" export * }
module IR_MatrixBuilder { header "IR/MatrixBuilder.h" export * }
module IR_PassManager { header "IR/PassManager.h" export * }
module IR_PassManagerImpl { header "IR/PassManagerImpl.h" export * }
Expand Down
Loading

0 comments on commit 2ff9840

Please sign in to comment.