LLVM 23.0.0git
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"
19
20namespace llvm::sandboxir {
21
22class SBVecContext;
23
24class 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 }
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
40public:
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
48class SBVecContext : public Context {
49 // Pack
50 PackInst *createPackInst(ArrayRef<llvm::Instruction *> PackInstrs);
51 friend class PackInst; // For createPackInst()
52
53public:
55};
56
57} // namespace llvm::sandboxir
58
59#endif // LLVM_TRANSFORMS_VECTORIZE_SANDBOXVEC_SANDBOXVECTORIZERIR_H
ppc ctr loops PowerPC CTR Loops Verify
Represent a constant reference to an array (0 or more elements consecutively in memory),...
Definition ArrayRef.h:39
This is an important class for using LLVM in a threaded context.
Definition LLVMContext.h:68
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
LLVM_ABI Context(LLVMContext &LLVMCtx)
Definition Context.cpp:647
LLVMContext & LLVMCtx
Definition Context.h:70
virtual unsigned getNumOfIRInstrs() const =0
This is used by BasicBlock::iterator.
virtual SmallVector< llvm::Instruction *, 1 > getLLVMInstrs() const =0
\Returns the LLVM IR Instructions that this SandboxIR maps to in program order.
Instruction(ClassID ID, Opcode Opc, llvm::Instruction *I, sandboxir::Context &SBCtx)
Definition Instruction.h:57
static bool classof(const Value *From)
For isa/dyn_cast.
static Value * create(ArrayRef< Value * > PackOps, InsertPosition InsertBefore, SBVecContext &Ctx)
SBVecContext(llvm::LLVMContext &LLVMCtx)
Represents a Def-use/Use-def edge in SandboxIR.
Definition Use.h:33
A SandboxIR Value has users. This is the base class.
Definition Value.h:72
Context & Ctx
All values point to the context.
Definition Value.h:201
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.