[PATCH] D65457: [InstCombine] Optimize div/ldiv/lldiv

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 30 12:01:38 PDT 2019


efriedma added a comment.

If we're going to recognize a C function that returns an aggregate, we need to be very careful that the form we're recognizing is a specific, known pattern.  We need to be sure that we're recognizing a specific way of returning an aggregate, and TLI needs an API to tell transforms which specific way it recognized.  We don't need to add all the possible patterns in the first patch, of course.

One concern that applies to "div" specifically, which you didn't mention, is that the order of the members of div_t isn't specified in any standard, so we also need an API to get the order on a given target.

It might be better to just handle this in clang, instead of TLI; it would be much easier to do the right thing with an AST that has the original struct type and member names.  Or actually, maybe this just isn't worth doing, because the API is rarely used; I tried searching the entire Android tree, and only managed to find a couple uses.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D65457/new/

https://reviews.llvm.org/D65457





More information about the llvm-commits mailing list