fixed merging
This commit is contained in:
@@ -2,8 +2,8 @@
|
||||
#include <map>
|
||||
#include <unordered_set>
|
||||
#include <string>
|
||||
#include <numeric>
|
||||
|
||||
#include "utils.h"
|
||||
#include "range_structures.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
@@ -146,7 +146,7 @@ static int GetDefUseArray(SAPFOR::BasicBlock* block, LoopGraph* loop, ArrayAcces
|
||||
{
|
||||
auto var = index_vars.back();
|
||||
int currentVarPos = refPos.back();
|
||||
pair currentCoefs = coefsForDims.back();
|
||||
pair<int, int> currentCoefs = coefsForDims.back();
|
||||
ArrayDimension current_dim;
|
||||
if (var->getType() == SAPFOR::CFG_ARG_TYPE::CONST)
|
||||
current_dim = { stoul(var->getValue()), 1, 1 };
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
#include "expr_transform.h"
|
||||
#include "errors.h"
|
||||
#include "SgUtils.h"
|
||||
#include "utils.h"
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <queue>
|
||||
@@ -17,19 +18,6 @@ using std::make_pair;
|
||||
using std::queue;
|
||||
using std::wstring;
|
||||
|
||||
static int gcd(int a, int b)
|
||||
{
|
||||
while (a != b)
|
||||
{
|
||||
if (a > b)
|
||||
a = a - b;
|
||||
else
|
||||
b = b - a;
|
||||
}
|
||||
|
||||
return a;
|
||||
}
|
||||
|
||||
static SgSymbol* getLoopSymbol(const LoopGraph* loop)
|
||||
{
|
||||
if (!loop || !loop->isFor)
|
||||
@@ -1385,7 +1373,6 @@ static int getNewStep(SgForStmt* firstLoopStmt, SgForStmt* loopStmt)
|
||||
step2Val = step2->valueInteger();
|
||||
|
||||
int stepGcd = gcd(std::abs(step1Val), std::abs(step2Val));
|
||||
|
||||
int newStep = stepGcd;
|
||||
|
||||
int startDifference = 0;
|
||||
|
||||
@@ -101,3 +101,16 @@ std::set<std::string> fillDistributedArrays(const DataDirective& dataDirectives,
|
||||
|
||||
void copyStringToShort(short*& result, const std::string& resVal, bool withEnd = true);
|
||||
void dumpMessages(bool inCatch, const std::map<std::string, std::vector<Messages>>& messages, const char* vis_path);
|
||||
|
||||
template<typename T>
|
||||
inline T gcd(T a, T b)
|
||||
{
|
||||
while (a != b)
|
||||
{
|
||||
if (a > b)
|
||||
a = a - b;
|
||||
else
|
||||
b = b - a;
|
||||
}
|
||||
return a;
|
||||
}
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
#pragma once
|
||||
|
||||
#define VERSION_SPF "2423"
|
||||
#define VERSION_SPF "2424"
|
||||
|
||||
Reference in New Issue
Block a user