diff options
| author | River Riddle <riverriddle@google.com> | 2019-07-11 11:41:04 -0700 |
|---|---|---|
| committer | jpienaar <jpienaar@google.com> | 2019-07-12 08:43:42 -0700 |
| commit | 9dbef0bf96e2cff1e2cac99d251d91be6634e91d (patch) | |
| tree | 466f2053eb679dc440e592490185fadfee29ddb8 /mlir/lib/Target/LLVMIR | |
| parent | 4dfe6d457bdcdd42311c9b1ebe383b865dd360a8 (diff) | |
| download | bcm5719-llvm-9dbef0bf96e2cff1e2cac99d251d91be6634e91d.tar.gz bcm5719-llvm-9dbef0bf96e2cff1e2cac99d251d91be6634e91d.zip | |
Rename FunctionAttr to SymbolRefAttr.
This allows for the attribute to hold symbolic references to other operations than FuncOp. This also allows for removing the dependence on FuncOp from the base Builder.
PiperOrigin-RevId: 257650017
Diffstat (limited to 'mlir/lib/Target/LLVMIR')
| -rw-r--r-- | mlir/lib/Target/LLVMIR/ModuleTranslation.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/mlir/lib/Target/LLVMIR/ModuleTranslation.cpp b/mlir/lib/Target/LLVMIR/ModuleTranslation.cpp index b78e571ac99..0c552b92bbe 100644 --- a/mlir/lib/Target/LLVMIR/ModuleTranslation.cpp +++ b/mlir/lib/Target/LLVMIR/ModuleTranslation.cpp @@ -83,7 +83,7 @@ llvm::Constant *ModuleTranslation::getLLVMConstant(llvm::Type *llvmType, return llvm::ConstantInt::get(llvmType, intAttr.getValue()); if (auto floatAttr = attr.dyn_cast<FloatAttr>()) return llvm::ConstantFP::get(llvmType, floatAttr.getValue()); - if (auto funcAttr = attr.dyn_cast<FunctionAttr>()) + if (auto funcAttr = attr.dyn_cast<SymbolRefAttr>()) return functionMapping.lookup(funcAttr.getValue()); if (auto splatAttr = attr.dyn_cast<SplatElementsAttr>()) { auto *vectorType = cast<llvm::VectorType>(llvmType); @@ -176,7 +176,7 @@ bool ModuleTranslation::convertOperation(Operation &opInst, auto convertCall = [this, &builder](Operation &op) -> llvm::Value * { auto operands = lookupValues(op.getOperands()); ArrayRef<llvm::Value *> operandsRef(operands); - if (auto attr = op.getAttrOfType<FunctionAttr>("callee")) { + if (auto attr = op.getAttrOfType<SymbolRefAttr>("callee")) { return builder.CreateCall(functionMapping.lookup(attr.getValue()), operandsRef); } else { |

