Skip to content

Commit

Permalink
Merged main:b83b28779ee56236aaf8827398f889334abbd28d into amd-gfx:667…
Browse files Browse the repository at this point in the history
…0c73ea871

Local branch amd-gfx 6670c73 [AMDGPU][Waterfall] Put exec save in the loop header
Remote branch main b83b287 [RISCV] Make Zhinx and Zvfh imply Zhinxmin and Zvfhmin respectively (llvm#75735)
  • Loading branch information
SC llvm team authored and SC llvm team committed Dec 18, 2023
2 parents 6670c73 + b83b287 commit 145f893
Show file tree
Hide file tree
Showing 57 changed files with 1,044 additions and 178 deletions.
8 changes: 4 additions & 4 deletions clang/lib/CodeGen/CGBuiltin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -232,19 +232,19 @@ static Value *MakeBinaryAtomicValue(

static Value *EmitNontemporalStore(CodeGenFunction &CGF, const CallExpr *E) {
Value *Val = CGF.EmitScalarExpr(E->getArg(0));
Value *Address = CGF.EmitScalarExpr(E->getArg(1));
Address Addr = CGF.EmitPointerWithAlignment(E->getArg(1));

Val = CGF.EmitToMemory(Val, E->getArg(0)->getType());
LValue LV = CGF.MakeNaturalAlignAddrLValue(Address, E->getArg(0)->getType());
LValue LV = CGF.MakeAddrLValue(Addr, E->getArg(0)->getType());
LV.setNontemporal(true);
CGF.EmitStoreOfScalar(Val, LV, false);
return nullptr;
}

static Value *EmitNontemporalLoad(CodeGenFunction &CGF, const CallExpr *E) {
Value *Address = CGF.EmitScalarExpr(E->getArg(0));
Address Addr = CGF.EmitPointerWithAlignment(E->getArg(0));

LValue LV = CGF.MakeNaturalAlignAddrLValue(Address, E->getType());
LValue LV = CGF.MakeAddrLValue(Addr, E->getType());
LV.setNontemporal(true);
return CGF.EmitLoadOfScalar(LV, E->getExprLoc());
}
Expand Down
5 changes: 0 additions & 5 deletions clang/lib/Format/Format.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1315,7 +1315,6 @@ static void expandPresetsBraceWrapping(FormatStyle &Expanded) {
Expanded.BraceWrapping.AfterStruct = true;
Expanded.BraceWrapping.AfterUnion = true;
Expanded.BraceWrapping.AfterExternBlock = true;
Expanded.IndentExternBlock = FormatStyle::IEBS_AfterExternBlock;
Expanded.BraceWrapping.SplitEmptyFunction = true;
Expanded.BraceWrapping.SplitEmptyRecord = false;
break;
Expand All @@ -1335,7 +1334,6 @@ static void expandPresetsBraceWrapping(FormatStyle &Expanded) {
Expanded.BraceWrapping.AfterStruct = true;
Expanded.BraceWrapping.AfterUnion = true;
Expanded.BraceWrapping.AfterExternBlock = true;
Expanded.IndentExternBlock = FormatStyle::IEBS_AfterExternBlock;
Expanded.BraceWrapping.BeforeCatch = true;
Expanded.BraceWrapping.BeforeElse = true;
Expanded.BraceWrapping.BeforeLambdaBody = true;
Expand All @@ -1350,7 +1348,6 @@ static void expandPresetsBraceWrapping(FormatStyle &Expanded) {
Expanded.BraceWrapping.AfterObjCDeclaration = true;
Expanded.BraceWrapping.AfterStruct = true;
Expanded.BraceWrapping.AfterExternBlock = true;
Expanded.IndentExternBlock = FormatStyle::IEBS_AfterExternBlock;
Expanded.BraceWrapping.BeforeCatch = true;
Expanded.BraceWrapping.BeforeElse = true;
Expanded.BraceWrapping.BeforeLambdaBody = true;
Expand All @@ -1375,7 +1372,6 @@ static void expandPresetsBraceWrapping(FormatStyle &Expanded) {
/*SplitEmptyFunction=*/true,
/*SplitEmptyRecord=*/true,
/*SplitEmptyNamespace=*/true};
Expanded.IndentExternBlock = FormatStyle::IEBS_AfterExternBlock;
break;
case FormatStyle::BS_WebKit:
Expanded.BraceWrapping.AfterFunction = true;
Expand Down Expand Up @@ -1909,7 +1905,6 @@ FormatStyle getMicrosoftStyle(FormatStyle::LanguageKind Language) {
Style.BraceWrapping.AfterObjCDeclaration = true;
Style.BraceWrapping.AfterStruct = true;
Style.BraceWrapping.AfterExternBlock = true;
Style.IndentExternBlock = FormatStyle::IEBS_AfterExternBlock;
Style.BraceWrapping.BeforeCatch = true;
Style.BraceWrapping.BeforeElse = true;
Style.BraceWrapping.BeforeWhile = false;
Expand Down
14 changes: 14 additions & 0 deletions clang/test/CodeGen/Nontemporal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,17 @@ void test_all_sizes(void) // CHECK-LABEL: test_all_sizes
vf2 = __builtin_nontemporal_load(&vf1); // CHECK: load <4 x float>{{.*}}align 16, !nontemporal
vc2 = __builtin_nontemporal_load(&vc1); // CHECK: load <8 x i8>{{.*}}align 8, !nontemporal
}

struct S { char c[16]; };
S x;

typedef int v4si __attribute__ ((vector_size(16)));

// CHECK-LABEL: define void @_Z14test_alignmentv()
// CHECK: load <4 x i32>, ptr @x, align 1, !nontemporal
// CHECK: store <4 x i32> %1, ptr @x, align 1, !nontemporal

void test_alignment() {
auto t = __builtin_nontemporal_load((v4si*)x.c);
__builtin_nontemporal_store(t, (v4si*)x.c);
}
7 changes: 7 additions & 0 deletions clang/unittests/Format/FormatTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4571,6 +4571,13 @@ TEST_F(FormatTest, IndentExternBlockStyle) {
"}",
Style);

Style.BreakBeforeBraces = FormatStyle::BS_Allman;
verifyFormat("extern \"C\"\n"
"{\n"
"int i;\n"
"}",
Style);

Style.BreakBeforeBraces = FormatStyle::BS_Custom;
Style.BraceWrapping.AfterExternBlock = true;
Style.IndentExternBlock = FormatStyle::IEBS_Indent;
Expand Down
5 changes: 5 additions & 0 deletions compiler-rt/cmake/Modules/AddCompilerRT.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -670,13 +670,18 @@ macro(add_custom_libcxx name prefix)
get_property(CXX_FLAGS CACHE CMAKE_CXX_FLAGS PROPERTY VALUE)
set(LIBCXX_CXX_FLAGS "${LIBCXX_CXX_FLAGS} ${CXX_FLAGS}")

if(CMAKE_VERBOSE_MAKEFILE)
set(verbose -DCMAKE_VERBOSE_MAKEFILE=ON)
endif()

ExternalProject_Add(${name}
DEPENDS ${name}-clobber ${LIBCXX_DEPS}
PREFIX ${CMAKE_CURRENT_BINARY_DIR}/${name}
SOURCE_DIR ${LLVM_MAIN_SRC_DIR}/../runtimes
BINARY_DIR ${prefix}
CMAKE_ARGS ${CMAKE_PASSTHROUGH_VARIABLES}
${compiler_args}
${verbose}
-DCMAKE_C_FLAGS=${LIBCXX_C_FLAGS}
-DCMAKE_CXX_FLAGS=${LIBCXX_CXX_FLAGS}
-DCMAKE_BUILD_TYPE=Release
Expand Down
2 changes: 1 addition & 1 deletion lldb/bindings/python/python-typemaps.swig
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ AND call SWIG_fail at the same time, because it will result in a double free.
SWIG_fail;
}

if (llvm::StringRef(type_name.get()).startswith("SB")) {
if (llvm::StringRef(type_name.get()).starts_with("SB")) {
std::string error_msg = "Input type is invalid: " + type_name.get();
PyErr_SetString(PyExc_TypeError, error_msg.c_str());
SWIG_fail;
Expand Down
5 changes: 5 additions & 0 deletions llvm/cmake/modules/LLVMExternalProjectUtils.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,10 @@ function(llvm_ExternalProject_Add name source_dir)
list(APPEND compiler_args -DCMAKE_ASM_COMPILER_TARGET=${ARG_TARGET_TRIPLE})
endif()

if(CMAKE_VERBOSE_MAKEFILE)
set(verbose -DCMAKE_VERBOSE_MAKEFILE=ON)
endif()

ExternalProject_Add(${name}
DEPENDS ${ARG_DEPENDS} llvm-config
${name}-clobber
Expand All @@ -330,6 +334,7 @@ function(llvm_ExternalProject_Add name source_dir)
CMAKE_ARGS ${${nameCanon}_CMAKE_ARGS}
--no-warn-unused-cli
${compiler_args}
${verbose}
-DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}
${sysroot_arg}
-DLLVM_BINARY_DIR=${PROJECT_BINARY_DIR}
Expand Down
2 changes: 1 addition & 1 deletion llvm/docs/AliasAnalysis.rst
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ Writing a new ``AliasAnalysis`` Implementation

Writing a new alias analysis implementation for LLVM is quite straight-forward.
There are already several implementations that you can use for examples, and the
following information should help fill in any details. For a examples, take a
following information should help fill in any details. For examples, take a
look at the `various alias analysis implementations`_ included with LLVM.

Different Pass styles
Expand Down
2 changes: 1 addition & 1 deletion llvm/docs/ConvergentOperations.rst
Original file line number Diff line number Diff line change
Expand Up @@ -607,7 +607,7 @@ those in the caller.
only if both threads entered the function by executing converged
dynamic instances of the call-site.

This intrinsic can occur at most once in a function, and only in the the entry
This intrinsic can occur at most once in a function, and only in the entry
block of the function. If this intrinsic occurs in a basic block, then it must
precede any other convergent operation in the same basic block.

Expand Down
2 changes: 1 addition & 1 deletion llvm/docs/JITLink.rst
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,7 @@ finally transferring linked memory to the executing process.

Calls the ``JITLinkContext``'s ``JITLinkMemoryManager`` to allocate both
working and target memory for the graph. As part of this process the
``JITLinkMemoryManager`` will update the the addresses of all nodes
``JITLinkMemoryManager`` will update the addresses of all nodes
defined in the graph to their assigned target address.

Note: This step only updates the addresses of nodes defined in this graph.
Expand Down
6 changes: 3 additions & 3 deletions llvm/docs/LangRef.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1515,7 +1515,7 @@ Currently, only the following parameter attributes are defined:
over-alignment specification through language attributes).

``allocalign``
The function parameter marked with this attribute is is the alignment in bytes of the
The function parameter marked with this attribute is the alignment in bytes of the
newly allocated block returned by this function. The returned value must either have
the specified alignment or be the null pointer. The return value MAY be more aligned
than the requested alignment, but not less aligned. Invalid (e.g. non-power-of-2)
Expand Down Expand Up @@ -22798,7 +22798,7 @@ Semantics:

The '``llvm.vp.fcmp``' compares its first two operands according to the
condition code given as the third operand. The operands are compared element by
element on each enabled lane, where the the semantics of the comparison are
element on each enabled lane, where the semantics of the comparison are
defined :ref:`according to the condition code <fcmp_md_cc_sem>`. Masked-off
lanes are ``poison``.

Expand Down Expand Up @@ -22856,7 +22856,7 @@ Semantics:

The '``llvm.vp.icmp``' compares its first two operands according to the
condition code given as the third operand. The operands are compared element by
element on each enabled lane, where the the semantics of the comparison are
element on each enabled lane, where the semantics of the comparison are
defined :ref:`according to the condition code <icmp_md_cc_sem>`. Masked-off
lanes are ``poison``.

Expand Down
2 changes: 1 addition & 1 deletion llvm/docs/NVPTXUsage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ optimization pipeline before dead-code elimination.
The NVPTX TargetMachine knows how to schedule ``NVVMReflect`` at the beginning
of your pass manager; just use the following code when setting up your pass
manager and the PassBuilder will use ``registerPassBuilderCallbacks`` to let
NVPTXTargetMachine::registerPassBuilderCallbacks add the the pass to the
NVPTXTargetMachine::registerPassBuilderCallbacks add the pass to the
pass manager:

.. code-block:: c++
Expand Down
2 changes: 1 addition & 1 deletion llvm/docs/TableGen/ProgRef.rst
Original file line number Diff line number Diff line change
Expand Up @@ -661,7 +661,7 @@ The argument values can be specified in two forms:
argument with name ``a`` and ``a1`` will be assigned to the argument with
name ``b``.

Required arguments can alse be specified as named argument.
Required arguments can also be specified as named argument.

Note that the argument can only be specified once regardless of the way (named
or positional) to specify and positional arguments should be put before named
Expand Down
8 changes: 6 additions & 2 deletions llvm/include/llvm/ADT/StringRef.h
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,9 @@ namespace llvm {
return Length >= Prefix.Length &&
compareMemory(Data, Prefix.Data, Prefix.Length) == 0;
}
[[nodiscard]] bool startswith(StringRef Prefix) const {
[[nodiscard]] LLVM_DEPRECATED(
"Use starts_with instead",
"starts_with") bool startswith(StringRef Prefix) const {
return starts_with(Prefix);
}

Expand All @@ -271,7 +273,9 @@ namespace llvm {
compareMemory(end() - Suffix.Length, Suffix.Data, Suffix.Length) ==
0;
}
[[nodiscard]] bool endswith(StringRef Suffix) const {
[[nodiscard]] LLVM_DEPRECATED(
"Use ends_with instead",
"ends_with") bool endswith(StringRef Suffix) const {
return ends_with(Suffix);
}

Expand Down
1 change: 0 additions & 1 deletion llvm/include/llvm/Analysis/AliasAnalysis.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ class LoopInfo;
class PreservedAnalyses;
class TargetLibraryInfo;
class Value;
template <typename> class SmallPtrSetImpl;

/// The possible results of an alias query.
///
Expand Down
1 change: 0 additions & 1 deletion llvm/include/llvm/Analysis/AliasAnalysisEvaluator.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
namespace llvm {
class AAResults;
class Function;
class FunctionPass;

class AAEvaluator : public PassInfoMixin<AAEvaluator> {
int64_t FunctionCount = 0;
Expand Down
1 change: 0 additions & 1 deletion llvm/include/llvm/Analysis/InstructionSimplify.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ class DominatorTree;
class Function;
class Instruction;
struct LoopStandardAnalysisResults;
class MDNode;
class Pass;
template <class T, unsigned n> class SmallSetVector;
class TargetLibraryInfo;
Expand Down
1 change: 0 additions & 1 deletion llvm/include/llvm/CodeGen/AccelTable.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@
namespace llvm {

class AsmPrinter;
class DwarfUnit;
class DwarfDebug;
class DwarfTypeUnit;
class MCSymbol;
Expand Down
1 change: 0 additions & 1 deletion llvm/include/llvm/CodeGen/AntiDepBreaker.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
#include "llvm/CodeGen/MachineInstr.h"
#include "llvm/CodeGen/TargetSubtargetInfo.h"
#include "llvm/Support/Compiler.h"
#include <cassert>
#include <utility>
#include <vector>

Expand Down
2 changes: 0 additions & 2 deletions llvm/include/llvm/CodeGen/GlobalISel/CombinerHelper.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,9 @@
namespace llvm {

class GISelChangeObserver;
class APFloat;
class APInt;
class ConstantFP;
class GPtrAdd;
class GStore;
class GZExtLoad;
class MachineIRBuilder;
class MachineInstrBuilder;
Expand Down
2 changes: 1 addition & 1 deletion llvm/include/llvm/Config/llvm-config.h.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

/* Indicate that this is LLVM compiled from the amd-gfx branch. */
#define LLVM_HAVE_BRANCH_AMD_GFX
#define LLVM_MAIN_REVISION 484113
#define LLVM_MAIN_REVISION 484145

/* Define if LLVM_ENABLE_DUMP is enabled */
#cmakedefine LLVM_ENABLE_DUMP
Expand Down
3 changes: 2 additions & 1 deletion llvm/include/llvm/IR/IntrinsicsRISCV.td
Original file line number Diff line number Diff line change
Expand Up @@ -702,7 +702,7 @@ let TargetPrefix = "riscv" in {
LLVMMatchType<2>, LLVMMatchType<2>],
[ImmArg<ArgIndex<4>>,ImmArg<ArgIndex<6>>, IntrNoMem, IntrHasSideEffects]>,
RISCVVIntrinsic {
let VLOperand = 6;
let VLOperand = 5;
}
// For Saturating binary operations.
// The destination vector type is NOT the same as first source vector.
Expand Down Expand Up @@ -1879,3 +1879,4 @@ let TargetPrefix = "riscv" in {
//===----------------------------------------------------------------------===//
include "llvm/IR/IntrinsicsRISCVXTHead.td"
include "llvm/IR/IntrinsicsRISCVXsf.td"
include "llvm/IR/IntrinsicsRISCVXCV.td"
37 changes: 37 additions & 0 deletions llvm/include/llvm/IR/IntrinsicsRISCVXCV.td
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
//===- IntrinsicsRISCVXCV.td - CORE-V intrinsics -----------*- tablegen -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
// This file defines all of the CORE-V vendor intrinsics for RISC-V.
//
//===----------------------------------------------------------------------===//

class ScalarCoreVBitManipGprGprIntrinsic
: DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_i32_ty, llvm_i32_ty],
[IntrNoMem, IntrSpeculatable]>;

class ScalarCoreVBitManipGprIntrinsic
: DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_i32_ty],
[IntrNoMem, IntrSpeculatable]>;

let TargetPrefix = "riscv" in {
def int_riscv_cv_bitmanip_extract : ScalarCoreVBitManipGprGprIntrinsic;
def int_riscv_cv_bitmanip_extractu : ScalarCoreVBitManipGprGprIntrinsic;
def int_riscv_cv_bitmanip_bclr : ScalarCoreVBitManipGprGprIntrinsic;
def int_riscv_cv_bitmanip_bset : ScalarCoreVBitManipGprGprIntrinsic;

def int_riscv_cv_bitmanip_insert
: DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
[IntrNoMem, IntrSpeculatable]>;

def int_riscv_cv_bitmanip_clb : ScalarCoreVBitManipGprIntrinsic;

def int_riscv_cv_bitmanip_bitrev
: DefaultAttrsIntrinsic<[llvm_i32_ty], [llvm_i32_ty, llvm_i32_ty, llvm_i32_ty],
[IntrNoMem, IntrWillReturn, IntrSpeculatable,
ImmArg<ArgIndex<1>>, ImmArg<ArgIndex<2>>]>;
} // TargetPrefix = "riscv"
1 change: 0 additions & 1 deletion llvm/lib/CodeGen/AsmPrinter/DebugLocStream.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ namespace llvm {
class AsmPrinter;
class DbgVariable;
class DwarfCompileUnit;
class MachineInstr;
class MCSymbol;

/// Byte stream of .debug_loc entries.
Expand Down
1 change: 0 additions & 1 deletion llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
#include "llvm/CodeGen/LexicalScopes.h"
#include "llvm/IR/DebugInfoMetadata.h"
#include "llvm/Support/Casting.h"
#include <cassert>
#include <cstdint>
#include <memory>

Expand Down
1 change: 0 additions & 1 deletion llvm/lib/CodeGen/AsmPrinter/DwarfFile.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ class DbgLabel;
class DINode;
class DILocalScope;
class DwarfCompileUnit;
class DwarfTypeUnit;
class DwarfUnit;
class LexicalScope;
class MCSection;
Expand Down
1 change: 0 additions & 1 deletion llvm/lib/CodeGen/MachineStableHash.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
#include "llvm/CodeGen/MachineStableHash.h"
#include "llvm/ADT/APFloat.h"
#include "llvm/ADT/APInt.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/Hashing.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SmallVector.h"
Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/IR/Metadata.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1566,7 +1566,7 @@ void Instruction::updateDIAssignIDMapping(DIAssignID *ID) {
"Expect existing attachment to be mapped");

auto &InstVec = InstrsIt->second;
auto *InstIt = std::find(InstVec.begin(), InstVec.end(), this);
auto *InstIt = llvm::find(InstVec, this);
assert(InstIt != InstVec.end() &&
"Expect instruction to be mapped to attachment");
// The vector contains a ptr to this. If this is the only element in the
Expand Down
Loading

0 comments on commit 145f893

Please sign in to comment.