[Mlir-commits] [mlir] bd78f4e - [mlir] revert 82f5ee3c3e601daad5

Eric Schweitz llvmlistbot at llvm.org
Thu Jan 7 09:38:52 PST 2021


Author: Eric Schweitz
Date: 2021-01-07T09:38:21-08:00
New Revision: bd78f4e93212f2b9bea233905faa2a85bf7bdba7

URL: https://github.com/llvm/llvm-project/commit/bd78f4e93212f2b9bea233905faa2a85bf7bdba7
DIFF: https://github.com/llvm/llvm-project/commit/bd78f4e93212f2b9bea233905faa2a85bf7bdba7.diff

LOG: [mlir] revert 82f5ee3c3e601daad5

Added: 
    

Modified: 
    mlir/lib/Target/LLVMIR/ModuleTranslation.cpp
    mlir/test/Dialect/LLVMIR/func.mlir
    mlir/test/Target/llvmir-invalid.mlir

Removed: 
    


################################################################################
diff  --git a/mlir/lib/Target/LLVMIR/ModuleTranslation.cpp b/mlir/lib/Target/LLVMIR/ModuleTranslation.cpp
index 86f4e7e3e2c4..7700867bb461 100644
--- a/mlir/lib/Target/LLVMIR/ModuleTranslation.cpp
+++ b/mlir/lib/Target/LLVMIR/ModuleTranslation.cpp
@@ -1102,22 +1102,6 @@ LogicalResult ModuleTranslation::convertOneFunction(LLVMFuncOp func) {
           llvm::AttrBuilder().addAlignmentAttr(llvm::Align(attr.getInt())));
     }
 
-    if (auto attr = func.getArgAttrOfType<UnitAttr>(argIdx, "llvm.sret")) {
-      auto argTy = mlirArg.getType().dyn_cast<LLVM::LLVMType>();
-      if (!argTy.isa<LLVM::LLVMPointerType>())
-        return func.emitError(
-            "llvm.sret attribute attached to LLVM non-pointer argument");
-      llvmArg.addAttr(llvm::Attribute::AttrKind::StructRet);
-    }
-
-    if (auto attr = func.getArgAttrOfType<UnitAttr>(argIdx, "llvm.byval")) {
-      auto argTy = mlirArg.getType().dyn_cast<LLVM::LLVMType>();
-      if (!argTy.isa<LLVM::LLVMPointerType>())
-        return func.emitError(
-            "llvm.byval attribute attached to LLVM non-pointer argument");
-      llvmArg.addAttr(llvm::Attribute::AttrKind::ByVal);
-    }
-
     valueMapping[mlirArg] = &llvmArg;
     argIdx++;
   }

diff  --git a/mlir/test/Dialect/LLVMIR/func.mlir b/mlir/test/Dialect/LLVMIR/func.mlir
index 2cec1bca1f74..65dc33cc1c4f 100644
--- a/mlir/test/Dialect/LLVMIR/func.mlir
+++ b/mlir/test/Dialect/LLVMIR/func.mlir
@@ -87,16 +87,6 @@ module {
     llvm.return
   }
 
-  // CHECK: llvm.func @byvalattr(%{{.*}}: !llvm.ptr<i32> {llvm.byval})
-  llvm.func @byvalattr(%arg0: !llvm.ptr<i32> {llvm.byval}) {
-    llvm.return
-  }
-
-  // CHECK: llvm.func @sretattr(%{{.*}}: !llvm.ptr<i32> {llvm.sret})
-  llvm.func @sretattr(%arg0: !llvm.ptr<i32> {llvm.sret}) {
-    llvm.return
-  }
-
   // CHECK: llvm.func @variadic(...)
   llvm.func @variadic(...)
 

diff  --git a/mlir/test/Target/llvmir-invalid.mlir b/mlir/test/Target/llvmir-invalid.mlir
index fcd98ef4b143..14117594e2f8 100644
--- a/mlir/test/Target/llvmir-invalid.mlir
+++ b/mlir/test/Target/llvmir-invalid.mlir
@@ -14,19 +14,6 @@ llvm.func @invalid_noalias(%arg0 : !llvm.float {llvm.noalias = true}) -> !llvm.f
 
 // -----
 
-// expected-error @+1 {{llvm.sret attribute attached to LLVM non-pointer argument}}
-llvm.func @invalid_noalias(%arg0 : !llvm.float {llvm.sret}) -> !llvm.float {
-  llvm.return %arg0 : !llvm.float
-}
-// -----
-
-// expected-error @+1 {{llvm.byval attribute attached to LLVM non-pointer argument}}
-llvm.func @invalid_noalias(%arg0 : !llvm.float {llvm.byval}) -> !llvm.float {
-  llvm.return %arg0 : !llvm.float
-}
-
-// -----
-
 // expected-error @+1 {{llvm.align attribute attached to LLVM non-pointer argument}}
 llvm.func @invalid_align(%arg0 : !llvm.float {llvm.align = 4}) -> !llvm.float {
   llvm.return %arg0 : !llvm.float


        


More information about the Mlir-commits mailing list