Skip to content
  1. Apr 10, 2020
  2. Apr 09, 2020
  3. Apr 08, 2020
    • Fangrui Song's avatar
      [ThinLTO] Drop dso_local if a GlobalVariable satisfies isDeclarationForLinker() · d2ef8c1f
      Fangrui Song authored
      dso_local leads to direct access even if the definition is not within this compilation unit (it is
      still in the same linkage unit). On ELF, such a relocation (e.g. R_X86_64_PC32) referencing a
      STB_GLOBAL STV_DEFAULT object can cause a linker error in a -shared link.
      
      If the linkage is changed to available_externally, the dso_local flag should be dropped, so that no
      direct access will be generated.
      
      The current behavior is benign, because -fpic does not assume dso_local
      (clang/lib/CodeGen/CodeGenModule.cpp:shouldAssumeDSOLocal).
      If we do that for -fno-semantic-interposition (D73865), there will be an
      R_X86_64_PC32 linker error without this patch.
      
      Reviewed By: tejohnson
      
      Differential Revision: https://reviews.llvm.org/D74751
      d2ef8c1f
  4. Apr 07, 2020
    • Eli Friedman's avatar
      [NFC] Modernize misc. uses of Align/MaybeAlign APIs. · 3f13ee8a
      Eli Friedman authored
      Use the current getAlign() APIs where it makes sense, and use Align
      instead of MaybeAlign when we know the value is non-zero.
      3f13ee8a
    • Eli Friedman's avatar
      Remove SequentialType from the type heirarchy. · 68b03aee
      Eli Friedman authored
      Now that we have scalable vectors, there's a distinction that isn't
      getting captured in the original SequentialType: some vectors don't have
      a known element count, so counting the number of elements doesn't make
      sense.
      
      In some cases, there's a better way to express the commonality using
      other methods. If we're dealing with GEPs, there's GEP methods; if we're
      dealing with a ConstantDataSequential, we can query its element type
      directly.
      
      In the relatively few remaining cases, I just decided to write out
      the type checks. We're talking about relatively few places, and I think
      the abstraction doesn't really carry its weight. (See thread "[RFC]
      Refactor class hierarchy of VectorType in the IR" on llvmdev.)
      
      Differential Revision: https://reviews.llvm.org/D75661
      68b03aee
  5. Apr 06, 2020
  6. Apr 05, 2020
  7. Apr 04, 2020
  8. Apr 03, 2020
    • Hongtao Yu's avatar
      Fix a bug in the inliner that causes subsequent double inlining · 88da0199
      Hongtao Yu authored
      Summary:
      A recent change in the instruction simplifier enables a call to a function that just returns one of its parameter to be simplified as simply loading the parameter. This exposes a bug in the inliner where double inlining may be involved which in turn may cause compiler ICE when an already-inlined callsite is reused for further inlining.
      To put it simply, in the following-like C program, when the function call second(t) is inlined, its code t = third(t) will be reduced to just loading the return value of the callsite first(). This causes the inliner internal data structure to register the first() callsite for the call edge representing the third() call, therefore incurs a double inlining when both call edges are considered an inline candidate. I'm making a fix to break the inliner from reusing a callsite for new call edges.
      
      ```
      void top()
      {
          int t = first();
          second(t);
      }
      
      void second(int t)
      {
         t = third(t);
         fourth(t);
      }
      
      void third(int t)
      {
         return t;
      }
      ```
      The actual failing case is much trickier than the example here and is only reproducible with the legacy inliner. The way the legacy inliner works is to process each SCC in a bottom-up order. That means in reality function first may be already inlined into top, or function third is either inlined to second or is folded into nothing. To repro the failure seen from building a large application, we need to figure out a way to confuse the inliner so that the bottom-up inlining is not fulfilled. I'm doing this by making the second call indirect so that the alias analyzer fails to figure out the right call graph edge from top to second and top can be processed before second during the bottom-up.  We also need to tweak the test code so that when the inlining of top happens, the function body of second is not that optimized, by delaying the pass of function attribute deducer (i.e, which tells function third has no side effect and just returns its parameter). Since the CGSCC pass is iterative, additional calls are added to top to postpone the inlining of second to the second round right after the first function attribute deducing pass is done. I haven't been able to repro the failure with the new pass manager since the processing order of ininlined callsites is a bit different, but in theory the issue could happen there too.
      
      Note that this fix could introduce a side effect that blocks the simplification of inlined code, specifically for a call site that can be folded to another call site. I hope this can probably be complemented by subsequent inlining or folding, as shown in the attached unit test. The ideal fix should be to separate the use of VMap. However, in reality this failing pattern shouldn't happen often. And even if it happens, there should be a good chance that the non-folded call site will be refolded by iterative inlining or subsequent simplification.
      
      Reviewers: wenlei, davidxl, tejohnson
      
      Reviewed By: wenlei, davidxl
      
      Subscribers: eraman, nikic, hiraditya, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D76248
      88da0199
  9. Apr 02, 2020
  10. Apr 01, 2020
  11. Mar 31, 2020
    • Wei Mi's avatar
      [SampleFDO] Port MD5 name table support to extbinary format. · ebad6788
      Wei Mi authored
      Compbinary format uses MD5 to represent strings in name table. That gives smaller profile without the need of compression/decompression when writing/reading the profile. The patch adds the support in extbinary format. It is off by default but user can choose to enable it.
      
      Note the feature of using MD5 in name table can bring very small chance of name conflict leading to profile mismatch. Besides, profile using the feature won't have the profile remapping support.
      
      Differential Revision: https://reviews.llvm.org/D76255
      ebad6788
  12. Mar 28, 2020
  13. Mar 24, 2020
  14. Mar 23, 2020
  15. Mar 22, 2020
    • Nikita Popov's avatar
      [InstCombine] Remove ExpensiveCombines option · dc819236
      Nikita Popov authored
      D75801 removed the last and only user of this option, so we can
      drop it now. The original idea behind this was to only run expensive
      transforms under -O3, but apart from the one known bits transform,
      this has never really taken off. I believe nowadays the recommendation
      is to put expensive transforms in AggressiveInstCombine instead,
      though that isn't terribly popular either :)
      
      Differential Revision: https://reviews.llvm.org/D76540
      dc819236
  16. Mar 18, 2020
  17. Mar 13, 2020
  18. Mar 12, 2020
  19. Mar 09, 2020
  20. Mar 07, 2020
  21. Mar 06, 2020
Loading