Skip to content
  1. Aug 01, 2018
    • Hans Wennborg's avatar
      Bump the trunk version to 8.0.0svn · 721c9e51
      Hans Wennborg authored
      llvm-svn: 338537
      721c9e51
    • Jonas Devlieghere's avatar
      [dsymutil] Convert recursion in lookForDIEsToKeep into worklist. · 53617672
      Jonas Devlieghere authored
      The functions `lookForDIEsToKeep` and `keepDIEAndDependencies` can have
      some very deep recursion. This tackles part of this problem by removing
      the recursion from `lookForDIEsToKeep` by turning it into a worklist.
      
      The difficulty in doing so is the computation of incompleteness, which
      depends on the incompleteness of its children. To compute this, we
      insert "continuation markers" into the worklist. This informs the work
      loop to (re)compute the incompleteness property of the DIE associated
      with it (i.e. the parent of the previously processed DIE).
      
      This patch should generate byte-identical output. Unfortunately it also
      has some impact of performance, regressing by about 4% when processing
      clang on my machine.
      
      Differential revision: https://reviews.llvm.org/D48899
      
      llvm-svn: 338536
      53617672
    • Simon Pilgrim's avatar
      bd014f4d
    • Simon Pilgrim's avatar
      [X86] Use isNullConstant helper. NFCI. · 564762cf
      Simon Pilgrim authored
      llvm-svn: 338530
      564762cf
    • Simon Pilgrim's avatar
      Fix "not all control paths return a value" MSVC warning. · 25b15f10
      Simon Pilgrim authored
      llvm-svn: 338529
      25b15f10
    • Jonas Devlieghere's avatar
      [MC] Report fatal error for DWARF types for non-ELF object files · 8acb74e0
      Jonas Devlieghere authored
      Getting the DWARF types section is only implemented for ELF object
      files. We already disabled emitting debug types in clang (r337717), but
      now we also report an fatal error (rather than crashing) when trying to
      obtain this section in MC. Additionally we ignore the generate debug
      types flag for unsupported target triples.
      
      See PR38190 for more information.
      
      Differential revision: https://reviews.llvm.org/D50057
      
      llvm-svn: 338527
      8acb74e0
    • Ryan Taylor's avatar
      [AMDGPU] Optimize _L image intrinsic to _LZ when lod is zero · 894c8fd0
      Ryan Taylor authored
      Summary:
      Add _L to _LZ image intrinsic table mapping to table gen.
      In ISelLowering check if image intrinsic has lod and if it's equal
      to zero, if so remove lod and change opcode to equivalent mapped _LZ.
      
      Change-Id: Ie24cd7e788e2195d846c7bd256151178cbb9ec71
      
      Subscribers: arsenm, mehdi_amini, kzhuravl, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, steven_wu, dexonsmith, llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D49483
      
      llvm-svn: 338523
      894c8fd0
    • Ulrich Weigand's avatar
      Fix build bot after r338521 · f989cd78
      Ulrich Weigand authored
      llvm-svn: 338522
      f989cd78
    • Ulrich Weigand's avatar
      [SystemZ, TableGen] Fix shift count handling · 58a9786e
      Ulrich Weigand authored
      The DAG combiner logic to simplify AND masks in shift counts is invalid.
      While it is true that the SystemZ shift instructions ignore all but the
      low 6 bits of the shift count, it is still invalid to simplify the AND
      masks while the DAG still uses the standard shift operators (which are
      *not* defined to match the SystemZ instruction behavior).
      
      Instead, this patch performs equivalent operations during instruction
      selection. For completely removing the AND, this now happens via
      additional DAG match patterns implemented by a multi-alternative
      PatFrags. For simplifying a 32-bit AND to a 16-bit AND, the existing DAG
      patterns were already mostly OK, they just needed an output XForm to
      actually truncate the immediate value.
      
      Unfortunately, the latter change also exposed a bug in TableGen: it
      seems XForms are currently only handled correctly for direct operands of
      the outermost operation node. This patch also fixes that bug by simply
      recurring through the whole pattern. This should be NFC for all other
      targets.
      
      Differential Revision: https://reviews.llvm.org/D50096
      
      llvm-svn: 338521
      58a9786e
    • Simon Pilgrim's avatar
      [X86] Use isNullConstant helper. NFCI. · e447a273
      Simon Pilgrim authored
      llvm-svn: 338516
      e447a273
    • Simon Pilgrim's avatar
      [llvm-mca][x86] Add STC + STD instruction resource tests · 18d025a7
      Simon Pilgrim authored
      llvm-svn: 338514
      18d025a7
    • Andrea Di Biagio's avatar
      [llvm-mca] Improve code comments. NFC. · 5291df3c
      Andrea Di Biagio authored
      llvm-svn: 338513
      5291df3c
    • Jonas Devlieghere's avatar
      [DebugInfo] Remove ambiguity to fix Windows bots · f73205b0
      Jonas Devlieghere authored
      Should fix the MSVC bots by explicitly invoking
      llvm::make_reverse_iterator to remove ambiguity with
      std::make_reverse_iterator.
      
      llvm-svn: 338511
      f73205b0
    • Jonas Devlieghere's avatar
      [DebugInfo] Improve consistency in DWARFDie.h (NFC) · 2c045cf9
      Jonas Devlieghere authored
      Follow-up for r338506 with some unrelated changes in formatting and
      consistency.
      
      llvm-svn: 338509
      2c045cf9
    • Andrew V. Tischenko's avatar
      [X86] Improved sched models for X86 BT*rr instructions. · dad919d3
      Andrew V. Tischenko authored
      Differential Revision: https://reviews.llvm.org/D49243
      
      llvm-svn: 338507
      dad919d3
    • Jonas Devlieghere's avatar
      [DebugInfo] Have custom std::reverse_iterator<DWARFDie> · 3a04bea9
      Jonas Devlieghere authored
      The DWARFDie is a lightweight utility wrapper that stores a pointer to a
      compile unit and a debug info entry. Currently, its iterator (used for
      walking over its children) stores a DWARFDie and returns a const
      reference when dereferencing it.
      
      When the iterator is modified (by incrementing or decrementing it), this
      reference becomes invalid. This was happening when calling reverse on
      it, because the std::reverse_iterator is keeping a temporary copy of the
      iterator (see
      https://en.cppreference.com/w/cpp/iterator/reverse_iterator for a good
      illustration).
      
      The relevant code in libcxx:
      
        reference operator*() const {_Iter __tmp = current; return *--__tmp;}
      
      When dereferencing the reverse iterator, we decrement and return a
      reference to a DWARFDie stored in the stack frame of this function,
      resulting in UB at runtime.
      
      This patch specifies the std::reverse_iterator for DWARFDie to do the
      right thing.
      
      Differential revision: https://reviews.llvm.org/D49679
      
      llvm-svn: 338506
      3a04bea9
    • Petar Jovanovic's avatar
      [MIPS GlobalISel] Select global address · 64c10ba8
      Petar Jovanovic authored
      Select G_GLOBAL_VALUE for position dependent code.
      
      Patch by Petar Avramovic.
      
      Differential Revision: https://reviews.llvm.org/D49803
      
      llvm-svn: 338499
      64c10ba8
    • David Bolvansky's avatar
      Revert "Enrich inline messages", tests fail · fbbb83c7
      David Bolvansky authored
      llvm-svn: 338496
      fbbb83c7
    • Hans Wennborg's avatar
      Add llvm-rc to LLVM_TOOLCHAIN_TOOLS (PR38386) · f23db0d7
      Hans Wennborg authored
      This means it will be installed also in builds configured with
      LLVM_INSTALL_TOOLCHAIN_ONLY, such as the Windows packages.
      
      llvm-svn: 338495
      f23db0d7
    • David Bolvansky's avatar
      Enrich inline messages · 7f36cd9d
      David Bolvansky authored
      Summary:
      This patch improves Inliner to provide causes/reasons for negative inline decisions.
      1. It adds one new message field to InlineCost to report causes for Always and Never instances. All Never and Always instantiations must provide a simple message.
      2. Several functions that used to return the inlining results as boolean are changed to return InlineResult which carries the cause for negative decision.
      3. Changed remark priniting and debug output messages to provide the additional messages and related inline cost.
      4. Adjusted tests for changed printing.
      
      Patch by: yrouban (Yevgeny Rouban)
      
      
      Reviewers: craig.topper, sammccall, sgraenitz, NutshellySima, shchenz, chandlerc, apilipenko, javed.absar, tejohnson, dblaikie, sanjoy, eraman, xbolva00
      
      Reviewed By: tejohnson, xbolva00
      
      Subscribers: xbolva00, llvm-commits, arsenm, mehdi_amini, eraman, haicheng, steven_wu, dexonsmith
      
      Differential Revision: https://reviews.llvm.org/D49412
      
      llvm-svn: 338494
      7f36cd9d
    • Martin Storsjö's avatar
      [AArch64] Disallow the MachO specific .loh directive for windows · d4590c38
      Martin Storsjö authored
      Also add a test for it being unsupported for linux.
      
      Differential Revision: https://reviews.llvm.org/D49929
      
      llvm-svn: 338493
      d4590c38
    • Craig Topper's avatar
      [X86] When looking for (CMOV C-1, (ADD (CTTZ X), C), (X != 0)) -> (ADD (CMOV... · 65a13888
      Craig Topper authored
      [X86] When looking for (CMOV C-1, (ADD (CTTZ X), C), (X != 0)) -> (ADD (CMOV (CTTZ X), -1, (X != 0)), C), make sure we really have a compare with 0.
      
      It's not strictly required by the transform of the cmov and the add, but it makes sure we restrict it to the cases we know we want to match.
      
      While there canonicalize the operand order of the cmov to simplify the matching and emitting code.
      
      llvm-svn: 338492
      65a13888
    • Victor Leschuk's avatar
      [DWARF] Basic support for producing DWARFv5 .debug_addr section · 64e0c567
      Victor Leschuk authored
      This revision implements support for generating DWARFv5 .debug_addr section.
      The implementation is pretty straight-forward: we just check the dwarf version
      and emit section header if needed.
      
      Reviewers: aprantl, dblaikie, probinson
      
      Reviewed by: dblaikie
      
      Differential Revision: https://reviews.llvm.org/D50005
      
      llvm-svn: 338487
      64e0c567
    • Hiroshi Inoue's avatar
      [InstSimplify] fold extracting from std::pair (1/2) · 02f79eae
      Hiroshi Inoue authored
      This patch intends to enable jump threading when a method whose return type is std::pair<int, bool> or std::pair<bool, int> is inlined.
      For example, jump threading does not happen for the if statement in func.
      
      std::pair<int, bool> callee(int v) {
        int a = dummy(v);
        if (a) return std::make_pair(dummy(v), true);
        else return std::make_pair(v, v < 0);
      }
      
      int func(int v) {
        std::pair<int, bool> rc = callee(v);
        if (rc.second) {
          // do something
        }
      
      SROA executed before the method inlining replaces std::pair by i64 without splitting in both callee and func since at this point no access to the individual fields is seen to SROA.
      After inlining, jump threading fails to identify that the incoming value is a constant due to additional instructions (like or, and, trunc).
      
      This series of patch add patterns in InstructionSimplify to fold extraction of members of std::pair. To help jump threading, actually we need to optimize the code sequence spanning multiple BBs.
      These patches does not handle phi by itself, but these additional patterns help NewGVN pass, which calls instsimplify to check opportunities for simplifying instructions over phi, apply phi-of-ops optimization to result in successful jump threading. 
      SimplifyDemandedBits in InstCombine, can do more general optimization but this patch aims to provide opportunities for other optimizers by supporting a simple but common case in InstSimplify.
      
      This first patch in the series handles code sequences that merges two values using shl and or and then extracts one value using lshr.
      
      Differential Revision: https://reviews.llvm.org/D48828
      
      llvm-svn: 338485
      02f79eae
    • Hsiangkai Wang's avatar
      [DebugInfo] Fix build failed in clang-x86_64-linux-selfhost-modules. · 2089e4c8
      Hsiangkai Wang authored
      Only generate symbol difference expression if needed.
      
      llvm-svn: 338484
      2089e4c8
    • Jatin Bhateja's avatar
      [X86] Adding more test patterns for lea-opt (PR37939) · 36432a70
      Jatin Bhateja authored
      Subscribers: llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D50128
      
      llvm-svn: 338483
      36432a70
    • Chandler Carruth's avatar
      [x86] Fix a really subtle miscompile due to a somewhat glaring bug in · 2ce191e2
      Chandler Carruth authored
      EFLAGS copy lowering.
      
      If you have a branch of LLVM, you may want to cherrypick this. It is
      extremely unlikely to hit this case empirically, but it will likely
      manifest as an "impossible" branch being taken somewhere, and will be
      ... very hard to debug.
      
      Hitting this requires complex conditions living across complex control
      flow combined with some interesting memory (non-stack) initialized with
      the results of a comparison. Also, because you have to arrange for an
      EFLAGS copy to be in *just* the right place, almost anything you do to
      the code will hide the bug. I was unable to reduce anything remotely
      resembling a "good" test case from the place where I hit it, and so
      instead I have constructed synthetic MIR testing that directly exercises
      the bug in question (as well as the good behavior for completeness).
      
      The issue is that we would mistakenly assume any SETcc with a valid
      condition and an initial operand that was a register and a virtual
      register at that to be a register *defining* SETcc...
      
      It isn't though....
      
      This would in turn cause us to test some other bizarre register,
      typically the base pointer of some memory. Now, testing this register
      and using that to branch on doesn't make any sense. It even fails the
      machine verifier (if you are running it) due to the wrong register
      class. But it will make it through LLVM, assemble, and it *looks*
      fine... But wow do you get a very unsual and surprising branch taken in
      your actual code.
      
      The fix is to actually check what kind of SETcc instruction we're
      dealing with. Because there are a bunch of them, I just test the
      may-store bit in the instruction. I've also added an assert for sanity
      that ensure we are, in fact, *defining* the register operand. =D
      
      llvm-svn: 338481
      2ce191e2
    • Chandler Carruth's avatar
      [x86/slh] Add unwind info to several tests to make it more obvious that · 014047a9
      Chandler Carruth authored
      we aren't incorrectly generating any of it when doing SLH.
      
      There was a bug that only occured with SLH that very much looked like it
      could be caused by bad unwind info, and so this was a prime suspect.
      Turns out that everything is fine, but this way we'll *see* if we end
      up, for example, putting things we shouldn't inside the prolog.
      
      llvm-svn: 338480
      014047a9
    • Hsiangkai Wang's avatar
      [DebugInfo] Generate fixups as emitting DWARF .debug_line. · 5c63af0d
      Hsiangkai Wang authored
      It is necessary to generate fixups in .debug_line as relaxation is
      enabled due to the address delta may be changed after relaxation.
      
      DWARF will record the mappings of lines and addresses in
      .debug_line section. It will encode the information using special
      opcodes, standard opcodes and extended opcodes in Line Number
      Program. I use DW_LNS_fixed_advance_pc to encode fixed length
      address delta and DW_LNE_set_address to encode absolute address
      to make it possible to generate fixups in .debug_line section.
      
      Differential Revision: https://reviews.llvm.org/D46850
      
      llvm-svn: 338477
      5c63af0d
    • Amara Emerson's avatar
      [GlobalISel][IRTranslator] Use RPO traversal when visiting blocks to translate. · 6cdfe29d
      Amara Emerson authored
      Previously we were just visiting the blocks in the function in IR order, which
      is rather arbitrary. Therefore we wouldn't always visit defs before uses, but
      the translation code relies on this assumption in some places.
      
      Only codegen change seen in tests is an elision of a redundant copy.
      
      Fixes PR38396
      
      llvm-svn: 338476
      6cdfe29d
    • Konstantin Zhuravlyov's avatar
      AMDGPU: Add clamp bit to dot intrinsics · bb30ef7a
      Konstantin Zhuravlyov authored
      Differential Revision: https://reviews.llvm.org/D49874
      
      llvm-svn: 338470
      bb30ef7a
    • Eric Christopher's avatar
      Simplify selectELFSectionForGlobal by pulling out the entry size · 7a70be68
      Eric Christopher authored
      determination for mergeable sections into a small static function.
      
      llvm-svn: 338469
      7a70be68
    • Eric Christopher's avatar
      Tidy up logic around unique section name creation and remove a · ad36c745
      Eric Christopher authored
      mostly unused variable.
      
      llvm-svn: 338468
      ad36c745
    • Eli Friedman's avatar
      [MachineOutliner] Clean up subtarget handling. · da08078f
      Eli Friedman authored
      Call shouldOutlineFromFunctionByDefault, isFunctionSafeToOutlineFrom,
      getOutliningType, and getMachineOutlinerMBBFlags using the correct
      TargetInstrInfo. And don't create a MachineFunction for a function
      declaration.
      
      The call to getOutliningCandidateInfo is still a little weird, but at
      least the weirdness is explicitly called out.
      
      Differential Revision: https://reviews.llvm.org/D49880
      
      llvm-svn: 338465
      da08078f
    • Evandro Menezes's avatar
      [PATCH] [SLC] Test simplification of pow() for vector types (NFC) · eb159e56
      Evandro Menezes authored
      Add test case for the simplification of `pow()` for vector types that D50035
      enables.
      
      llvm-svn: 338463
      eb159e56
    • Reid Kleckner's avatar
      Revert r338354 "[ARM] Revert r337821" · b32ff46f
      Reid Kleckner authored
      Disable ARMCodeGenPrepare by default again. It is causing verifier
      failues in V8 that look like:
      
        Duplicate integer as switch case
        switch i32 %trunc, label %if.end13 [
          i32 0, label %cleanup36
          i32 0, label %if.then8
        ], !dbg !4981
        i32 0
        fatal error: error in backend: Broken function found, compilation aborted!
      
      I will continue reducing the test case and send it along.
      
      llvm-svn: 338452
      b32ff46f
    • David L. Jones's avatar
      [WebAssembly] Fix debug info tests after r338437. · 9fb2e3ce
      David L. Jones authored
      After r338437, debug_ranges are no longer emitted. Previously, this was only
      done for DWARF version 5 and above.
      
      llvm-svn: 338448
      9fb2e3ce
    • Victor Leschuk's avatar
      [DWARF] Support for .debug_addr (consumer) · 58d3399d
      Victor Leschuk authored
        This patch implements basic support for parsing
        and dumping DWARFv5 .debug_addr section.
      
      llvm-svn: 338447
      58d3399d
    • Evandro Menezes's avatar
      [SLC] Refactor the simplication of pow() (NFC) · 61e4e407
      Evandro Menezes authored
      Reword comments and minor code reformatting.
      
      llvm-svn: 338446
      61e4e407
  2. Jul 31, 2018
    • Fangrui Song's avatar
      [llvm-objcopy] Make --strip-debug strip .gdb_index · 87b4b8f7
      Fangrui Song authored
      Summary:
      See binutils-gdb/bfd/elf.c, GNU objcopy also strips .stab* (STABS)
      .line* (DWARF 1) .gnu.linkonce.wi.* (linkonce section for .debug_info) but
      I'm not sure we need to be compatible with it.
      
      Reviewers: dblaikie, alexshap, jakehehrlich, jhenderson
      
      Reviewed By: alexshap, jakehehrlich
      
      Subscribers: aprantl, JDevlieghere, jakehehrlich, llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D50100
      
      llvm-svn: 338443
      87b4b8f7
Loading