[llvm] Revert "[GlobalISel] Add support for lowering byref attribute" (PR #96784)

Thorsten Schütt via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 26 08:35:00 PDT 2024


https://github.com/tschuett created https://github.com/llvm/llvm-project/pull/96784

Reverts llvm/llvm-project#96733

>From ce1e4ade530a75921dada55f1211c85343c98d42 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Thorsten=20Sch=C3=BCtt?= <schuett at gmail.com>
Date: Wed, 26 Jun 2024 17:34:33 +0200
Subject: [PATCH] Revert "[GlobalISel] Add support for lowering byref
 attribute"

This reverts commit 3e1ebd77e4e9a772e4f06f12d19c64860fb1f070.
---
 llvm/lib/CodeGen/GlobalISel/CallLowering.cpp | 15 ++-------------
 1 file changed, 2 insertions(+), 13 deletions(-)

diff --git a/llvm/lib/CodeGen/GlobalISel/CallLowering.cpp b/llvm/lib/CodeGen/GlobalISel/CallLowering.cpp
index 5efb3be0e53ae..2ee035790eff1 100644
--- a/llvm/lib/CodeGen/GlobalISel/CallLowering.cpp
+++ b/llvm/lib/CodeGen/GlobalISel/CallLowering.cpp
@@ -49,8 +49,6 @@ addFlagsUsingAttrFn(ISD::ArgFlagsTy &Flags,
     Flags.setNest();
   if (AttrFn(Attribute::ByVal))
     Flags.setByVal();
-  if (AttrFn(Attribute::ByRef))
-    Flags.setByRef();
   if (AttrFn(Attribute::Preallocated))
     Flags.setPreallocated();
   if (AttrFn(Attribute::InAlloca))
@@ -223,26 +221,17 @@ void CallLowering::setArgFlags(CallLowering::ArgInfo &Arg, unsigned OpIdx,
   }
 
   Align MemAlign = DL.getABITypeAlign(Arg.Ty);
-  if (Flags.isByVal() || Flags.isInAlloca() || Flags.isPreallocated() ||
-      Flags.isByRef()) {
+  if (Flags.isByVal() || Flags.isInAlloca() || Flags.isPreallocated()) {
     assert(OpIdx >= AttributeList::FirstArgIndex);
     unsigned ParamIdx = OpIdx - AttributeList::FirstArgIndex;
 
     Type *ElementTy = FuncInfo.getParamByValType(ParamIdx);
-    if (!ElementTy)
-      ElementTy = FuncInfo.getParamByRefType(ParamIdx);
     if (!ElementTy)
       ElementTy = FuncInfo.getParamInAllocaType(ParamIdx);
     if (!ElementTy)
       ElementTy = FuncInfo.getParamPreallocatedType(ParamIdx);
-
     assert(ElementTy && "Must have byval, inalloca or preallocated type");
-
-    uint64_t MemSize = DL.getTypeAllocSize(ElementTy);
-    if (Flags.isByRef())
-      Flags.setByRefSize(MemSize);
-    else
-      Flags.setByValSize(MemSize);
+    Flags.setByValSize(DL.getTypeAllocSize(ElementTy));
 
     // For ByVal, alignment should be passed from FE.  BE will guess if
     // this info is not there but there are cases it cannot get right.



More information about the llvm-commits mailing list