Skip to content
  1. Jan 12, 2018
  2. Jan 11, 2018
    • Matthias Braun's avatar
      PeepholeOpt cleanup/refactor; NFC · bfd9c4a4
      Matthias Braun authored
      - Less unnecessary use of `auto`
      - Add early `using RegSubRegPair(AndIdx) =` to avoid countless
        `TargetInstrInfo::` qualifications.
      - Use references instead of pointers where possible.
      - Remove unused parameters.
      - Rewrite the CopyRewriter class hierarchy:
         - Pull out uncoalescable copy rewriting functionality into
           PeepholeOptimizer class.
         - Use an abstract base class to make it clear that rewriters are
           independent.
      - Remove unnecessary \brief in doxygen comments.
      - Remove unused constructor and method from ValueTracker.
      - Replace UseAdvancedTracking of ValueTracker with DisableAdvCopyOpt use.
      
      llvm-svn: 322325
      bfd9c4a4
    • Evgeniy Stepanov's avatar
      [hwasan] Stack instrumentation. · 99fa3e77
      Evgeniy Stepanov authored
      Summary:
      Very basic stack instrumentation using tagged pointers.
      Tag for N'th alloca in a function is built as XOR of:
       * base tag for the function, which is just some bits of SP (poor
         man's random)
       * small constant which is a function of N.
      
      Allocas are aligned to 16 bytes. On every ReturnInst allocas are
      re-tagged to catch use-after-return.
      
      This implementation has a bunch of issues that will be taken care of
      later:
      1. lifetime intrinsics referring to tagged pointers are not
         recognized in SDAG. This effectively disables stack coloring.
      2. Generated code is quite inefficient. There is one extra
         instruction at each memory access that adds the base tag to the
         untagged alloca address. It would be better to keep tagged SP in a
         callee-saved register and address allocas as an offset of that XOR
         retag, but that needs better coordination between hwasan
         instrumentation pass and prologue/epilogue insertion.
      3. Lifetime instrinsics are ignored and use-after-scope is not
         implemented. This would be harder to do than in ASan, because we
         need to use a differently tagged pointer depending on which
         lifetime.start / lifetime.end the current instruction is dominated
         / post-dominated.
      
      Reviewers: kcc, alekseyshl
      
      Subscribers: srhines, kubamracek, javed.absar, hiraditya, llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D41602
      
      llvm-svn: 322324
      99fa3e77
    • Sanjay Patel's avatar
      [InstSimplify] add tests for implied cmp with zero (PR35790); NFC · ac0edcb3
      Sanjay Patel authored
      llvm-svn: 322323
      ac0edcb3
    • Matthias Braun's avatar
      PeepholeOptimizer: Fix for vregs without defs · ea4359e9
      Matthias Braun authored
      The PeepholeOptimizer would fail for vregs without a definition. If this
      was caused by an undef operand abort to keep the code simple (so we
      don't need to add logic everywhere to replicate the undef flag).
      
      Differential Revision: https://reviews.llvm.org/D40763
      
      llvm-svn: 322319
      ea4359e9
    • Rafael Espindola's avatar
      Make internal/private GVs implicitly dso_local. · e4b0231c
      Rafael Espindola authored
      While updating clang tests for having clang set dso_local I noticed
      that:
      
      - There are *a lot* of tests to update.
      - Many of the updates are redundant.
      
      They are redundant because a GV is "obviously dso_local". This patch
      starts formalizing that a bit by requiring that internal and private
      GVs be dso_local too. Since they all are, we don't have to print
      dso_local to the textual representation, making it a bit more compact
      and easier to read.
      
      llvm-svn: 322317
      e4b0231c
    • Paul Robinson's avatar
      Tighten up DIFile verifier for checksums · cc9c8b95
      Paul Robinson authored
      Differential Revision: https://reviews.llvm.org/D41965
      
      llvm-svn: 322314
      cc9c8b95
    • Matthias Braun's avatar
      PeepholeOptimizer: Do not form PHI with subreg arguments · 08abcac9
      Matthias Braun authored
      When replacing a PHI the PeepholeOptimizer currently takes the register
      class of the register at the first operand. This however is not correct
      if this argument has a subregister index.
      
      As there is currently no API to query the register class resulting from
      applying a subregister index to all registers in a class, we can only
      abort in these cases and not perform the transformation.
      
      This changes findNextSource() to require the end of all copy chains to
      not use a subregister if there is any PHI in the chain. I had to rewrite
      the overly complicated inner loop there to have a good place to insert
      the new check.
      
      This fixes https://llvm.org/PR33071 (aka rdar://32262041)
      
      Differential Revision: https://reviews.llvm.org/D40758
      
      llvm-svn: 322313
      08abcac9
    • Evgeniy Stepanov's avatar
      [arm] Implement Target Operand Flag MIR serialization. · 5223b5d9
      Evgeniy Stepanov authored
      Reviewers: efriedma, pcc
      
      Subscribers: aemerson, javed.absar, kristof.beyls, hiraditya, llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D39975
      
      llvm-svn: 322312
      5223b5d9
    • Fiona Glaser's avatar
      [Sink] Really really fix predicate in legality check · efe6a84e
      Fiona Glaser authored
      LoadInst isn't enough; we need to include intrinsics that perform loads too.
      
      All side-effecting intrinsics and such are already covered by the isSafe
      check, so we just need to care about things that read from memory.
      
      D41960, originally from D33179.
      
      llvm-svn: 322311
      efe6a84e
    • Sam Clegg's avatar
      [WebAssemlby] MC: Don't write COMDAT symbols as global imports · d423f0d2
      Sam Clegg authored
      This was causing undefined references at link time in lld.
      
      Differential Revision: https://reviews.llvm.org/D41959
      
      llvm-svn: 322309
      d423f0d2
    • Craig Topper's avatar
      [X86] Legalize 128/256 gathers/scatters on KNL by using widening rather than... · 2aac3ee5
      Craig Topper authored
      [X86] Legalize 128/256 gathers/scatters on KNL by using widening rather than sign extending the index.
      
      We can just widen the vectors with undef and zero extend the mask.
      
      llvm-svn: 322308
      2aac3ee5
    • Sam Clegg's avatar
      [WebAssemly] Rename and improve formatting for ctor/dtor test · 0ce22ef7
      Sam Clegg authored
      llvm-svn: 322307
      0ce22ef7
    • Aaron Ballman's avatar
      Use size_t to represent the size of a StringMapEntry length and alignment rather than unsigned. · aac638eb
      Aaron Ballman authored
      Patch by Matt Davis.
      
      llvm-svn: 322305
      aac638eb
Loading