[llvm-commits] [PATCH] Fix PR11004: Crash in llc arm backend

David Meyer pdox at google.com
Sun Sep 25 17:45:21 PDT 2011


Cameron,

With regards to your comment that it is inconsiderate to break the tree
> intentionally, you are forgetting that this was an experimental feature that
> never worked outside of small test cases. Neither Clang nor llvm-gcc will
> generate byval on ARM, so it gets no real testing. It might be more
> considerate to users to just add an assert saying that ARM byval doesn't
> work.
>

I dislike the idea of selective IR support. This creates a hidden
(undocumented) contract between the frontends and backends, which limits the
IR that is valid. It also treats external producers of bitcode as
second-class citizens, since they must effectively mimic Clang or DragonEgg
to guarantee that their output will be supported. It is nicer if every
backend can handle any valid bitcode (even if doing so is not terribly
efficient).

In particular, PNaCl's frontends do generate byval for ARM. We actually
generate a single bitcode representation to run through several backends
(ARM, X86-32 and X86-64).


> I'll let someone else comment on whether we'd rather have a byval that
> inserts long chains of copies or just disable it entirely. If it is the
> former, your patch looks fine with the XFAIL of that test removed.
>

Struct passing by-value is known to be an inefficient operation. Code
demanding performance will usually pass around a const pointer/reference
instead if the struct is large. It is a nice performance enhancement to use
memcpy, but it doesn't seem too critical. Is there a specific benchmark this
affects? In any case, crashing is never the answer !

If there are no more objections, I'll commit, and un-XFAIL the tests which
now pass.
(2011-06-09-TailCallByVal.ll and 2010-11-04-BigByval.ll)

- pdox
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20110925/351f0fcd/attachment.html>


More information about the llvm-commits mailing list