Skip to content

Commit

Permalink
Merged master:aae349e2760e into amd-gfx:b2a0e7264b38
Browse files Browse the repository at this point in the history
Local branch amd-gfx b2a0e72 Merged master:7bc03f55539f into amd-gfx:c5a8d66d784a
Remote branch master aae349e [InstSimplify][test] Remove unused parameter in vscale.ll
  • Loading branch information
Sw authored and Sw committed Aug 10, 2020
2 parents b2a0e72 + aae349e commit 0f98b7a
Show file tree
Hide file tree
Showing 41 changed files with 254 additions and 180 deletions.
4 changes: 3 additions & 1 deletion clang/include/clang/Basic/DiagnosticGroups.td
Original file line number Diff line number Diff line change
Expand Up @@ -547,6 +547,7 @@ def StaticLocalInInline : DiagGroup<"static-local-in-inline">;
def GNUStaticFloatInit : DiagGroup<"gnu-static-float-init">;
def StaticFloatInit : DiagGroup<"static-float-init", [GNUStaticFloatInit]>;
def GNUStatementExpression : DiagGroup<"gnu-statement-expression">;
def StringConcatation : DiagGroup<"string-concatenation">;
def StringCompare : DiagGroup<"string-compare">;
def StringPlusInt : DiagGroup<"string-plus-int">;
def StringPlusChar : DiagGroup<"string-plus-char">;
Expand Down Expand Up @@ -880,7 +881,8 @@ def Extra : DiagGroup<"extra", [
SignCompare,
UnusedParameter,
NullPointerArithmetic,
EmptyInitStatement
EmptyInitStatement,
StringConcatation
]>;

def Most : DiagGroup<"most", [
Expand Down
2 changes: 1 addition & 1 deletion clang/include/clang/Basic/DiagnosticSemaKinds.td
Original file line number Diff line number Diff line change
Expand Up @@ -3005,7 +3005,7 @@ def warn_objc_string_literal_comparison : Warning<
def warn_concatenated_literal_array_init : Warning<
"suspicious concatenation of string literals in an array initialization; "
"did you mean to separate the elements with a comma?">,
InGroup<DiagGroup<"string-concatenation">>;
InGroup<StringConcatation>, DefaultIgnore;
def warn_concatenated_nsarray_literal : Warning<
"concatenated NSString literal for an NSArray expression - "
"possibly missing a comma">,
Expand Down
9 changes: 5 additions & 4 deletions clang/lib/Sema/SemaExpr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6908,13 +6908,14 @@ Sema::ActOnInitList(SourceLocation LBraceLoc, MultiExprArg InitArgList,
<< InitArgList[I]->getSourceRange();
} else if (const auto *SL = dyn_cast<StringLiteral>(InitArgList[I])) {
unsigned NumConcat = SL->getNumConcatenated();
const auto *SLNext =
dyn_cast<StringLiteral>(InitArgList[I + 1 < E ? I + 1 : 0]);
const auto *SLPrev =
dyn_cast<StringLiteral>(InitArgList[I == 0 ? E - 1 : I - 1]);
// Diagnose missing comma in string array initialization.
// Do not warn when all the elements in the initializer are concatenated
// together. Do not warn for macros too.
if (NumConcat > 1 && E > 2 && !SL->getBeginLoc().isMacroID() && SLNext &&
NumConcat != SLNext->getNumConcatenated()) {
if (NumConcat > 1 && E > 2 && !SL->getBeginLoc().isMacroID() &&
isa<StringLiteral>(InitArgList[0]) && SLPrev &&
NumConcat != SLPrev->getNumConcatenated()) {
SmallVector<FixItHint, 1> Hints;
for (unsigned i = 0; i < NumConcat - 1; ++i)
Hints.push_back(FixItHint::CreateInsertion(
Expand Down
52 changes: 26 additions & 26 deletions clang/test/Driver/arm-cortex-cpus.c

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions clang/test/Sema/string-concat.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

// RUN: %clang_cc1 -x c -fsyntax-only -verify %s
// RUN: %clang_cc1 -x c++ -fsyntax-only -verify %s
// RUN: %clang_cc1 -x c -Wstring-concatenation -fsyntax-only -verify %s
// RUN: %clang_cc1 -x c++ -Wstring-concatenation -fsyntax-only -verify %s

const char *missing_comma[] = {
"basic_filebuf",
Expand Down Expand Up @@ -108,7 +108,7 @@ const char *not_warn2[] = {
"// Aaa\\\n" " Bbb\\ \n" " Ccc?" "?/\n",
"// Aaa\\\r\n" " Bbb\\ \r\n" " Ccc?" "?/\r\n",
"// Aaa\\\r" " Bbb\\ \r" " Ccc?" "?/\r"
};
};

// Do not warn when all the elements in the initializer are concatenated together.
const char *all_elems_in_init_concatenated[] = {"a" "b" "c"};
Expand Down
3 changes: 2 additions & 1 deletion llvm/include/llvm/CodeGen/TargetLoweringObjectFileImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,8 @@ class TargetLoweringObjectFileXCOFF : public TargetLoweringObjectFile {
MCSection *
getSectionForFunctionDescriptor(const Function *F,
const TargetMachine &TM) const override;
MCSection *getSectionForTOCEntry(const MCSymbol *Sym) const override;
MCSection *getSectionForTOCEntry(const MCSymbol *Sym,
const TargetMachine &TM) const override;

/// For external functions, this will always return a function descriptor
/// csect.
Expand Down
3 changes: 2 additions & 1 deletion llvm/include/llvm/Target/TargetLoweringObjectFile.h
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,8 @@ class TargetLoweringObjectFile : public MCObjectFileInfo {
/// On targets that support TOC entries, return a section for the entry given
/// the symbol it refers to.
/// TODO: Implement this interface for existing ELF targets.
virtual MCSection *getSectionForTOCEntry(const MCSymbol *S) const {
virtual MCSection *getSectionForTOCEntry(const MCSymbol *S,
const TargetMachine &TM) const {
return nullptr;
}

Expand Down
7 changes: 5 additions & 2 deletions llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2202,8 +2202,11 @@ MCSection *TargetLoweringObjectFileXCOFF::getSectionForFunctionDescriptor(
}

MCSection *TargetLoweringObjectFileXCOFF::getSectionForTOCEntry(
const MCSymbol *Sym) const {
const MCSymbol *Sym, const TargetMachine &TM) const {
// Use TE storage-mapping class when large code model is enabled so that
// the chance of needing -bbigtoc is decreased.
return getContext().getXCOFFSection(
cast<MCSymbolXCOFF>(Sym)->getSymbolTableName(), XCOFF::XMC_TC,
cast<MCSymbolXCOFF>(Sym)->getSymbolTableName(),
TM.getCodeModel() == CodeModel::Large ? XCOFF::XMC_TE : XCOFF::XMC_TC,
XCOFF::XTY_SD, XCOFF::C_HIDEXT, SectionKind::getData());
}
1 change: 1 addition & 0 deletions llvm/lib/MC/MCSectionXCOFF.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ void MCSectionXCOFF::PrintSwitchToSection(const MCAsmInfo &MAI, const Triple &T,
printCsectDirective(OS);
break;
case XCOFF::XMC_TC:
case XCOFF::XMC_TE:
break;
case XCOFF::XMC_TC0:
OS << "\t.toc\n";
Expand Down
7 changes: 4 additions & 3 deletions llvm/lib/Target/PowerPC/MCTargetDesc/PPCMCTargetDesc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
#include "llvm/ADT/StringRef.h"
#include "llvm/ADT/Triple.h"
#include "llvm/BinaryFormat/ELF.h"
#include "llvm/MC/MCAssembler.h"
#include "llvm/MC/MCAsmBackend.h"
#include "llvm/MC/MCAssembler.h"
#include "llvm/MC/MCCodeEmitter.h"
#include "llvm/MC/MCContext.h"
#include "llvm/MC/MCDwarf.h"
Expand All @@ -30,6 +30,7 @@
#include "llvm/MC/MCInstrInfo.h"
#include "llvm/MC/MCObjectWriter.h"
#include "llvm/MC/MCRegisterInfo.h"
#include "llvm/MC/MCSectionXCOFF.h"
#include "llvm/MC/MCStreamer.h"
#include "llvm/MC/MCSubtargetInfo.h"
#include "llvm/MC/MCSymbol.h"
Expand Down Expand Up @@ -122,8 +123,8 @@ class PPCTargetAsmStreamer : public PPCTargetStreamer {
void emitTCEntry(const MCSymbol &S) override {
if (const MCSymbolXCOFF *XSym = dyn_cast<MCSymbolXCOFF>(&S)) {
MCSymbolXCOFF *TCSym =
cast<MCSymbolXCOFF>(Streamer.getContext().getOrCreateSymbol(
XSym->getSymbolTableName() + "[TC]"));
cast<MCSectionXCOFF>(Streamer.getCurrentSectionOnly())
->getQualNameSymbol();
OS << "\t.tc " << TCSym->getName() << "," << XSym->getName() << '\n';

if (TCSym->hasRename())
Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1826,7 +1826,7 @@ void PPCAIXAsmPrinter::emitEndOfAsmFile(Module &M) {
for (auto &I : TOC) {
// Setup the csect for the current TC entry.
MCSectionXCOFF *TCEntry = cast<MCSectionXCOFF>(
getObjFileLowering().getSectionForTOCEntry(I.first));
getObjFileLowering().getSectionForTOCEntry(I.first, TM));
OutStreamer->SwitchSection(TCEntry);

OutStreamer->emitLabel(I.second);
Expand Down
14 changes: 12 additions & 2 deletions llvm/runtimes/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,11 @@ else() # if this is included from LLVM's CMake
endif()
endforeach()

# 64-bit XCOFF and big AR format is not yet supported in some of these tools.
if(NOT target MATCHES aix)
set(${target}_toolchain_tools lld llvm-ar llvm-lipo llvm-ranlib llvm-nm llvm-objcopy llvm-objdump llvm-strip)
endif()

llvm_ExternalProject_Add(builtins-${target}
${compiler_rt_path}/lib/builtins
DEPENDS ${ARG_DEPENDS}
Expand All @@ -287,7 +292,7 @@ else() # if this is included from LLVM's CMake
-DCMAKE_ASM_COMPILER_WORKS=ON
-DCOMPILER_RT_DEFAULT_TARGET_ONLY=ON
${${target}_extra_args}
TOOLCHAIN_TOOLS clang lld llvm-ar llvm-lipo llvm-ranlib llvm-nm llvm-objcopy llvm-objdump llvm-strip
TOOLCHAIN_TOOLS clang ${target}_toolchain_tools
USE_TOOLCHAIN
${EXTRA_ARGS})
endfunction()
Expand Down Expand Up @@ -487,6 +492,11 @@ else() # if this is included from LLVM's CMake
list(APPEND EXTRA_ARGS STRIP_TOOL ${CMAKE_CURRENT_BINARY_DIR}/llvm-strip-link)
endif()

# 64-bit XCOFF and big AR format is not yet supported in some of these tools.
if(NOT target MATCHES aix)
set(${name}_toolchain_tools lld llvm-ar llvm-lipo llvm-ranlib llvm-nm llvm-objcopy llvm-objdump llvm-strip)
endif()

llvm_ExternalProject_Add(runtimes-${name}
${CMAKE_CURRENT_SOURCE_DIR}
DEPENDS ${${name}_deps} ${CXX_HEADER_TARGET}
Expand All @@ -505,7 +515,7 @@ else() # if this is included from LLVM's CMake
-DCOMPILER_RT_DEFAULT_TARGET_ONLY=ON
-DLLVM_RUNTIMES_TARGET=${name}
${${name}_extra_args}
TOOLCHAIN_TOOLS clang lld llvm-ar llvm-lipo llvm-ranlib llvm-nm llvm-objcopy llvm-objdump llvm-strip
TOOLCHAIN_TOOLS clang ${{name}_toolchain_tools}
EXTRA_TARGETS ${${name}_extra_targets}
${${name}_test_targets}
USE_TOOLCHAIN
Expand Down
15 changes: 9 additions & 6 deletions llvm/test/CodeGen/PowerPC/aix-lower-block-address.ll
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@
; RUN: --check-prefix=64LARGE-MIR %s

; RUN: llc -verify-machineinstrs -mcpu=pwr7 -mtriple powerpc-ibm-aix-xcoff \
; RUN: -code-model=small < %s | FileCheck --check-prefixes=32SMALL-ASM,CHECK %s
; RUN: -code-model=small < %s | FileCheck --check-prefixes=32SMALL-ASM,SMALL-ASM %s

; RUN: llc -verify-machineinstrs -mcpu=pwr7 -mtriple powerpc-ibm-aix-xcoff \
; RUN: -code-model=large < %s | FileCheck --check-prefixes=32LARGE-ASM,CHECK %s
; RUN: -code-model=large < %s | FileCheck --check-prefixes=32LARGE-ASM,LARGE-ASM %s

; RUN: llc -verify-machineinstrs -mcpu=pwr7 -mtriple powerpc64-ibm-aix-xcoff \
; RUN: -code-model=small < %s | FileCheck --check-prefixes=64SMALL-ASM,CHECK %s
; RUN: -code-model=small < %s | FileCheck --check-prefixes=64SMALL-ASM,SMALL-ASM %s

; RUN: llc -verify-machineinstrs -mcpu=pwr7 -mtriple powerpc64-ibm-aix-xcoff \
; RUN: -code-model=large < %s | FileCheck --check-prefixes=64LARGE-ASM,CHECK %s
; RUN: -code-model=large < %s | FileCheck --check-prefixes=64LARGE-ASM,LARGE-ASM %s

define void @foo() {
entry:
Expand Down Expand Up @@ -68,5 +68,8 @@ __here:
; 64LARGE-ASM: addis [[REG1:[0-9]+]], L..C0@u(2)
; 64LARGE-ASM: ld [[REG2:[0-9]+]], L..C0@l([[REG1]])

; CHECK: .toc
; CHECK: .tc L..tmp0[TC],L..tmp0
; SMALL-ASM: .toc
; SMALL-ASM: .tc L..tmp0[TC],L..tmp0

; LARGE-ASM: .toc
; LARGE-ASM: .tc L..tmp0[TE],L..tmp0
15 changes: 9 additions & 6 deletions llvm/test/CodeGen/PowerPC/aix-lower-constant-pool-index.ll
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@
; RUN: --check-prefix=64LARGE-MIR %s

; RUN: llc -verify-machineinstrs -mcpu=pwr7 -mtriple powerpc-ibm-aix-xcoff \
; RUN: -code-model=small < %s | FileCheck --check-prefixes=32SMALL-ASM,CHECK %s
; RUN: -code-model=small < %s | FileCheck --check-prefixes=32SMALL-ASM,SMALL-ASM %s

; RUN: llc -verify-machineinstrs -mcpu=pwr7 -mtriple powerpc-ibm-aix-xcoff \
; RUN: -code-model=large < %s | FileCheck --check-prefixes=32LARGE-ASM,CHECK %s
; RUN: -code-model=large < %s | FileCheck --check-prefixes=32LARGE-ASM,LARGE-ASM %s

; RUN: llc -verify-machineinstrs -mcpu=pwr7 -mtriple powerpc64-ibm-aix-xcoff \
; RUN: -code-model=small < %s | FileCheck --check-prefixes=64SMALL-ASM,CHECK %s
; RUN: -code-model=small < %s | FileCheck --check-prefixes=64SMALL-ASM,SMALL-ASM %s

; RUN: llc -verify-machineinstrs -mcpu=pwr7 -mtriple powerpc64-ibm-aix-xcoff \
; RUN: -code-model=large < %s | FileCheck --check-prefixes=64LARGE-ASM,CHECK %s
; RUN: -code-model=large < %s | FileCheck --check-prefixes=64LARGE-ASM,LARGE-ASM %s

define float @test_float() {
entry:
Expand Down Expand Up @@ -83,5 +83,8 @@ entry:
; 64LARGE-ASM: lfs 1, 0([[REG2]])
; 64LARGE-ASM: blr

; CHECK: .toc
; CHECK: .tc L..CPI0_0[TC],L..CPI0_0
; SMALL-ASM: .toc
; SMALL-ASM: .tc L..CPI0_0[TC],L..CPI0_0

; LARGE-ASM: .toc
; LARGE-ASM: .tc L..CPI0_0[TE],L..CPI0_0
15 changes: 9 additions & 6 deletions llvm/test/CodeGen/PowerPC/aix-lower-jump-table.ll
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@
; RUN: --check-prefix=64LARGE-MIR %s

; RUN: llc -mtriple powerpc-ibm-aix-xcoff -code-model=small < %s | FileCheck \
; RUN: --check-prefixes=32SMALL-ASM,CHECK %s
; RUN: --check-prefixes=32SMALL-ASM,SMALL-ASM %s

; RUN: llc -mtriple powerpc-ibm-aix-xcoff -code-model=large < %s | FileCheck \
; RUN: --check-prefixes=32LARGE-ASM,CHECK %s
; RUN: --check-prefixes=32LARGE-ASM,LARGE-ASM %s

; RUN: llc -mtriple powerpc64-ibm-aix-xcoff -code-model=small < %s | FileCheck \
; RUN: --check-prefixes=64SMALL-ASM,CHECK %s
; RUN: --check-prefixes=64SMALL-ASM,SMALL-ASM %s

; RUN: llc -mtriple powerpc64-ibm-aix-xcoff -code-model=large < %s | FileCheck \
; RUN: --check-prefixes=64LARGE-ASM,CHECK %s
; RUN: --check-prefixes=64LARGE-ASM,LARGE-ASM %s

; RUN: llc -mtriple powerpc-ibm-aix-xcoff -function-sections < %s | FileCheck \
; RUN: --check-prefixes=FUNC-ASM,CHECK %s
Expand Down Expand Up @@ -206,5 +206,8 @@
; FUNC-ASM: .vbyte 4, L..BB0_4-L..JTI0_0
; FUNC-ASM: .vbyte 4, L..BB0_5-L..JTI0_0

; CHECK: .toc
; CHECK: .tc L..JTI0_0[TC],L..JTI0_0
; SMALL-ASM: .toc
; SMALL-ASM: .tc L..JTI0_0[TC],L..JTI0_0

; LARGE-ASM: .toc
; LARGE-ASM: .tc L..JTI0_0[TE],L..JTI0_0
11 changes: 7 additions & 4 deletions llvm/test/CodeGen/PowerPC/lower-globaladdr32-aix-asm.ll
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
; RUN: llc -verify-machineinstrs -mcpu=pwr7 -mtriple powerpc-ibm-aix-xcoff \
; RUN: -code-model=small < %s | FileCheck %s --check-prefixes=CHECK,SMALL
; RUN: -code-model=small < %s | FileCheck %s --check-prefix=SMALL

; RUN: llc -verify-machineinstrs -mcpu=pwr7 -mtriple powerpc-ibm-aix-xcoff \
; RUN: -code-model=large < %s | FileCheck %s --check-prefixes=CHECK,LARGE
; RUN: -code-model=large < %s | FileCheck %s --check-prefix=LARGE

@a = common global i32 0

Expand Down Expand Up @@ -41,5 +41,8 @@ define void @test_store(i32 %0) {
; LARGE: stw [[REG3:[0-9]+]], 0([[REG2]])
; LARGE: blr

; CHECK: .tc a[TC],a
; CHECK: .tc b[TC],b
; SMALL: .tc a[TC],a
; SMALL: .tc b[TC],b

; LARGE: .tc a[TE],a
; LARGE: .tc b[TE],b
11 changes: 7 additions & 4 deletions llvm/test/CodeGen/PowerPC/lower-globaladdr64-aix-asm.ll
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
; RUN: llc -verify-machineinstrs -mcpu=pwr7 -mtriple powerpc64-ibm-aix-xcoff \
; RUN: -code-model=small < %s | FileCheck %s --check-prefixes=CHECK,SMALL
; RUN: -code-model=small < %s | FileCheck %s --check-prefix=SMALL

; RUN: llc -verify-machineinstrs -mcpu=pwr7 -mtriple powerpc64-ibm-aix-xcoff \
; RUN: -code-model=large < %s | FileCheck %s --check-prefixes=CHECK,LARGE
; RUN: -code-model=large < %s | FileCheck %s --check-prefix=LARGE

@a = common global i32 0

Expand Down Expand Up @@ -41,5 +41,8 @@ define void @test_store(i32 zeroext %0) {
; LARGE: stw [[REG3:[0-9]+]], 0([[REG2]])
; LARGE: blr

; CHECK: .tc a[TC],a
; CHECK: .tc b[TC],b
; SMALL: .tc a[TC],a
; SMALL: .tc b[TC],b

; LARGE: .tc a[TE],a
; LARGE: .tc b[TE],b
13 changes: 13 additions & 0 deletions llvm/test/Transforms/InstSimplify/select.ll
Original file line number Diff line number Diff line change
Expand Up @@ -919,3 +919,16 @@ define <2 x i32> @all_constant_true_undef_false_constexpr_vec() {
%s = select i1 ptrtoint (<2 x i32> ()* @all_constant_true_undef_false_constexpr_vec to i1), <2 x i32> undef, <2 x i32><i32 -1, i32 ptrtoint (<2 x i32> ()* @all_constant_true_undef_false_constexpr_vec to i32)>
ret <2 x i32> %s
}

define i1 @expand_binop_undef(i32 %x, i32 %y) {
; CHECK-LABEL: @expand_binop_undef(
; CHECK-NEXT: [[CMP15:%.*]] = icmp slt i32 [[X:%.*]], [[Y:%.*]]
; CHECK-NEXT: ret i1 [[CMP15]]
;
%cmp9.not.1 = icmp eq i32 %x, %y
%cmp15 = icmp slt i32 %x, %y
%spec.select39 = select i1 %cmp9.not.1, i1 undef, i1 %cmp15
%spec.select40 = xor i1 %cmp9.not.1, 1
%spec.select = and i1 %spec.select39, %spec.select40
ret i1 %spec.select
}
2 changes: 1 addition & 1 deletion llvm/test/Transforms/InstSimplify/vscale.ll
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ define i32 @extractelement_idx_large_bound(<vscale x 4 x i32> %a) {
ret i32 %r
}

define i32 @insert_extract_element_same_vec_idx_2(<vscale x 4 x i32> %a) {
define i32 @insert_extract_element_same_vec_idx_2() {
; CHECK-LABEL: @insert_extract_element_same_vec_idx_2(
; CHECK-NEXT: ret i32 1
;
Expand Down
3 changes: 2 additions & 1 deletion llvm/test/tools/llvm-objcopy/ELF/strip-preserve-atime.test
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Note: ls -lu prints the accessed timestamp
# NetBSD: noatime mounts currently inhibit 'touch -a' updates
# UNSUPPORTED: system-netbsd
# Windows: the last access time is disabled by default in the OS
# UNSUPPORTED: system-netbsd, system-windows

# Preserve dates when stripping to an output file.
# RUN: yaml2obj %s -o %t.1.o
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,10 @@ class ConvertToLLVMPattern : public ConversionPattern {
ConversionPatternRewriter &rewriter,
SmallVectorImpl<Value> &sizes) const;

/// Computes the size of type in bytes.
Value getSizeInBytes(Location loc, Type type,
ConversionPatternRewriter &rewriter) const;

/// Computes total size in bytes of to store the given shape.
Value getCumulativeSizeInBytes(Location loc, Type elementType,
ArrayRef<Value> shape,
Expand Down
12 changes: 12 additions & 0 deletions mlir/include/mlir/Dialect/GPU/GPUOps.td
Original file line number Diff line number Diff line change
Expand Up @@ -741,4 +741,16 @@ def GPU_ModuleEndOp : GPU_Op<"module_end", [
let printer = [{ p << getOperationName(); }];
}

def GPU_HostRegisterOp : GPU_Op<"host_register">,
Arguments<(ins AnyUnrankedMemRef:$value)> {
let summary = "Registers a memref for access from device.";
let description = [{
This op registers the host memory pointed to by a memref to be accessed from
a device.
}];

let assemblyFormat = "$value attr-dict `:` type($value)";
let verifier = [{ return success(); }];
}

#endif // GPU_OPS
Loading

0 comments on commit 0f98b7a

Please sign in to comment.