[llvm-commits] [llvm] r47337 - /llvm/trunk/lib/Target/CBackend/CBackend.cpp

Andrew Lenharth andrewl at lenharth.org
Thu Feb 21 07:51:55 PST 2008


OK, I'll reopen PR2065 then.

On 2/20/08, Evan Cheng <evan.cheng at apple.com> wrote:
> Hi Andrew,
>
>  This patch broke several CBE tests last night on x86:
>  bh, 403.gcc,  and 175.vpr (DISABLE_LTO=1)
>
>  I'll back it out for now. Please re-apply after these are fixed.
>
>  Thanks,
>
>
>  Evan
>
>
>  On Feb 19, 2008, at 11:47 AM, Andrew Lenharth wrote:
>
>  > Author: alenhar2
>  > Date: Tue Feb 19 13:47:54 2008
>  > New Revision: 47337
>  >
>  > URL: http://llvm.org/viewvc/llvm-project?rev=47337&view=rev
>  > Log:
>  > fix some byval problems in the cbe.  Closes PR2065
>  >
>  > Modified:
>  >    llvm/trunk/lib/Target/CBackend/CBackend.cpp
>  >
>  > Modified: llvm/trunk/lib/Target/CBackend/CBackend.cpp
>  > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CBackend/CBackend.cpp?rev=47337&r1=47336&r2=47337&view=diff
>  >
>  > =
>  > =
>  > =
>  > =
>  > =
>  > =
>  > =
>  > =
>  > ======================================================================
>  > --- llvm/trunk/lib/Target/CBackend/CBackend.cpp (original)
>  > +++ llvm/trunk/lib/Target/CBackend/CBackend.cpp Tue Feb 19 13:47:54
>  > 2008
>  > @@ -1198,12 +1198,12 @@
>  > }
>  >
>  > void CWriter::writeOperand(Value *Operand) {
>  > -  if (isa<GlobalVariable>(Operand) || isDirectAlloca(Operand))
>  > +  if (isa<GlobalVariable>(Operand) || isDirectAlloca(Operand) ||
>  > ByValParams.count(Operand))
>  >     Out << "(&";  // Global variables are referenced as their
>  > addresses by llvm
>  >
>  >   writeOperandInternal(Operand);
>  >
>  > -  if (isa<GlobalVariable>(Operand) || isDirectAlloca(Operand))
>  > +  if (isa<GlobalVariable>(Operand) || isDirectAlloca(Operand) ||
>  > ByValParams.count(Operand))
>  >     Out << ')';
>  > }
>  >
>  > @@ -2723,13 +2723,11 @@
>  >     // Check if the argument is expected to be passed by value.
>  >     bool isOutByVal = PAL && PAL->paramHasAttr(ArgNo+1,
>  > ParamAttr::ByVal);
>  >     // Check if this argument itself is passed in by reference.
>  > -    bool isInByVal = ByValParams.count(*AI);
>  > -    if (isOutByVal && !isInByVal)
>  > +    //bool isInByVal = ByValParams.count(*AI);
>  > +    if (isOutByVal)
>  >       Out << "*(";
>  > -    else if (!isOutByVal && isInByVal)
>  > -      Out << "&(";
>  >     writeOperand(*AI);
>  > -    if (isOutByVal ^ isInByVal)
>  > +    if (isOutByVal)
>  >       Out << ")";
>  >     PrintedArg = true;
>  >   }
>  >
>  >
>  > _______________________________________________
>  > llvm-commits mailing list
>  > llvm-commits at cs.uiuc.edu
>  > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
>



More information about the llvm-commits mailing list