Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
hpvm-release
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
llvm
hpvm-release
Commits
29187952
Commit
29187952
authored
4 years ago
by
Akash Kothari
Browse files
Options
Downloads
Patches
Plain Diff
Combine HPVM and ApproxHPVM intrinsics table files
parent
ba914820
Branches
cpu_vector
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
hpvm/llvm_patches/include/IR/IntrinsicsApproxHPVM.td
+0
-311
0 additions, 311 deletions
hpvm/llvm_patches/include/IR/IntrinsicsApproxHPVM.td
hpvm/llvm_patches/include/IR/IntrinsicsHPVM.td
+103
-0
103 additions, 0 deletions
hpvm/llvm_patches/include/IR/IntrinsicsHPVM.td
with
103 additions
and
311 deletions
hpvm/llvm_patches/include/IR/IntrinsicsApproxHPVM.td
deleted
100644 → 0
+
0
−
311
View file @
ba914820
//===- IntrinsicsHPVM.td - Defines HPVM intrinsics ---------*- tablegen -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// This file defines all of the HPVM-specific intrinsics.
//
//===----------------------------------------------------------------------===//
let TargetPrefix = "hpvm" in {
/* All intrinsics start with "llvm.hpvm."
* As we do not want the compiler to mess with these intrinsics, we assume
* worst memory behavior for all these intrinsics.
*/
/* Initialization intrinsic -
* i8* llvm.hpvm.setup(function*);
*/
def int_hpvm_init : Intrinsic<[], [], []>;
/* Launch intrinsic - with streaming argument
* i8* llvm.hpvm.launch(i8*, ArgList*, i1);
*/
def int_hpvm_launch : Intrinsic<[llvm_ptr_ty], [llvm_ptr_ty,
llvm_ptr_ty, llvm_i1_ty], []>;
/* Push intrinsic - push data on streaming pipeline
* void llvm.hpvm.push(i8*, ArgList*);
*/
def int_hpvm_push : Intrinsic<[], [llvm_ptr_ty, llvm_ptr_ty], []>;
/* Pop intrinsic - pop data from streaming pipeline
* i8* llvm.hpvm.pop(i8*);
*/
def int_hpvm_pop : Intrinsic<[llvm_ptr_ty], [llvm_ptr_ty], []>;
/* Cleanup intrinsic -
* void llvm.hpvm.cleanup(i8*);
*/
def int_hpvm_cleanup : Intrinsic<[], [], []>;
/* Wait intrinsic -
* void llvm.hpvm.wait(graphID*);
*/
def int_hpvm_wait : Intrinsic<[], [llvm_ptr_ty], []>;
/* Track memory intrinsic -
* void llvm.hpvm.trackMemory(i8*, i64);
*/
def int_hpvm_trackMemory : Intrinsic<[], [llvm_ptr_ty, llvm_i64_ty], []>;
/* Track memory intrinsic -
* void llvm.hpvm.untrackMemory(i8*);
*/
def int_hpvm_untrackMemory : Intrinsic<[], [llvm_ptr_ty], []>;
/* Request memory intrinsic -
* void llvm.hpvm.requestMemory(i8*, i64);
*/
def int_hpvm_requestMemory : Intrinsic<[], [llvm_ptr_ty, llvm_i64_ty], []>;
/* Create Node intrinsic -
* i8* llvm.hpvm.createNode(function*);
*/
def int_hpvm_createNode : Intrinsic<[llvm_ptr_ty], [llvm_ptr_ty], []>;
/* Create Node 1D array intrinsic -
* i8* llvm.hpvm.createNode1D(function*, i64);
*/
def int_hpvm_createNode1D : Intrinsic<[llvm_ptr_ty], [llvm_ptr_ty,
llvm_i64_ty], []>;
/* Create Node 2D array intrinsic -
* i8* llvm.hpvm.createNode2D(function*, i64, i64);
*/
def int_hpvm_createNode2D : Intrinsic<[llvm_ptr_ty], [llvm_ptr_ty,
llvm_i64_ty, llvm_i64_ty], []>;
/* Create Node 3D array intrinsic -
* i8* llvm.hpvm.createNode2D(function*, i64, i64, i64);
*/
def int_hpvm_createNode3D : Intrinsic<[llvm_ptr_ty], [llvm_ptr_ty,
llvm_i64_ty, llvm_i64_ty, llvm_i64_ty],
[]>;
/* Create dataflow edge intrinsic -
* i8* llvm.hpvm.createEdge(i8*, i8*, i1, i32, i32, i1);
*/
def int_hpvm_createEdge : Intrinsic<[llvm_ptr_ty], [llvm_ptr_ty, llvm_ptr_ty,
llvm_i1_ty, llvm_i32_ty, llvm_i32_ty,
llvm_i1_ty],
[]>;
/* Create bind input intrinsic -
* void llvm.hpvm.bind.input(i8*, i32, i32);
*/
def int_hpvm_bind_input : Intrinsic<[], [llvm_ptr_ty, llvm_i32_ty,
llvm_i32_ty, llvm_i1_ty], []>;
/* Create bind output intrinsic -
* void llvm.hpvm.bind.output(i8*, i32, i32);
*/
def int_hpvm_bind_output : Intrinsic<[], [llvm_ptr_ty, llvm_i32_ty,
llvm_i32_ty, llvm_i1_ty], []>;
/* Find associated dataflow node intrinsic -
* i8* llvm.hpvm.getNode();
*/
def int_hpvm_getNode : Intrinsic<[llvm_ptr_ty], [], [IntrNoMem]>;
/* Find parent dataflow node intrinsic -
* i8* llvm.hpvm.getParentNode(i8*);
*/
def int_hpvm_getParentNode : Intrinsic<[llvm_ptr_ty], [llvm_ptr_ty], [IntrNoMem]>;
/* Find the number of dimensions of a dataflow node intrinsic -
* i32 llvm.hpvm.getNumDims(i8*);
*/
def int_hpvm_getNumDims : Intrinsic<[llvm_i32_ty], [llvm_ptr_ty], [IntrNoMem]>;
/* Find the unique indentifier of a dataflow node (with respect to his parent
* node) in the specified dimension intrinsic -
*/
/* i64 llvm.hpvm.getNodeInstanceID.[xyz](i8*);
*/
def int_hpvm_getNodeInstanceID_x : Intrinsic<[llvm_i64_ty], [llvm_ptr_ty],
[IntrNoMem]>;
def int_hpvm_getNodeInstanceID_y : Intrinsic<[llvm_i64_ty], [llvm_ptr_ty],
[IntrNoMem]>;
def int_hpvm_getNodeInstanceID_z : Intrinsic<[llvm_i64_ty], [llvm_ptr_ty],
[IntrNoMem]>;
/* Find the number of instances of a dataflow node in the specified dimension
* intrinsic -
*/
/* i64 llvm.hpvm.getNumNodeInstances.[xyz](i8*);
*/
def int_hpvm_getNumNodeInstances_x : Intrinsic<[llvm_i64_ty], [llvm_ptr_ty],
[IntrNoMem]>;
def int_hpvm_getNumNodeInstances_y : Intrinsic<[llvm_i64_ty], [llvm_ptr_ty],
[IntrNoMem]>;
def int_hpvm_getNumNodeInstances_z : Intrinsic<[llvm_i64_ty], [llvm_ptr_ty],
[IntrNoMem]>;
/* Local Barrier
* void llvm.hpvm.barrier();
*/
def int_hpvm_barrier : Intrinsic<[], [], []>;
/* Memory allocation inside the graph
* i8* llvm.hpvm.malloc();
*/
def int_hpvm_malloc : Intrinsic<[llvm_ptr_ty], [llvm_i64_ty], []>;
/* Find the vector length supported by target architecture
* intrinsic -
* i32 llvm.hpvm.getVectorLength();
*/
def int_hpvm_getVectorLength : Intrinsic<[llvm_i32_ty], [], []>;
/* ============ Atomic intrinsics ============= */
// Atomic arithmetic operations
/* i32 llvm.hpvm.atomic.add(i32*, i32)*/
def int_hpvm_atomic_add: Intrinsic<[llvm_i32_ty], [llvm_ptr_ty, llvm_i32_ty],
[]>;
/* i32 llvm.hpvm.atomic.sub(i32*, i32)*/
def int_hpvm_atomic_sub: Intrinsic<[llvm_i32_ty], [llvm_ptr_ty, llvm_i32_ty],
[]>;
/* i32 llvm.hpvm.atomic.xchg(i32*, i32)*/
def int_hpvm_atomic_xchg: Intrinsic<[llvm_i32_ty], [llvm_ptr_ty, llvm_i32_ty],
[]>;
/* i32 llvm.hpvm.atomic.min(i32*, i32)*/
def int_hpvm_atomic_min: Intrinsic<[llvm_i32_ty], [llvm_ptr_ty, llvm_i32_ty],
[]>;
/* i32 llvm.hpvm.atomic.maxi32*, i32)*/
def int_hpvm_atomic_max: Intrinsic<[llvm_i32_ty], [llvm_ptr_ty, llvm_i32_ty],
[]>;
// Atomic bitwise operations
/* i32 llvm.hpvm.atomic.and(i32*, i32)*/
def int_hpvm_atomic_and: Intrinsic<[llvm_i32_ty], [llvm_ptr_ty, llvm_i32_ty],
[]>;
/* i32 llvm.hpvm.atomic.or(i32*, i32)*/
def int_hpvm_atomic_or: Intrinsic<[llvm_i32_ty], [llvm_ptr_ty, llvm_i32_ty],
[]>;
/* i32 llvm.hpvm.atomic.xor(i32*, i32)*/
def int_hpvm_atomic_xor: Intrinsic<[llvm_i32_ty], [llvm_ptr_ty, llvm_i32_ty],
[]>;
/***************************************************************************/
/* ApproxHPVM intrinsics */
/***************************************************************************/
/* Tensor add intrinsic
* i8* llvm.hpvm.tensor.add(i8*, i8*);
*/
def int_hpvm_tensor_add : Intrinsic<[llvm_ptr_ty], [llvm_ptr_ty,
llvm_ptr_ty], []>;
/* Tensor mul intrinsic
* i8* llvm.hpvm.tensor.mul(i8*, i8*);
*/
def int_hpvm_tensor_mul : Intrinsic<[llvm_ptr_ty], [llvm_ptr_ty,
llvm_ptr_ty], []>;
/* Tensor relu intrinsic
* i8* llvm.hpvm.tensor.relu(i8*);
*/
def int_hpvm_tensor_relu : Intrinsic<[llvm_ptr_ty], [llvm_ptr_ty], []>;
/* Tensor clipped relu intrinsic
* i8* llvm.hpvm.tensor.clipped.relu(i8*);
*/
def int_hpvm_tensor_clipped_relu : Intrinsic<[llvm_ptr_ty], [llvm_ptr_ty], []>;
/* Tensor tanh intrinsic
* i8* llvm.hpvm.tensor.tanh(i8*);
*/
def int_hpvm_tensor_tanh : Intrinsic<[llvm_ptr_ty], [llvm_ptr_ty], []>;
/* Tensor sigmoid intrinsic
* i8* llvm.hpvm.tensor.sigmoid(i8*);
*/
def int_hpvm_tensor_sigmoid : Intrinsic<[llvm_ptr_ty], [llvm_ptr_ty], []>;
/* Tensor softmax intrinsic
* i8* llvm.hpvm.tensor.softmax(i8*);
*/
def int_hpvm_tensor_softmax : Intrinsic<[llvm_ptr_ty], [llvm_ptr_ty], []>;
/* Tensor convolution intrinsic
* i8* llvm.hpvm.tensor.convolution(i8*, i8*, i32, i32, i32, i32);
*/
def int_hpvm_tensor_convolution : Intrinsic<[llvm_ptr_ty], [llvm_ptr_ty,
llvm_ptr_ty,
llvm_i32_ty,
llvm_i32_ty,
llvm_i32_ty,
llvm_i32_ty], []>;
/* Tensor group convolution intrinsic
* i8* llvm.hpvm.tensor.group.convolution(i8*, i8*, i32, i32, i32, i32, i32, i32);
*/
def int_hpvm_tensor_group_convolution : Intrinsic<[llvm_ptr_ty], [llvm_ptr_ty,
llvm_ptr_ty,
llvm_i32_ty,
llvm_i32_ty,
llvm_i32_ty,
llvm_i32_ty,
llvm_i32_ty,
llvm_i32_ty], []>;
/* Tensor BatchNorm intrinsic
* i8* llvm.hpvm.tensor.batchnorm(i8*, i8*, i8*, i8*, i8*, double);
*/
def int_hpvm_tensor_batchnorm : Intrinsic<[llvm_ptr_ty], [llvm_ptr_ty,
llvm_ptr_ty,
llvm_ptr_ty,
llvm_ptr_ty,
llvm_ptr_ty,
llvm_double_ty], []>;
/* Tensor pool intrinsics: max, min, average
* i8* llvm.hpvm.tensor.pool.max(i8*, i32, i32, i32, i32, i32, i32);
* i8* llvm.hpvm.tensor.pool.min(i8*, i32, i32, i32, i32, i32, i32);
* i8* llvm.hpvm.tensor.pool.average(i8*, i32, i32, i32, i32, i32, i32);
*/
def int_hpvm_tensor_pool_max : Intrinsic<[llvm_ptr_ty], [llvm_ptr_ty,
llvm_i32_ty,
llvm_i32_ty,
llvm_i32_ty,
llvm_i32_ty,
llvm_i32_ty,
llvm_i32_ty], []>;
def int_hpvm_tensor_pool_min : Intrinsic<[llvm_ptr_ty], [llvm_ptr_ty,
llvm_i32_ty,
llvm_i32_ty,
llvm_i32_ty,
llvm_i32_ty,
llvm_i32_ty,
llvm_i32_ty], []>;
def int_hpvm_tensor_pool_mean : Intrinsic<[llvm_ptr_ty], [llvm_ptr_ty,
llvm_i32_ty,
llvm_i32_ty,
llvm_i32_ty,
llvm_i32_ty,
llvm_i32_ty,
llvm_i32_ty], []>;
def int_hpvm_node_id : Intrinsic<[llvm_ptr_ty], [llvm_i32_ty], []>;
}
This diff is collapsed.
Click to expand it.
hpvm/llvm_patches/include/IR/IntrinsicsHPVM.td
+
103
−
0
View file @
29187952
...
@@ -205,4 +205,107 @@ let TargetPrefix = "hpvm" in {
...
@@ -205,4 +205,107 @@ let TargetPrefix = "hpvm" in {
def int_hpvm_atomic_xor: Intrinsic<[llvm_i32_ty], [llvm_ptr_ty, llvm_i32_ty],
def int_hpvm_atomic_xor: Intrinsic<[llvm_i32_ty], [llvm_ptr_ty, llvm_i32_ty],
[]>;
[]>;
/***************************************************************************/
/* ApproxHPVM intrinsics */
/***************************************************************************/
/* Tensor add intrinsic
* i8* llvm.hpvm.tensor.add(i8*, i8*);
*/
def int_hpvm_tensor_add : Intrinsic<[llvm_ptr_ty], [llvm_ptr_ty,
llvm_ptr_ty], []>;
/* Tensor mul intrinsic
* i8* llvm.hpvm.tensor.mul(i8*, i8*);
*/
def int_hpvm_tensor_mul : Intrinsic<[llvm_ptr_ty], [llvm_ptr_ty,
llvm_ptr_ty], []>;
/* Tensor relu intrinsic
* i8* llvm.hpvm.tensor.relu(i8*);
*/
def int_hpvm_tensor_relu : Intrinsic<[llvm_ptr_ty], [llvm_ptr_ty], []>;
/* Tensor clipped relu intrinsic
* i8* llvm.hpvm.tensor.clipped.relu(i8*);
*/
def int_hpvm_tensor_clipped_relu : Intrinsic<[llvm_ptr_ty], [llvm_ptr_ty], []>;
/* Tensor tanh intrinsic
* i8* llvm.hpvm.tensor.tanh(i8*);
*/
def int_hpvm_tensor_tanh : Intrinsic<[llvm_ptr_ty], [llvm_ptr_ty], []>;
/* Tensor sigmoid intrinsic
* i8* llvm.hpvm.tensor.sigmoid(i8*);
*/
def int_hpvm_tensor_sigmoid : Intrinsic<[llvm_ptr_ty], [llvm_ptr_ty], []>;
/* Tensor softmax intrinsic
* i8* llvm.hpvm.tensor.softmax(i8*);
*/
def int_hpvm_tensor_softmax : Intrinsic<[llvm_ptr_ty], [llvm_ptr_ty], []>;
/* Tensor convolution intrinsic
* i8* llvm.hpvm.tensor.convolution(i8*, i8*, i32, i32, i32, i32);
*/
def int_hpvm_tensor_convolution : Intrinsic<[llvm_ptr_ty], [llvm_ptr_ty,
llvm_ptr_ty,
llvm_i32_ty,
llvm_i32_ty,
llvm_i32_ty,
llvm_i32_ty], []>;
/* Tensor group convolution intrinsic
* i8* llvm.hpvm.tensor.group.convolution(i8*, i8*, i32, i32, i32, i32, i32, i32);
*/
def int_hpvm_tensor_group_convolution : Intrinsic<[llvm_ptr_ty], [llvm_ptr_ty,
llvm_ptr_ty,
llvm_i32_ty,
llvm_i32_ty,
llvm_i32_ty,
llvm_i32_ty,
llvm_i32_ty,
llvm_i32_ty], []>;
/* Tensor BatchNorm intrinsic
* i8* llvm.hpvm.tensor.batchnorm(i8*, i8*, i8*, i8*, i8*, double);
*/
def int_hpvm_tensor_batchnorm : Intrinsic<[llvm_ptr_ty], [llvm_ptr_ty,
llvm_ptr_ty,
llvm_ptr_ty,
llvm_ptr_ty,
llvm_ptr_ty,
llvm_double_ty], []>;
/* Tensor pool intrinsics: max, min, average
* i8* llvm.hpvm.tensor.pool.max(i8*, i32, i32, i32, i32, i32, i32);
* i8* llvm.hpvm.tensor.pool.min(i8*, i32, i32, i32, i32, i32, i32);
* i8* llvm.hpvm.tensor.pool.average(i8*, i32, i32, i32, i32, i32, i32);
*/
def int_hpvm_tensor_pool_max : Intrinsic<[llvm_ptr_ty], [llvm_ptr_ty,
llvm_i32_ty,
llvm_i32_ty,
llvm_i32_ty,
llvm_i32_ty,
llvm_i32_ty,
llvm_i32_ty], []>;
def int_hpvm_tensor_pool_min : Intrinsic<[llvm_ptr_ty], [llvm_ptr_ty,
llvm_i32_ty,
llvm_i32_ty,
llvm_i32_ty,
llvm_i32_ty,
llvm_i32_ty,
llvm_i32_ty], []>;
def int_hpvm_tensor_pool_mean : Intrinsic<[llvm_ptr_ty], [llvm_ptr_ty,
llvm_i32_ty,
llvm_i32_ty,
llvm_i32_ty,
llvm_i32_ty,
llvm_i32_ty,
llvm_i32_ty], []>;
def int_hpvm_node_id : Intrinsic<[llvm_ptr_ty], [llvm_i32_ty], []>;
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment