<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Nov 13, 2015 at 2:00 AM, Aidan Dodds via cfe-commits <span dir="ltr"><<a href="mailto:cfe-commits@lists.llvm.org" target="_blank">cfe-commits@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">ADodds created this revision.<br>
ADodds added reviewers: asl, rsmith.<br>
ADodds added subscribers: pirama, cfe-commits.<br>
ADodds set the repository for this revision to rL LLVM.<br>
Herald added subscribers: srhines, danalbert, tberghammer, aemerson.<br>
<br>
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.<br>
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.<br>
<br>
This is submitted with consent of the original author Stephen Hines.<br></blockquote><div><br></div><div>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)</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Repository:<br>
rL LLVM<br>
<br>
<a href="http://reviews.llvm.org/D14639" rel="noreferrer" target="_blank">http://reviews.llvm.org/D14639</a><br>
<br>
Files:<br>
lib/CodeGen/TargetInfo.cpp<br></blockquote><div><br></div><div>Test case?</div><div> <br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Index: lib/CodeGen/TargetInfo.cpp<br>
===================================================================<br>
--- lib/CodeGen/TargetInfo.cpp<br>
+++ lib/CodeGen/TargetInfo.cpp<br>
@@ -4724,6 +4724,11 @@<br>
}<br>
}<br>
<br>
+ bool isAndroid() const {<br>
+ return (getTarget().getTriple().getEnvironment() ==<br>
+ llvm::Triple::Android);<br></blockquote><div><br></div><div>No need for the extra parens around the return expression.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
+ }<br>
+<br>
ABIKind getABIKind() const { return Kind; }<br>
<br>
private:<br>
@@ -5227,15 +5232,23 @@<br>
<br>
/// isIllegalVector - check whether Ty is an illegal vector type.<br>
bool ARMABIInfo::isIllegalVectorType(QualType Ty) const {<br>
- if (const VectorType *VT = Ty->getAs<VectorType>()) {<br>
- // Check whether VT is legal.<br>
- unsigned NumElements = VT->getNumElements();<br>
- uint64_t Size = getContext().getTypeSize(VT);<br>
- // NumElements should be power of 2.<br>
- if ((NumElements & (NumElements - 1)) != 0)<br>
- return true;<br>
- // Size should be greater than 32 bits.<br>
- return Size <= 32;<br>
+ if (const VectorType *VT = Ty->getAs<VectorType> ()) {<br>
+ if (isAndroid()) {<br>
+ // Check whether VT is legal.<br>
+ unsigned NumElements = VT->getNumElements();<br>
+ // NumElements should be power of 2 or equal to 3.<br>
+ if ((NumElements & (NumElements - 1)) != 0 && NumElements != 3)<br>
+ return true;<br>
+ } else {<br>
+ // Check whether VT is legal.<br>
+ unsigned NumElements = VT->getNumElements();<br>
+ uint64_t Size = getContext().getTypeSize(VT);<br>
+ // NumElements should be power of 2.<br>
+ if ((NumElements & (NumElements - 1)) != 0)<br>
+ return true;<br>
+ // Size should be greater than 32 bits.<br>
+ return Size <= 32;<br>
+ }<br>
}<br>
return false;<br>
}<br>
<br>
<br>
<br>_______________________________________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@lists.llvm.org">cfe-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits</a><br>
<br></blockquote></div><br></div></div>