1. May 20, 2021
    • Philip Reames's avatar
      Do actual DCE in LoopUnroll (try 4) · 449d14eb
      Philip Reames authored
      Turns out simplifyLoopIVs sometimes returns a non-dead instruction in it's DeadInsts out param.  I had done a bit of NFC cleanup which was only NFC if simplifyLoopIVs obeyed it's documentation.  I'm simplfy dropping that part of the change.
      
      Commit message from try 3:
      
      Recommitting after fixing a bug found post commit. Amusingly, try 1 had been correct, and by reverting to incorporate last minute review feedback, I introduce the bug. Oops. :)
      
      Original commit message:
      
      The problem was that recursively deleting an instruction can delete instructions beyond the current iterator (via a dead phi), thus invalidating iteration. Test case added in LoopUnroll/dce.ll to cover this case.
      
      LoopUnroll does a limited DCE pass after unrolling, but if you have a chain of dead instructions, it only deletes the last one. Improve the code to recursively delete all trivially dead instructions.
      
      Differential Revision: https://reviews.llvm.org/D102511
      449d14eb
    • Frederik Gossen's avatar
      Revert "Reapply "[clang][deps] Support inferred modules"" · 76b8754d
      Frederik Gossen authored
      This reverts commit c98833cd.
      The test `ClangScanDeps/modules-inferred-explicit-build.m` creates files
      in the current directory.
      76b8754d
    • Sanjay Patel's avatar
      [x86] propagate FMF from x86-specific intrinsic nodes to others during lowering · f66ba4cf
      Sanjay Patel authored
      This is another fast-math-flags failure exposed by D90901.
      f66ba4cf
    • Sanjay Patel's avatar
    • Nikita Popov's avatar
      [ScalarEvolution] Remove unused ExitLimit::hasOperand() method (NFC) · b661a55a
      Nikita Popov authored
      We only use BackedgeTakenInfo::hasOperand().
      b661a55a
    • Vedant Kumar's avatar
      [profile] Skip mmap() if there are no counters · 7014a101
      Vedant Kumar authored
      If there are no counters, an mmap() of the counters section would fail
      due to the size argument being too small (EINVAL).
      
      rdar://78175925
      
      Differential Revision: https://reviews.llvm.org/D102735
      7014a101
    • Jessica Paquette's avatar
      Recommit "[GlobalISel] Simplify G_ICMP to true/false when the result is known" · 84ae1cf8
      Jessica Paquette authored
      Add missing REQUIRES line to
      prelegalizer-combiner-icmp-to-true-false-known-bits.
      84ae1cf8
    • Hongtao Yu's avatar
      [CSSPGO] Overwrite branch weight annotated in previous pass. · 4ca6e37b
      Hongtao Yu authored
      Sample profile loader can be run in both LTO prelink and postlink. Currently the counts annoation in postilnk doesn't fully overwrite what's done in prelink. I'm adding a switch (`-overwrite-existing-weights=1`) to enable a full overwrite, which includes:
      
      1. Clear old metadata for calls when their parent block has a zero count. This could be caused by prelink code duplication.
      
      2. Clear indirect call metadata if somehow all the rest targets have a sum of zero count.
      
      3. Overwrite branch weight for basic blocks.
      
      With a CS profile, I was seeing #1 and #2 help reduce code size by preventing post-sample ICP and CGSCC inliner working on obsolete metadata, which come from a partial global inlining in prelink.  It's not expected to work well for non-CS case with a less-accurate post-inline count quality.
      
      It's worth calling out that some prelink optimizations can damage counts quality in an irreversible way. One example is the loop rotate optimization. Due to lack of exact loop entry count (profiling can only give loop iteration count and loop exit count), moving one iteration out of the loop body leaves the rest iteration count unknown. We had to turn off prelink loop rotate to achieve a better postlink counts quality. A even better postlink counts quality can be archived by turning off prelink CGSCC inlining which is not context-sensitive.
      
      Reviewed By: wenlei, wmi
      
      Differential Revision: https://reviews.llvm.org/D102537
      4ca6e37b
  2. May 19, 2021