diff --git a/flang/include/flang/Optimizer/Transforms/Passes.h b/flang/include/flang/Optimizer/Transforms/Passes.h --- a/flang/include/flang/Optimizer/Transforms/Passes.h +++ b/flang/include/flang/Optimizer/Transforms/Passes.h @@ -72,7 +72,6 @@ std::unique_ptr createAlgebraicSimplificationPass(const mlir::GreedyRewriteConfig &config); std::unique_ptr createPolymorphicOpConversionPass(); -std::unique_ptr createOpenACCDataOperandConversionPass(); // declarative passes #define GEN_PASS_REGISTRATION diff --git a/flang/include/flang/Optimizer/Transforms/Passes.td b/flang/include/flang/Optimizer/Transforms/Passes.td --- a/flang/include/flang/Optimizer/Transforms/Passes.td +++ b/flang/include/flang/Optimizer/Transforms/Passes.td @@ -286,16 +286,6 @@ ]; } -def OpenACCDataOperandConversion : Pass<"fir-openacc-data-operand-conversion", "::mlir::func::FuncOp"> { - let summary = "Convert the FIR operands in OpenACC ops to LLVM dialect"; - let dependentDialects = ["mlir::LLVM::LLVMDialect"]; - let options = [ - Option<"useOpaquePointers", "use-opaque-pointers", "bool", - /*default=*/"true", "Generate LLVM IR using opaque pointers " - "instead of typed pointers">, - ]; -} - def LoopVersioning : Pass<"loop-versioning", "mlir::func::FuncOp"> { let summary = "Loop Versioning"; let description = [{ diff --git a/flang/lib/Optimizer/CodeGen/CMakeLists.txt b/flang/lib/Optimizer/CodeGen/CMakeLists.txt --- a/flang/lib/Optimizer/CodeGen/CMakeLists.txt +++ b/flang/lib/Optimizer/CodeGen/CMakeLists.txt @@ -23,7 +23,6 @@ MLIRMathToFuncs MLIRMathToLLVM MLIRMathToLibm - MLIROpenACCToLLVM MLIROpenMPToLLVM MLIRBuiltinToLLVMIRTranslation MLIRLLVMToLLVMIRTranslation diff --git a/flang/lib/Optimizer/CodeGen/CodeGen.cpp b/flang/lib/Optimizer/CodeGen/CodeGen.cpp --- a/flang/lib/Optimizer/CodeGen/CodeGen.cpp +++ b/flang/lib/Optimizer/CodeGen/CodeGen.cpp @@ -31,7 +31,6 @@ #include "mlir/Conversion/MathToFuncs/MathToFuncs.h" #include "mlir/Conversion/MathToLLVM/MathToLLVM.h" #include "mlir/Conversion/MathToLibm/MathToLibm.h" -#include "mlir/Conversion/OpenACCToLLVM/ConvertOpenACCToLLVM.h" #include "mlir/Conversion/OpenMPToLLVM/ConvertOpenMPToLLVM.h" #include "mlir/Conversion/ReconcileUnrealizedCasts/ReconcileUnrealizedCasts.h" #include "mlir/Dialect/LLVMIR/LLVMDialect.h" @@ -3690,7 +3689,6 @@ XEmboxOpConversion, XReboxOpConversion, ZeroOpConversion>(typeConverter, options); mlir::populateFuncToLLVMConversionPatterns(typeConverter, pattern); - mlir::populateOpenACCToLLVMConversionPatterns(typeConverter, pattern); mlir::populateOpenMPToLLVMConversionPatterns(typeConverter, pattern); mlir::arith::populateArithToLLVMConversionPatterns(typeConverter, pattern); mlir::cf::populateControlFlowToLLVMConversionPatterns(typeConverter, diff --git a/flang/lib/Optimizer/Transforms/CMakeLists.txt b/flang/lib/Optimizer/Transforms/CMakeLists.txt --- a/flang/lib/Optimizer/Transforms/CMakeLists.txt +++ b/flang/lib/Optimizer/Transforms/CMakeLists.txt @@ -15,7 +15,6 @@ SimplifyIntrinsics.cpp AddDebugFoundation.cpp PolymorphicOpConversion.cpp - OpenACC/OpenACCDataOperandConversion.cpp LoopVersioning.cpp DEPENDS diff --git a/flang/lib/Optimizer/Transforms/OpenACC/OpenACCDataOperandConversion.cpp b/flang/lib/Optimizer/Transforms/OpenACC/OpenACCDataOperandConversion.cpp deleted file mode 100644 --- a/flang/lib/Optimizer/Transforms/OpenACC/OpenACCDataOperandConversion.cpp +++ /dev/null @@ -1,142 +0,0 @@ -//===- OpenACCDataOperandConversion.cpp - OpenACC data operand conversion -===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -#include "flang/Optimizer/Dialect/FIRDialect.h" -#include "flang/Optimizer/Transforms/Passes.h" -#include "mlir/Conversion/LLVMCommon/Pattern.h" -#include "mlir/Conversion/OpenACCToLLVM/ConvertOpenACCToLLVM.h" -#include "mlir/Dialect/Func/IR/FuncOps.h" -#include "mlir/Dialect/LLVMIR/LLVMDialect.h" -#include "mlir/Dialect/OpenACC/OpenACC.h" -#include "mlir/IR/Builders.h" -#include "mlir/IR/BuiltinOps.h" -#include "mlir/Pass/Pass.h" - -namespace fir { -#define GEN_PASS_DEF_OPENACCDATAOPERANDCONVERSION -#include "flang/Optimizer/Transforms/Passes.h.inc" -} // namespace fir - -#define DEBUG_TYPE "flang-openacc-conversion" -#include "flang/Optimizer/CodeGen/TypeConverter.h" - -using namespace fir; -using namespace mlir; - -//===----------------------------------------------------------------------===// -// Conversion patterns -//===----------------------------------------------------------------------===// - -namespace { - -template -class LegalizeDataOpForLLVMTranslation : public ConvertOpToLLVMPattern { - using ConvertOpToLLVMPattern::ConvertOpToLLVMPattern; - - LogicalResult - matchAndRewrite(Op op, typename Op::Adaptor adaptor, - ConversionPatternRewriter &builder) const override { - Location loc = op.getLoc(); - fir::LLVMTypeConverter &converter = - *static_cast(this->getTypeConverter()); - - unsigned numDataOperands = op.getNumDataOperands(); - - // Keep the non data operands without modification. - auto nonDataOperands = adaptor.getOperands().take_front( - adaptor.getOperands().size() - numDataOperands); - SmallVector convertedOperands; - convertedOperands.append(nonDataOperands.begin(), nonDataOperands.end()); - - // Go over the data operand and legalize them for translation. - for (unsigned idx = 0; idx < numDataOperands; ++idx) { - Value originalDataOperand = op.getDataOperand(idx); - if (auto refTy = - originalDataOperand.getType().dyn_cast()) { - if (refTy.getEleTy().isa()) - return builder.notifyMatchFailure(op, "BaseBoxType not supported"); - mlir::Type convertedType = - converter.convertType(refTy).cast(); - mlir::Value castedOperand = - builder - .create(loc, convertedType, - originalDataOperand) - .getResult(0); - convertedOperands.push_back(castedOperand); - } else { - // Type not supported. - return builder.notifyMatchFailure(op, "expecting a reference type"); - } - } - - if constexpr (std::is_same_v || - std::is_same_v) { - auto newOp = - builder.create(op.getLoc(), TypeRange(), convertedOperands, - op.getOperation()->getAttrs()); - builder.inlineRegionBefore(op.getRegion(), newOp.getRegion(), - newOp.getRegion().end()); - if (failed(builder.convertRegionTypes(&newOp.getOperation()->getRegion(0), - *this->getTypeConverter()))) - return failure(); - builder.eraseOp(op); - } else { - builder.replaceOpWithNewOp(op, TypeRange(), convertedOperands, - op.getOperation()->getAttrs()); - } - - return success(); - } -}; -} // namespace - -namespace { -struct OpenACCDataOperandConversion - : public fir::impl::OpenACCDataOperandConversionBase< - OpenACCDataOperandConversion> { - using Base::Base; - - void runOnOperation() override; -}; -} // namespace - -void OpenACCDataOperandConversion::runOnOperation() { - auto op = getOperation(); - auto *context = op.getContext(); - - // Convert to OpenACC operations with LLVM IR dialect - RewritePatternSet patterns(context); - LowerToLLVMOptions options(context); - options.useOpaquePointers = useOpaquePointers; - fir::LLVMTypeConverter converter( - op.getOperation()->getParentOfType(), true); - patterns.add>(converter); - - ConversionTarget target(*context); - target.addLegalDialect(); - target.addLegalDialect(); - target.addLegalOp(); - - auto allDataOperandsAreConverted = [](ValueRange operands) { - for (Value operand : operands) { - if (!operand.getType().isa()) - return false; - } - return true; - }; - - target.addDynamicallyLegalOp( - [allDataOperandsAreConverted](acc::ParallelOp op) { - return allDataOperandsAreConverted(op.getReductionOperands()) && - allDataOperandsAreConverted(op.getGangPrivateOperands()) && - allDataOperandsAreConverted(op.getGangFirstPrivateOperands()); - }); - - if (failed(applyPartialConversion(op, target, std::move(patterns)))) - signalPassFailure(); -} diff --git a/mlir/include/mlir/Conversion/OpenACCToLLVM/ConvertOpenACCToLLVM.h b/mlir/include/mlir/Conversion/OpenACCToLLVM/ConvertOpenACCToLLVM.h deleted file mode 100644 --- a/mlir/include/mlir/Conversion/OpenACCToLLVM/ConvertOpenACCToLLVM.h +++ /dev/null @@ -1,72 +0,0 @@ -//===- ConvertOpenACCToLLVM.h - OpenACC conversion pass entrypoint --------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// -#ifndef MLIR_CONVERSION_OPENACCTOLLVM_CONVERTOPENACCTOLLVM_H -#define MLIR_CONVERSION_OPENACCTOLLVM_CONVERTOPENACCTOLLVM_H - -#include "mlir/Conversion/LLVMCommon/StructBuilder.h" -#include - -namespace mlir { -class LLVMTypeConverter; -class Pass; -class RewritePatternSet; - -#define GEN_PASS_DECL_CONVERTOPENACCTOLLVMPASS -#include "mlir/Conversion/Passes.h.inc" - -static constexpr unsigned kPtrBasePosInDataDescriptor = 0; -static constexpr unsigned kPtrPosInDataDescriptor = 1; -static constexpr unsigned kSizePosInDataDescriptor = 2; - -/// Helper class to produce LLVM dialect operations inserting -/// elements to a Data descriptor. Wraps a Value pointing to the descriptor. -/// The Value may be null, in which case none of the operations are valid. -/// -/// The data descriptor holds information needed to perform data operations -/// and movements with the runtime. -/// `BasePointer`: base of the pointer being mapped. -/// `Pointer`: actual pointer of the data being mapped. -/// `Size`: size of the data being mapped. -/// -/// Example: -/// -/// ```c -/// struct S { -/// int x; -/// int y; -/// }; -/// ``` -/// -/// Mapping `s.y` will result if the following information in the data -/// descriptor: -/// - `BasePointer`: address of `s` -/// - `Pointer`: address of `s.y` -/// - `Size`: size of `s.y` -/// -/// For a scalar variable BasePointer and Pointer will be the same. -class DataDescriptor : public StructBuilder { -public: - /// Construct a helper for the given descriptor value. - explicit DataDescriptor(Value descriptor); - /// Builds IR creating an `undef` value of the descriptor type. - static DataDescriptor undef(OpBuilder &builder, Location loc, Type basePtrTy, - Type ptrTy); - - static bool isValid(Value descriptor); - - void setPointer(OpBuilder &builder, Location loc, Value ptr); - void setBasePointer(OpBuilder &builder, Location loc, Value basePtr); - void setSize(OpBuilder &builder, Location loc, Value size); -}; - -/// Collect the patterns to convert from the OpenACC dialect LLVMIR dialect. -void populateOpenACCToLLVMConversionPatterns(LLVMTypeConverter &converter, - RewritePatternSet &patterns); -} // namespace mlir - -#endif // MLIR_CONVERSION_OPENACCTOLLVM_CONVERTOPENACCTOLLVM_H diff --git a/mlir/include/mlir/Conversion/Passes.h b/mlir/include/mlir/Conversion/Passes.h --- a/mlir/include/mlir/Conversion/Passes.h +++ b/mlir/include/mlir/Conversion/Passes.h @@ -40,7 +40,6 @@ #include "mlir/Conversion/MemRefToLLVM/MemRefToLLVM.h" #include "mlir/Conversion/MemRefToSPIRV/MemRefToSPIRVPass.h" #include "mlir/Conversion/NVGPUToNVVM/NVGPUToNVVM.h" -#include "mlir/Conversion/OpenACCToLLVM/ConvertOpenACCToLLVM.h" #include "mlir/Conversion/OpenACCToSCF/ConvertOpenACCToSCF.h" #include "mlir/Conversion/OpenMPToLLVM/ConvertOpenMPToLLVM.h" #include "mlir/Conversion/PDLToPDLInterp/PDLToPDLInterp.h" diff --git a/mlir/include/mlir/Conversion/Passes.td b/mlir/include/mlir/Conversion/Passes.td --- a/mlir/include/mlir/Conversion/Passes.td +++ b/mlir/include/mlir/Conversion/Passes.td @@ -732,20 +732,6 @@ let dependentDialects = ["scf::SCFDialect", "acc::OpenACCDialect"]; } -//===----------------------------------------------------------------------===// -// OpenACCToLLVM -//===----------------------------------------------------------------------===// - -def ConvertOpenACCToLLVMPass : Pass<"convert-openacc-to-llvm", "ModuleOp"> { - let summary = "Convert the OpenACC ops to LLVM dialect"; - let dependentDialects = ["LLVM::LLVMDialect"]; - let options = [ - Option<"useOpaquePointers", "use-opaque-pointers", "bool", - /*default=*/"true", "Generate LLVM IR using opaque pointers " - "instead of typed pointers">, - ]; -} - //===----------------------------------------------------------------------===// // OpenMPToLLVM //===----------------------------------------------------------------------===// diff --git a/mlir/lib/Conversion/CMakeLists.txt b/mlir/lib/Conversion/CMakeLists.txt --- a/mlir/lib/Conversion/CMakeLists.txt +++ b/mlir/lib/Conversion/CMakeLists.txt @@ -30,7 +30,6 @@ add_subdirectory(MemRefToLLVM) add_subdirectory(MemRefToSPIRV) add_subdirectory(NVGPUToNVVM) -add_subdirectory(OpenACCToLLVM) add_subdirectory(OpenACCToSCF) add_subdirectory(OpenMPToLLVM) add_subdirectory(PDLToPDLInterp) diff --git a/mlir/lib/Conversion/OpenACCToLLVM/CMakeLists.txt b/mlir/lib/Conversion/OpenACCToLLVM/CMakeLists.txt deleted file mode 100644 --- a/mlir/lib/Conversion/OpenACCToLLVM/CMakeLists.txt +++ /dev/null @@ -1,16 +0,0 @@ -add_mlir_conversion_library(MLIROpenACCToLLVM - OpenACCToLLVM.cpp - - ADDITIONAL_HEADER_DIRS - ${MLIR_MAIN_INCLUDE_DIR}/mlir/Conversion/OpenACCToLLVM - - DEPENDS - MLIRConversionPassIncGen - - LINK_LIBS PUBLIC - MLIRIR - MLIRLLVMDialect - MLIRMemRefToLLVM - MLIROpenACCDialect - MLIRTransforms - ) diff --git a/mlir/lib/Conversion/OpenACCToLLVM/OpenACCToLLVM.cpp b/mlir/lib/Conversion/OpenACCToLLVM/OpenACCToLLVM.cpp deleted file mode 100644 --- a/mlir/lib/Conversion/OpenACCToLLVM/OpenACCToLLVM.cpp +++ /dev/null @@ -1,203 +0,0 @@ -//===- OpenACCToLLVM.cpp - Prepare OpenACC data for LLVM translation ------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -#include "mlir/Conversion/OpenACCToLLVM/ConvertOpenACCToLLVM.h" - -#include "mlir/Conversion/LLVMCommon/Pattern.h" -#include "mlir/Dialect/LLVMIR/LLVMDialect.h" -#include "mlir/Dialect/OpenACC/OpenACC.h" -#include "mlir/IR/Builders.h" -#include "mlir/Pass/Pass.h" - -namespace mlir { -#define GEN_PASS_DEF_CONVERTOPENACCTOLLVMPASS -#include "mlir/Conversion/Passes.h.inc" -} // namespace mlir - -using namespace mlir; - -//===----------------------------------------------------------------------===// -// DataDescriptor implementation -//===----------------------------------------------------------------------===// - -constexpr StringRef getStructName() { return "openacc_data"; } - -/// Construct a helper for the given descriptor value. -DataDescriptor::DataDescriptor(Value descriptor) : StructBuilder(descriptor) { - assert(value != nullptr && "value cannot be null"); -} - -/// Builds IR creating an `undef` value of the data descriptor. -DataDescriptor DataDescriptor::undef(OpBuilder &builder, Location loc, - Type basePtrTy, Type ptrTy) { - Type descriptorType = LLVM::LLVMStructType::getNewIdentified( - builder.getContext(), getStructName(), - {basePtrTy, ptrTy, builder.getI64Type()}); - Value descriptor = builder.create(loc, descriptorType); - return DataDescriptor(descriptor); -} - -/// Check whether the type is a valid data descriptor. -bool DataDescriptor::isValid(Value descriptor) { - if (auto type = descriptor.getType().dyn_cast()) { - if (type.isIdentified() && type.getName().startswith(getStructName()) && - type.getBody().size() == 3 && - (type.getBody()[kPtrBasePosInDataDescriptor] - .isa() || - type.getBody()[kPtrBasePosInDataDescriptor] - .isa()) && - type.getBody()[kPtrPosInDataDescriptor].isa() && - type.getBody()[kSizePosInDataDescriptor].isInteger(64)) - return true; - } - return false; -} - -/// Builds IR inserting the base pointer value into the descriptor. -void DataDescriptor::setBasePointer(OpBuilder &builder, Location loc, - Value basePtr) { - setPtr(builder, loc, kPtrBasePosInDataDescriptor, basePtr); -} - -/// Builds IR inserting the pointer value into the descriptor. -void DataDescriptor::setPointer(OpBuilder &builder, Location loc, Value ptr) { - setPtr(builder, loc, kPtrPosInDataDescriptor, ptr); -} - -/// Builds IR inserting the size value into the descriptor. -void DataDescriptor::setSize(OpBuilder &builder, Location loc, Value size) { - setPtr(builder, loc, kSizePosInDataDescriptor, size); -} - -//===----------------------------------------------------------------------===// -// Conversion patterns -//===----------------------------------------------------------------------===// - -namespace { - -template -class LegalizeDataOpForLLVMTranslation : public ConvertOpToLLVMPattern { - using ConvertOpToLLVMPattern::ConvertOpToLLVMPattern; - - LogicalResult - matchAndRewrite(Op op, typename Op::Adaptor adaptor, - ConversionPatternRewriter &builder) const override { - Location loc = op.getLoc(); - TypeConverter *converter = ConvertToLLVMPattern::getTypeConverter(); - - unsigned numDataOperand = op.getNumDataOperands(); - - // Keep the non data operands without modification. - auto nonDataOperands = adaptor.getOperands().take_front( - adaptor.getOperands().size() - numDataOperand); - SmallVector convertedOperands; - convertedOperands.append(nonDataOperands.begin(), nonDataOperands.end()); - - // Go over the data operand and legalize them for translation. - for (unsigned idx = 0; idx < numDataOperand; ++idx) { - Value originalDataOperand = op.getDataOperand(idx); - - // Traverse operands that were converted to MemRefDescriptors. - if (auto memRefType = - originalDataOperand.getType().dyn_cast()) { - Type structType = converter->convertType(memRefType); - Value memRefDescriptor = builder - .create( - loc, structType, originalDataOperand) - .getResult(0); - - // Calculate the size of the memref and get the pointer to the allocated - // buffer. - SmallVector sizes; - SmallVector strides; - Value sizeBytes; - ConvertToLLVMPattern::getMemRefDescriptorSizes( - loc, memRefType, {}, builder, sizes, strides, sizeBytes); - MemRefDescriptor descriptor(memRefDescriptor); - Value dataPtr = descriptor.alignedPtr(builder, loc); - auto ptrType = descriptor.getElementPtrType(); - - auto descr = DataDescriptor::undef(builder, loc, structType, ptrType); - descr.setBasePointer(builder, loc, memRefDescriptor); - descr.setPointer(builder, loc, dataPtr); - descr.setSize(builder, loc, sizeBytes); - convertedOperands.push_back(descr); - } else if (originalDataOperand.getType().isa()) { - convertedOperands.push_back(originalDataOperand); - } else { - // Type not supported. - return builder.notifyMatchFailure(op, "unsupported type"); - } - } - - if constexpr (std::is_same_v || - std::is_same_v) { - auto newOp = - builder.create(op.getLoc(), TypeRange(), convertedOperands, - op.getOperation()->getAttrs()); - builder.inlineRegionBefore(op.getRegion(), newOp.getRegion(), - newOp.getRegion().end()); - builder.eraseOp(op); - } else { - builder.replaceOpWithNewOp(op, TypeRange(), convertedOperands, - op.getOperation()->getAttrs()); - } - - return success(); - } -}; -} // namespace - -void mlir::populateOpenACCToLLVMConversionPatterns( - LLVMTypeConverter &converter, RewritePatternSet &patterns) { - patterns.add>(converter); -} - -namespace { -struct ConvertOpenACCToLLVMPass - : public impl::ConvertOpenACCToLLVMPassBase { - using Base::Base; - - void runOnOperation() override; -}; -} // namespace - -void ConvertOpenACCToLLVMPass::runOnOperation() { - auto op = getOperation(); - auto *context = op.getContext(); - - // Convert to OpenACC operations with LLVM IR dialect - RewritePatternSet patterns(context); - LowerToLLVMOptions options(context); - options.useOpaquePointers = useOpaquePointers; - LLVMTypeConverter converter(context, options); - populateOpenACCToLLVMConversionPatterns(converter, patterns); - - ConversionTarget target(*context); - target.addLegalDialect(); - target.addLegalOp(); - - auto allDataOperandsAreConverted = [](ValueRange operands) { - for (Value operand : operands) { - if (!DataDescriptor::isValid(operand) && - !operand.getType().isa()) - return false; - } - return true; - }; - - target.addDynamicallyLegalOp( - [allDataOperandsAreConverted](acc::ParallelOp op) { - return allDataOperandsAreConverted(op.getReductionOperands()) && - allDataOperandsAreConverted(op.getGangPrivateOperands()) && - allDataOperandsAreConverted(op.getGangFirstPrivateOperands()); - }); - - if (failed(applyPartialConversion(op, target, std::move(patterns)))) - signalPassFailure(); -} diff --git a/mlir/lib/Target/LLVMIR/Dialect/OpenACC/CMakeLists.txt b/mlir/lib/Target/LLVMIR/Dialect/OpenACC/CMakeLists.txt --- a/mlir/lib/Target/LLVMIR/Dialect/OpenACC/CMakeLists.txt +++ b/mlir/lib/Target/LLVMIR/Dialect/OpenACC/CMakeLists.txt @@ -8,7 +8,6 @@ MLIRIR MLIRLLVMDialect MLIROpenACCDialect - MLIROpenACCToLLVM MLIRSupport MLIRTargetLLVMIRExport ) diff --git a/mlir/lib/Target/LLVMIR/Dialect/OpenACC/OpenACCToLLVMIRTranslation.cpp b/mlir/lib/Target/LLVMIR/Dialect/OpenACC/OpenACCToLLVMIRTranslation.cpp --- a/mlir/lib/Target/LLVMIR/Dialect/OpenACC/OpenACCToLLVMIRTranslation.cpp +++ b/mlir/lib/Target/LLVMIR/Dialect/OpenACC/OpenACCToLLVMIRTranslation.cpp @@ -12,7 +12,6 @@ //===----------------------------------------------------------------------===// #include "mlir/Target/LLVMIR/Dialect/OpenACC/OpenACCToLLVMIRTranslation.h" -#include "mlir/Conversion/OpenACCToLLVM/ConvertOpenACCToLLVM.h" #include "mlir/Dialect/LLVMIR/LLVMDialect.h" #include "mlir/Dialect/OpenACC/OpenACC.h" #include "mlir/IR/BuiltinOps.h" @@ -100,14 +99,7 @@ llvm::Value *dataPtr; llvm::Value *dataSize; - // Handle operands that were converted to DataDescriptor. - if (DataDescriptor::isValid(data)) { - dataPtrBase = - builder.CreateExtractValue(dataValue, kPtrBasePosInDataDescriptor); - dataPtr = builder.CreateExtractValue(dataValue, kPtrPosInDataDescriptor); - dataSize = - builder.CreateExtractValue(dataValue, kSizePosInDataDescriptor); - } else if (data.getType().isa()) { + if (data.getType().isa()) { dataPtrBase = dataValue; dataPtr = dataValue; dataSize = accBuilder->getSizeInBytes(dataValue);