1. Jul 20, 2020
  2. Jul 19, 2020
    • Wenlei He's avatar
    • Wenlei He's avatar
      [InlineAdvisor] New inliner advisor to replay inlining from optimization remarks · 2d6ecfa1
      Wenlei He authored
      Summary:
      This change added a new inline advisor that takes optimization remarks from previous inlining as input, and provides the decision as advice so current inlining can replay inline decisions of a different compilation. Dwarf inline stack with line and discriminator is used as anchor for call sites including call context. The change can be useful for Inliner tuning as it provides a channel to allow external input for tweaking inline decisions. Existing alternatives like alwaysinline attribute is per-function, not per-callsite. Per-callsite inline intrinsic can be another solution (not yet existing), but it's intrusive to implement and also does not differentiate call context.
      
      A switch -sample-profile-inline-replay=<inline_remarks_file> is added to hook up the new inline advisor with SampleProfileLoader's inline decision for replay. Since SampleProfileLoader does top-down inlining, inline decision can be specialized for each call context, hence we should be able to replay inlining accurately. However with a bottom-up inliner like CGSCC inlining, the replay can be limited due to lack of specialization for different call context. Apart from that limitation, the new inline advisor can still be used by regular CGSCC inliner later if needed for tuning purpose.
      
      Subscribers: mgorny, aprantl, hiraditya, llvm-commits
      
      Tags: #llvm
      
      Resubmit for https://reviews.llvm.org/D84086
      2d6ecfa1
    • Aaron Ballman's avatar
    • Aaron Ballman's avatar
      b79ca345
    • Aaron Ballman's avatar
    • Sanjay Patel's avatar
      [x86] split FMA with fast-math-flags to avoid libcall · 50afa187
      Sanjay Patel authored
      fma reassoc A, B, C --> fadd (fmul A, B), C (when target has no FMA hardware)
      
      C/C++ code may use explicit fma() calls (which become LLVM fma
      intrinsics in IR) but then gets compiled with -ffast-math or similar.
      For targets that do not have FMA hardware, we don't want to go out to
      the math library for a precise but slow FMA result.
      
      I tried this as a generic DAGCombine, but it caused infinite looping
      on more than 1 other target, so there's likely some over-reaching fma
      formation happening.
      
      There's also a potential intersection of strict FP with fast-math here.
      Deferring to current behavior for that case (assuming that strict-ness
      overrides fast-ness).
      
      Differential Revision: https://reviews.llvm.org/D83981
      50afa187
    • Roman Lebedev's avatar
      Reland "[InstCombine] Lower infinite combine loop detection thresholds" · 2f3862eb
      Roman Lebedev authored
      This reverts commit 4500db8c,
      which was reverted because lower thresholds exposed a new issue (PR46680).
      
      Now that it was resolved by d12ec0f7,
      we can reinstate lower limits and wait for a new bugreport before
      reverting this again...
      2f3862eb
    • Nikita Popov's avatar
      [PredicateInfo] Add a method to interpret predicate as cmp constraint · c6e13667
      Nikita Popov authored
      Both users of predicteinfo (NewGVN and SCCP) are interested in
      getting a cmp constraint on the predicated value. They currently
      implement separate logic for this. This patch adds a common method
      for this in PredicateBase.
      
      This enables a missing bit of PredicateInfo handling in SCCP: Now
      the predicate on the condition itself is also used. For switches
      it means we know that the switched-on value is the same as the case
      value. For assumes/branches we know that the condition is true or
      false.
      
      Differential Revision: https://reviews.llvm.org/D83640
      c6e13667