提交 a6d3f303 编写于 作者: H hanhuifeng2020

fix bug that extra pipe_barrier inserted in the loop

上级 5a35fac5
...@@ -471,12 +471,11 @@ class DFVisitor : public IRVisitor { ...@@ -471,12 +471,11 @@ class DFVisitor : public IRVisitor {
/** /**
* Check whether meminfo has necessary args for calculating stride. * Check whether meminfo has necessary args for calculating stride.
*/ */
bool checkAllMemInfoExists(const IntImm *offset, const IntImm *extent, const IntImm *typeSize, bool checkAllMemInfoExists(const IntImm *offset, const IntImm *typeSize, const IntImm *repeatTime,
const IntImm *repeatTime, const IntImm *repeatStride, const IntImm *blockNumber, const IntImm *repeatStride, const IntImm *blockNumber, const IntImm *blockStride,
const IntImm *blockStride, const IntImm *blockSize) const { const IntImm *blockSize) const {
return ((offset != nullptr) && (extent != nullptr) && (typeSize != nullptr) && (repeatTime != nullptr) && return ((offset != nullptr) && (typeSize != nullptr) && (repeatTime != nullptr) && (repeatStride != nullptr) &&
(repeatStride != nullptr) && (blockNumber != nullptr) && (blockStride != nullptr) && (blockNumber != nullptr) && (blockStride != nullptr) && (blockSize != nullptr));
(blockSize != nullptr));
} }
/** /**
...@@ -530,7 +529,6 @@ class DFVisitor : public IRVisitor { ...@@ -530,7 +529,6 @@ class DFVisitor : public IRVisitor {
CHECK(offsetIntImmOfA->value >= 0) << "offset A must be Non-negative number"; CHECK(offsetIntImmOfA->value >= 0) << "offset A must be Non-negative number";
Expr typeSizeExprOfA = make_const(a.offset.type(), a.type.bytes()); Expr typeSizeExprOfA = make_const(a.offset.type(), a.type.bytes());
const auto extentIntImmOfA = a.extent.as<IntImm>();
const auto typeSizeIntImmOfA = typeSizeExprOfA.as<IntImm>(); const auto typeSizeIntImmOfA = typeSizeExprOfA.as<IntImm>();
const auto repeatTimeIntImmOfA = a.repeatTime.as<IntImm>(); const auto repeatTimeIntImmOfA = a.repeatTime.as<IntImm>();
const auto repeatStrideIntImmOfA = a.repeatStride.as<IntImm>(); const auto repeatStrideIntImmOfA = a.repeatStride.as<IntImm>();
...@@ -539,7 +537,6 @@ class DFVisitor : public IRVisitor { ...@@ -539,7 +537,6 @@ class DFVisitor : public IRVisitor {
const auto blockSizeIntImmOfA = a.blockSize.as<IntImm>(); const auto blockSizeIntImmOfA = a.blockSize.as<IntImm>();
Expr typeSizeExprOfB = make_const(b.offset.type(), b.type.bytes()); Expr typeSizeExprOfB = make_const(b.offset.type(), b.type.bytes());
const auto extentIntImmOfB = b.extent.as<IntImm>();
const auto typeSizeIntImmOfB = typeSizeExprOfB.as<IntImm>(); const auto typeSizeIntImmOfB = typeSizeExprOfB.as<IntImm>();
const auto repeatTimeIntImmOfB = b.repeatTime.as<IntImm>(); const auto repeatTimeIntImmOfB = b.repeatTime.as<IntImm>();
const auto repeatStrideIntImmOfB = b.repeatStride.as<IntImm>(); const auto repeatStrideIntImmOfB = b.repeatStride.as<IntImm>();
...@@ -549,10 +546,10 @@ class DFVisitor : public IRVisitor { ...@@ -549,10 +546,10 @@ class DFVisitor : public IRVisitor {
// if checkResult is true, it means there is enough info to calc stride. If not, func will return overlap(default). // if checkResult is true, it means there is enough info to calc stride. If not, func will return overlap(default).
bool checkResult = bool checkResult =
checkAllMemInfoExists(offsetIntImmOfA, extentIntImmOfA, typeSizeIntImmOfA, repeatTimeIntImmOfA, checkAllMemInfoExists(offsetIntImmOfA, typeSizeIntImmOfA, repeatTimeIntImmOfA, repeatStrideIntImmOfA,
repeatStrideIntImmOfA, blockNumberIntImmOfA, blockStrideIntImmOfA, blockSizeIntImmOfA) && blockNumberIntImmOfA, blockStrideIntImmOfA, blockSizeIntImmOfA) &&
checkAllMemInfoExists(offsetIntImmOfB, extentIntImmOfB, typeSizeIntImmOfB, repeatTimeIntImmOfB, checkAllMemInfoExists(offsetIntImmOfB, typeSizeIntImmOfB, repeatTimeIntImmOfB, repeatStrideIntImmOfB,
repeatStrideIntImmOfB, blockNumberIntImmOfB, blockStrideIntImmOfB, blockSizeIntImmOfB); blockNumberIntImmOfB, blockStrideIntImmOfB, blockSizeIntImmOfB);
if (!checkResult) { if (!checkResult) {
return true; return true;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册