summaryrefslogtreecommitdiffstats
path: root/mlir/lib/Transforms/Utils/GreedyPatternRewriteDriver.cpp
diff options
context:
space:
mode:
authorRiver Riddle <riverriddle@google.com>2018-10-25 15:46:10 -0700
committerjpienaar <jpienaar@google.com>2019-03-29 13:39:19 -0700
commit792d1c25e4ca1b5920ebe5759de25f39f9ea1658 (patch)
tree29603a324587597be4c8bdcf8be5405d5909a1b9 /mlir/lib/Transforms/Utils/GreedyPatternRewriteDriver.cpp
parent64d52014bd225944309b0dee94ad3a39c9bf3cb9 (diff)
downloadbcm5719-llvm-792d1c25e4ca1b5920ebe5759de25f39f9ea1658.tar.gz
bcm5719-llvm-792d1c25e4ca1b5920ebe5759de25f39f9ea1658.zip
Implement value type abstraction for attributes.
This is done by changing Attribute to be a POD interface around an underlying pointer storage and adding in-class support for isa/dyn_cast/cast. PiperOrigin-RevId: 218764173
Diffstat (limited to 'mlir/lib/Transforms/Utils/GreedyPatternRewriteDriver.cpp')
-rw-r--r--mlir/lib/Transforms/Utils/GreedyPatternRewriteDriver.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/mlir/lib/Transforms/Utils/GreedyPatternRewriteDriver.cpp b/mlir/lib/Transforms/Utils/GreedyPatternRewriteDriver.cpp
index 5ed8eac323e..44b211f1af9 100644
--- a/mlir/lib/Transforms/Utils/GreedyPatternRewriteDriver.cpp
+++ b/mlir/lib/Transforms/Utils/GreedyPatternRewriteDriver.cpp
@@ -79,7 +79,7 @@ private:
/// As part of canonicalization, we move constants to the top of the entry
/// block of the current function and de-duplicate them. This keeps track of
/// constants we have done this for.
- DenseMap<std::pair<Attribute *, Type *>, Operation *> uniquedConstants;
+ DenseMap<std::pair<Attribute, Type *>, Operation *> uniquedConstants;
};
}; // end anonymous namespace
@@ -107,7 +107,7 @@ public:
void GreedyPatternRewriteDriver::simplifyFunction(Function *currentFunction,
WorklistRewriter &rewriter) {
// These are scratch vectors used in the constant folding loop below.
- SmallVector<Attribute *, 8> operandConstants, resultConstants;
+ SmallVector<Attribute, 8> operandConstants, resultConstants;
while (!worklist.empty()) {
auto *op = popFromWorklist();
@@ -175,7 +175,7 @@ void GreedyPatternRewriteDriver::simplifyFunction(Function *currentFunction,
// the operation knows how to constant fold itself.
operandConstants.clear();
for (auto *operand : op->getOperands()) {
- Attribute *operandCst = nullptr;
+ Attribute operandCst;
if (auto *operandOp = operand->getDefiningOperation()) {
if (auto operandConstantOp = operandOp->dyn_cast<ConstantOp>())
operandCst = operandConstantOp->getValue();
OpenPOWER on IntegriCloud