[PATCH] D14639: LLDB JIT needs android vector passing rules.

David Blaikie via cfe-commits cfe-commits at lists.llvm.org
Fri Nov 13 08:24:48 PST 2015


On Fri, Nov 13, 2015 at 2:00 AM, Aidan Dodds via cfe-commits <
cfe-commits at lists.llvm.org> wrote:

> ADodds created this revision.
> ADodds added reviewers: asl, rsmith.
> ADodds added subscribers: pirama, cfe-commits.
> ADodds set the repository for this revision to rL LLVM.
> Herald added subscribers: srhines, danalbert, tberghammer, aemerson.
>
> Looking into some recent issues with LLDBs expression parser highlighted
> that upstream clang passes vectors types differently to Android Open Source
> Project's clang for Arm Android targets.
> This patch reflects the changes present in the AOSP and allows LLDB's JIT
> expression evaluation to work correctly for Arm Android targets when
> passing vectors.
>
> This is submitted with consent of the original author Stephen Hines.
>

I forget how much it matters (I know Chandler's spoken about it
previously), but usually better to have the original author submit it, I
think. (perhaps having them chime in on the thread is as good, not sure)


>
> Repository:
>   rL LLVM
>
> http://reviews.llvm.org/D14639
>
> Files:
>   lib/CodeGen/TargetInfo.cpp
>

Test case?


>
> Index: lib/CodeGen/TargetInfo.cpp
> ===================================================================
> --- lib/CodeGen/TargetInfo.cpp
> +++ lib/CodeGen/TargetInfo.cpp
> @@ -4724,6 +4724,11 @@
>      }
>    }
>
> +  bool isAndroid() const {
> +    return (getTarget().getTriple().getEnvironment() ==
> +            llvm::Triple::Android);
>

No need for the extra parens around the return expression.


> +  }
> +
>    ABIKind getABIKind() const { return Kind; }
>
>  private:
> @@ -5227,15 +5232,23 @@
>
>  /// isIllegalVector - check whether Ty is an illegal vector type.
>  bool ARMABIInfo::isIllegalVectorType(QualType Ty) const {
> -  if (const VectorType *VT = Ty->getAs<VectorType>()) {
> -    // Check whether VT is legal.
> -    unsigned NumElements = VT->getNumElements();
> -    uint64_t Size = getContext().getTypeSize(VT);
> -    // NumElements should be power of 2.
> -    if ((NumElements & (NumElements - 1)) != 0)
> -      return true;
> -    // Size should be greater than 32 bits.
> -    return Size <= 32;
> +  if (const VectorType *VT = Ty->getAs<VectorType> ()) {
> +    if (isAndroid()) {
> +      // Check whether VT is legal.
> +      unsigned NumElements = VT->getNumElements();
> +      // NumElements should be power of 2 or equal to 3.
> +      if ((NumElements & (NumElements - 1)) != 0 && NumElements != 3)
> +        return true;
> +    } else {
> +      // Check whether VT is legal.
> +      unsigned NumElements = VT->getNumElements();
> +      uint64_t Size = getContext().getTypeSize(VT);
> +      // NumElements should be power of 2.
> +      if ((NumElements & (NumElements - 1)) != 0)
> +        return true;
> +      // Size should be greater than 32 bits.
> +      return Size <= 32;
> +    }
>    }
>    return false;
>  }
>
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20151113/b4e95b52/attachment.html>


More information about the cfe-commits mailing list