Skip to content
Snippets Groups Projects
Commit 995298b7 authored by kotsifa2's avatar kotsifa2
Browse files

Added debug messages in dfg2llvm-nvptx pass.

Edited makefiles.
parent e14ab6ef
No related branches found
No related tags found
No related merge requests found
......@@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
#define ENABLE_ASSERTS
#define DEBUG_TYPE "DFG2LLVM_NVPTX"
#include "llvm/IR/Module.h"
#include "llvm/Pass.h"
......@@ -134,6 +136,7 @@ namespace {
switch (II->getIntrinsicID()) {
/**************************** llvm.visc.getNode() *****************************/
case Intrinsic::visc_getNode: {
DEBUG(errs() << F_nvptx->getName() << "\t: Handling getNode\n");
// add mapping <intrinsic, this node> to the node-specific map
Leaf_HandleToDFNodeMap[II] = N;
IItoRemove.push_back(II);
......@@ -141,6 +144,7 @@ namespace {
break;
/************************* llvm.visc.getParentNode() **************************/
case Intrinsic::visc_getParentNode: {
DEBUG(errs() << F_nvptx->getName() << "\t: Handling getParentNode\n");
// get the parent node of the arg node
// get argument node
ArgII = cast<IntrinsicInst>((II->getOperand(0))->stripPointerCasts());
......@@ -156,6 +160,7 @@ namespace {
break;
/*************************** llvm.visc.getNumDims() ***************************/
case Intrinsic::visc_getNumDims: {
DEBUG(errs() << F_nvptx->getName() << "\t: Handling getNumDims\n");
// get node from map
// get the appropriate field
int numOfDim = Leaf_HandleToDFNodeMap[ArgII]->getNumOfDim();
......@@ -172,6 +177,7 @@ namespace {
case Intrinsic::visc_getNodeInstanceID_x:
case Intrinsic::visc_getNodeInstanceID_y:
case Intrinsic::visc_getNodeInstanceID_z: {
DEBUG(errs() << F_nvptx->getName() << "\t: Handling getNodeInstanceID\n");
ArgII = cast<IntrinsicInst>((II->getOperand(0))->stripPointerCasts());
ArgDFNode = Leaf_HandleToDFNodeMap[ArgII];
// A leaf node always has a parent
......@@ -238,12 +244,12 @@ namespace {
case Intrinsic::visc_getNumNodeInstances_x:
case Intrinsic::visc_getNumNodeInstances_y:
case Intrinsic::visc_getNumNodeInstances_z: {
//TODO: think about whether this is the best way to go
// there are hw specific registers. therefore it is good to have the intrinsic
// but then, why do we need to keep that info in the graph?
// (only for the kernel configuration during the call)
DEBUG(errs() << F_nvptx->getName() << "\t: Handling getNumNodeInstances\n");
ArgII = cast<IntrinsicInst>((II->getOperand(0))->stripPointerCasts());
ArgDFNode = Leaf_HandleToDFNodeMap[ArgII];
// A leaf node always has a parent
......
......@@ -10,7 +10,7 @@
LEVEL = ../../../
LIBRARYNAME = LLVMDFG2LLVM_NVPTX
LOADABLE_MODULE = 1
SHARED_LIBRARY = 1
#SHARED_LIBRARY = 1
#BUILD_ARCHIVE = 1
#USEDLIBS =
......
......@@ -9,7 +9,7 @@
LEVEL = ../..
PARALLEL_DIRS = Utils Instrumentation Scalar InstCombine IPO Vectorize Hello \
ObjCARC BuildDFG DFG2LLVM_NVPTX
ObjCARC BuildDFG DFG2LLVM_NVPTX DFG2LLVM_X86
include $(LEVEL)/Makefile.config
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment