1. Nov 05, 2018
    • Craig Topper's avatar
      [DAGCombiner] Remove an unused argument from tryFoldToZero. NFC · 8d64abdd
      Craig Topper authored
      llvm-svn: 346118
      8d64abdd
    • Dylan McKay's avatar
      [AVR] Fix a backend bug that left extraneous operands after expansion · 4c5a5c8d
      Dylan McKay authored
      This patch fixes a bug in the AVR FRMIDX expansion logic.
      
      The expansion would leave a leftover operand from the original FRMIDX,
      but now attached to a MOVWRdRr instruction. The MOVWRdRr instruction
      did not expect this operand and so LLVM rejected the machine
      instruction.
      
      This would trigger an assertion:
      
          Assertion failed: ((isImpReg || Op.isRegMask() || MCID->isVariadic() ||
                              OpNo < MCID->getNumOperands() || isMetaDataOp) &&
                              "Trying to add an operand to a machine instr that is already done!"),
          function addOperand, file llvm/lib/CodeGen/MachineInstr.cpp
      
      Tim fixed this so that now the FRMIDX is expanded correctly into
      a well-formed MOVWRdRr.
      
      Patch by Tim Neumann
      
      llvm-svn: 346117
      4c5a5c8d
    • Dean Michael Berris's avatar
      [XRay] Update TSC math to handle wraparound · 1e255e7a
      Dean Michael Berris authored
      Summary:
      Prior to this change, we can run into situations where the TSC we're
      getting when exiting a function is less than the TSC we got when
      entering it. This would sometimes cause the counter for cumulative call
      times overflow, which was erroneously also being stored as a signed
      64-bit integer.
      
      This change addresses both these issues while adding provisions for
      tracking CPU migrations. We do this because moving from one CPU to
      another doesn't guarantee that the timestamp counter for some
      architectures aren't guaranteed to be synchronised. For the moment, we
      leave the provisions there until we can update the data format to
      include the counting of CPU migrations we can catch.
      
      We update the necessary tests as well, ensuring that our expectations
      for the cycle accounting to be met in case of counter wraparound.
      
      Reviewers: mboerger
      
      Subscribers: llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D54088
      
      llvm-svn: 346116
      1e255e7a
    • Craig Topper's avatar
      [X86] Custom type legalize v2i8/v2i16/v2i32 mul to use to pmuludq. · 30b627e5
      Craig Topper authored
      v2i8/v2i16/v2i32 are promoted to v2i64. pmuludq takes a v2i64 input and produces a v2i64 output. Since we don't about the upper bits of the type legalized multiply we can use the pmuludq to produce the multiply result for the bits we do care about.
      
      llvm-svn: 346115
      30b627e5
    • Dylan McKay's avatar
      [AVR] Disallow the LDDWRdPtrQ instruction with Z as the destination · 9a9ae99b
      Dylan McKay authored
      This is an AVR-specific workaround for a limitation of the register
      allocator that only exposes itself on targets with high register
      contention like AVR, which only has three pointer registers.
      
      The three pointer registers are X, Y, and Z.
      In most nontrivial functions, Y is reserved for the frame pointer,
      as per the calling convention. This leaves X and Z. Some instructions,
      such as LPM ("load program memory"), are only defined for the Z
      register. Sometimes this just leaves X.
      
      When the backend generates a LDDWRdPtrQ instruction with Z as the
      destination pointer, it usually trips up the register allocator
      with this error message:
      
        LLVM ERROR: ran out of registers during register allocation
      
      This patch is a hacky workaround. We ban the LDDWRdPtrQ instruction
      from ever using the Z register as an operand. This gives the
      register allocator a bit more space to allocate, fixing the
      regalloc exhaustion error.
      
      Here is a description from the patch author Peter Nimmervoll
      
        As far as I understand the problem occurs when LDDWRdPtrQ uses
        the ptrdispregs register class as target register. This should work, but
        the allocator can't deal with this for some reason. So from my testing,
        it seams like (and I might be totally wrong on this) the allocator reserves
        the Z register for the ICALL instruction and then the register class
        ptrdispregs only has 1 register left and we can't use Y for source and
        destination. Removing the Z register from DREGS fixes the problem but
        removing Y register does not.
      
      More information about the bug can be found on the avr-rust issue
      tracker at https://github.com/avr-rust/rust/issues/37.
      
      A bug has raised to track the removal of this workaround and a proper
      fix; PR39553 at https://bugs.llvm.org/show_bug.cgi?id=39553.
      
      Patch by Peter Nimmervoll
      
      llvm-svn: 346114
      9a9ae99b
    • Kristof Umann's avatar
      [analyzer] Restrict AnalyzerOptions' interface so that non-checker objects have to be registered · 0a1f91c8
      Kristof Umann authored
      One of the reasons why AnalyzerOptions is so chaotic is that options can be
      retrieved from the command line whenever and wherever. This allowed for some
      options to be forgotten for a looooooong time. Have you ever heard of
      "region-store-small-struct-limit"? In order to prevent this in the future, I'm
      proposing to restrict AnalyzerOptions' interface so that only checker options
      can be retrieved without special getters. I would like to make every option be
      accessible only through a getter, but checkers from plugins are a thing, so I'll
      have to figure something out for that.
      
      This also forces developers who'd like to add a new option to register it
      properly in the .def file.
      
      This is done by
      
      * making the third checker pointer parameter non-optional, and checked by an
        assert to be non-null.
      * I added new, but private non-checkers option initializers, meant only for
        internal use,
      * Renamed these methods accordingly (mind the consistent name for once with
        getBooleanOption!):
        - getOptionAsString -> getCheckerStringOption,
        - getOptionAsInteger -> getCheckerIntegerOption
      * The 3 functions meant for initializing data members (with the not very
        descriptive getBooleanOption, getOptionAsString and getOptionAsUInt names)
        were renamed to be overloads of the getAndInitOption function name.
      * All options were in some way retrieved via getCheckerOption. I removed it, and
        moved the logic to getStringOption and getCheckerStringOption. This did cause
        some code duplication, but that's the only way I could do it, now that checker
        and non-checker options are separated. Note that the non-checker version
        inserts the new option to the ConfigTable with the default value, but the
        checker version only attempts to find already existing entries. This is how
        it always worked, but this is clunky and I might end reworking that too, so we
        can eventually get a ConfigTable that contains the entire configuration of the
        analyzer.
      
      Differential Revision: https://reviews.llvm.org/D53483
      
      llvm-svn: 346113
      0a1f91c8
    • Kristof Umann's avatar
      Ensure the correct order of evaluation in part 2. of PlistMacroExpansion · cb88cc67
      Kristof Umann authored
      Windows buildbots break with the previous commit '[analyzer][PlistMacroExpansion]
      Part 2.: Retrieving the macro name and primitive expansion'. This patch attempts
      to solve this issue.
      
      llvm-svn: 346112
      cb88cc67
    • Kristof Umann's avatar
    • Craig Topper's avatar
      [X86] Fix typo in test comment. NFC · 60789b34
      Craig Topper authored
      llvm-svn: 346110
      60789b34
    • David Carlier's avatar
      [LLDB] Fix FreeBSD/Darwin build · 511e1cf1
      David Carlier authored
      Reviewers: JDevlieghere, tatyana-krasnukha
      
      Reviwed By: tatyana-krasnukha
      
      Differential Revision: https://reviews.llvm.org/D54084
      
      llvm-svn: 346109
      511e1cf1
    • Vedant Kumar's avatar
      [HotColdSplitting] Use TTI to inform outlining threshold · d2a895a9
      Vedant Kumar authored
      Using TargetTransformInfo allows the splitting pass to factor in the
      code size cost of instructions as it decides whether or not outlining is
      profitable.
      
      This did not regress the overall amount of outlining seen on the handful
      of internal frameworks I tested.
      
      Thanks to Jun Bum Lim for suggesting this!
      
      Differential Revision: https://reviews.llvm.org/D53835
      
      llvm-svn: 346108
      d2a895a9
    • Petr Hosek's avatar
      [Driver] Use -Bstatic/dynamic for libc++ on Fuchsia · 6c652b7f
      Petr Hosek authored
      -static relies on lld's behavior, but -Bstatic/dynamic is supported
      across all linkers.
      
      Differential Revision: https://reviews.llvm.org/D54082
      
      llvm-svn: 346107
      6c652b7f
    • Craig Topper's avatar
      6d3c7136
    • Craig Topper's avatar
    • Marshall Clow's avatar
      89176c72
    • Sylvestre Ledru's avatar
      Add support of the next Ubuntu (Ubuntu 19.04 - Disco Dingo) · 99682d0a
      Sylvestre Ledru authored
      llvm-svn: 346103
      99682d0a
    • Craig Topper's avatar
      [X86] Add vector shift by immediate to SimplifyDemandedBitsForTargetNode. · ed6a0a81
      Craig Topper authored
      Summary: This also enables some constant folding from KnownBits propagation. This helps on some cases vXi64 case in 32-bit mode where constant vectors appear as vXi32 and a bitcast. This can prevent getNode from constant folding sra/shl/srl.
      
      Reviewers: RKSimon, spatel
      
      Reviewed By: spatel
      
      Subscribers: llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D54069
      
      llvm-svn: 346102
      ed6a0a81
    • Sylvestre Ledru's avatar
      Update our URLs in clang doc to use https · bc5c3f57
      Sylvestre Ledru authored
      llvm-svn: 346101
      bc5c3f57
    • Kamil Rytarowski's avatar
      Fix NetBSD build after "Move path resolution logic out of FileSpec" · a0a44e9c
      Kamil Rytarowski authored
      D53915
      
      llvm-svn: 346100
      a0a44e9c
  2. Nov 04, 2018