LLVM
23.0.0git
include
llvm
Transforms
Vectorize
SandboxVectorizer
SandboxVectorizerIR.h
Go to the documentation of this file.
1
//===- SandboxVectorizerIR.h ------------------------------------*- 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
// This defines a SandboxIR specialization for the vectorizer.
10
//
11
12
#ifndef LLVM_TRANSFORMS_VECTORIZE_SANDBOXVEC_SANDBOXVECTORIZERIR_H
13
#define LLVM_TRANSFORMS_VECTORIZE_SANDBOXVEC_SANDBOXVECTORIZERIR_H
14
15
#include "
llvm/IR/LLVMContext.h
"
16
#include "
llvm/SandboxIR/Context.h
"
17
#include "
llvm/SandboxIR/Instruction.h
"
18
#include "
llvm/Support/ErrorHandling.h
"
19
20
namespace
llvm::sandboxir
{
21
22
class
SBVecContext
;
23
24
class
PackInst final :
public
Instruction
{
25
Use
getOperandUseInternal(
unsigned
OperandIdx,
bool
Verify
)
const
final
{
26
llvm_unreachable
(
"Unimplemented"
);
27
}
28
unsigned
getUseOperandNo(
const
Use
&
Use
)
const
final
{
29
llvm_unreachable
(
"Unimplemented"
);
30
}
31
SmallVector<llvm::Instruction *, 1>
getLLVMInstrs
()
const
final
{
32
llvm_unreachable
(
"Unimplemented"
);
33
}
34
unsigned
getNumOfIRInstrs
()
const
final
{
llvm_unreachable
(
"Unimplemented"
); }
35
36
friend
class
SBVecContext
;
37
PackInst(
ArrayRef<llvm::Instruction *>
LLVMInstrs,
Context
&
Ctx
)
38
:
Instruction
(
ClassID
::
Pack
,
Opcode
::
Pack
, LLVMInstrs[0],
Ctx
) {}
39
40
public
:
41
static
Value
*
create
(
ArrayRef<Value *>
PackOps,
InsertPosition
InsertBefore,
42
SBVecContext
&Ctx);
43
44
/// For isa/dyn_cast.
45
static
bool
classof
(
const
Value
*From);
46
};
47
48
class
SBVecContext
:
public
Context
{
49
// Pack
50
PackInst
*createPackInst(
ArrayRef<llvm::Instruction *>
PackInstrs);
51
friend
class
PackInst
;
// For createPackInst()
52
53
public
:
54
SBVecContext
(
llvm::LLVMContext
&
LLVMCtx
) :
Context
(
LLVMCtx
) {}
55
};
56
57
}
// namespace llvm::sandboxir
58
59
#endif
// LLVM_TRANSFORMS_VECTORIZE_SANDBOXVEC_SANDBOXVECTORIZERIR_H
LLVMContext.h
Verify
ppc ctr loops PowerPC CTR Loops Verify
Definition
PPCCTRLoopsVerify.cpp:72
Context.h
Instruction.h
llvm::ArrayRef
Represent a constant reference to an array (0 or more elements consecutively in memory),...
Definition
ArrayRef.h:39
llvm::LLVMContext
This is an important class for using LLVM in a threaded context.
Definition
LLVMContext.h:68
llvm::SmallVector
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
Definition
SmallVector.h:1223
llvm::sandboxir::Context
Definition
Context.h:33
llvm::sandboxir::Context::Context
LLVM_ABI Context(LLVMContext &LLVMCtx)
Definition
Context.cpp:647
llvm::sandboxir::Context::LLVMCtx
LLVMContext & LLVMCtx
Definition
Context.h:70
llvm::sandboxir::InsertPosition
Definition
Instruction.h:26
llvm::sandboxir::Instruction::getNumOfIRInstrs
virtual unsigned getNumOfIRInstrs() const =0
This is used by BasicBlock::iterator.
llvm::sandboxir::Instruction::Opcode
Opcode
Definition
Instruction.h:45
llvm::sandboxir::Instruction::getLLVMInstrs
virtual SmallVector< llvm::Instruction *, 1 > getLLVMInstrs() const =0
\Returns the LLVM IR Instructions that this SandboxIR maps to in program order.
llvm::sandboxir::Instruction::Instruction
Instruction(ClassID ID, Opcode Opc, llvm::Instruction *I, sandboxir::Context &SBCtx)
Definition
Instruction.h:57
llvm::sandboxir::PackInst::classof
static bool classof(const Value *From)
For isa/dyn_cast.
Definition
SandboxVectorizerIR.cpp:32
llvm::sandboxir::PackInst::create
static Value * create(ArrayRef< Value * > PackOps, InsertPosition InsertBefore, SBVecContext &Ctx)
Definition
SandboxVectorizerIR.cpp:15
llvm::sandboxir::PackInst::SBVecContext
friend class SBVecContext
Definition
SandboxVectorizerIR.h:36
llvm::sandboxir::Pack
Definition
Legality.h:240
llvm::sandboxir::SBVecContext
Definition
SandboxVectorizerIR.h:48
llvm::sandboxir::SBVecContext::SBVecContext
SBVecContext(llvm::LLVMContext &LLVMCtx)
Definition
SandboxVectorizerIR.h:54
llvm::sandboxir::SBVecContext::PackInst
friend class PackInst
Definition
SandboxVectorizerIR.h:51
llvm::sandboxir::Use
Represents a Def-use/Use-def edge in SandboxIR.
Definition
Use.h:33
llvm::sandboxir::Value
A SandboxIR Value has users. This is the base class.
Definition
Value.h:72
llvm::sandboxir::Value::Ctx
Context & Ctx
All values point to the context.
Definition
Value.h:201
llvm::sandboxir::Value::ClassID
ClassID
Definition
Value.h:74
ErrorHandling.h
llvm_unreachable
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
Definition
ErrorHandling.h:164
llvm::sandboxir
Definition
Argument.h:15
Generated on
for LLVM by
1.14.0