LLVM 20.0.0git
AMDGPUAsanInstrumentation.h
Go to the documentation of this file.
1//===AMDGPUAsanInstrumentation.h - ASAN helper functions -*- C++- *===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===--------------------------------------------------------------===//
8
9#ifndef LLVM_LIB_TARGET_AMDGPU_UTILS_AMDGPU_ASAN_INSTRUMENTATION_H
10#define LLVM_LIB_TARGET_AMDGPU_UTILS_AMDGPU_ASAN_INSTRUMENTATION_H
11
12#include "AMDGPU.h"
17#include "llvm/ADT/StringMap.h"
18#include "llvm/ADT/StringRef.h"
19#include "llvm/IR/Constants.h"
21#include "llvm/IR/IRBuilder.h"
23#include "llvm/IR/IntrinsicsAMDGPU.h"
24#include "llvm/IR/MDBuilder.h"
26#include "llvm/Pass.h"
28#include "llvm/Support/Debug.h"
35
36namespace llvm {
37namespace AMDGPU {
38
39/// Given SizeInBytes of the Value to be instrunmented,
40/// Returns the redzone size corresponding to it.
41uint64_t getRedzoneSizeForGlobal(int Scale, uint64_t SizeInBytes);
42
43/// Instrument the memory operand Addr.
44/// Generates report blocks that catch the addressing errors.
45void instrumentAddress(Module &M, IRBuilder<> &IRB, Instruction *OrigIns,
46 Instruction *InsertBefore, Value *Addr,
47 MaybeAlign Alignment, uint32_t TypeStoreSize,
48 bool IsWrite, Value *SizeArgument, bool UseCalls,
49 bool Recover, int Scale, int Offset);
50
51/// Get all the memory operands from the instruction
52/// that needs to be instrumented
54 Module &M, Instruction *I,
55 SmallVectorImpl<InterestingMemoryOperand> &Interesting);
56
57} // end namespace AMDGPU
58} // end namespace llvm
59
60#endif // LLVM_LIB_TARGET_AMDGPU_UTILS_AMDGPU_ASAN_INSTRUMENTATION_H
This file defines the StringMap class.
This file contains the declarations for the subclasses of Constant, which represent the different fla...
uint64_t Addr
#define I(x, y, z)
Definition: MD5.cpp:58
This file provides an interface for laying out a sequence of fields as a struct in a way that attempt...
This file defines generic set operations that may be used on set's of different types,...
This file contains some functions that are useful when dealing with strings.
void getInterestingMemoryOperands(Module &M, Instruction *I, SmallVectorImpl< InterestingMemoryOperand > &Interesting)
Get all the memory operands from the instruction that needs to be instrumented.
void instrumentAddress(Module &M, IRBuilder<> &IRB, Instruction *OrigIns, Instruction *InsertBefore, Value *Addr, MaybeAlign Alignment, uint32_t TypeStoreSize, bool IsWrite, Value *SizeArgument, bool UseCalls, bool Recover, int AsanScale, int AsanOffset)
Instrument the memory operand Addr.
uint64_t getRedzoneSizeForGlobal(int AsanScale, uint64_t SizeInBytes)
Given SizeInBytes of the Value to be instrunmented, Returns the redzone size corresponding to it.
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
@ Offset
Definition: DWP.cpp:480