1. Oct 26, 2018
    • Jonas Devlieghere's avatar
      Update test that checks auto-completion for settings set. · a2a2f2ef
      Jonas Devlieghere authored
      This reverts r345350 and updates the test rather than removing it. Now
      we check that `--g` auto-completes to `--global`.
      
      llvm-svn: 345351
      a2a2f2ef
    • Jonas Devlieghere's avatar
      Remove test that checks auto-completion for settings set. · 81fec429
      Jonas Devlieghere authored
      With the new `-f` option for `settings set`, `-` (dash) no longer
      auto-complete to `-g`.
      
      llvm-svn: 345350
      81fec429
    • Jonas Paulsson's avatar
      [SystemZ] Implement SystemZOperand::print() · dda46307
      Jonas Paulsson authored
      SystemZAsmParser can now handle -debug by printing the operands neatly to the
      output stream. Before this patch this lead to an llvm_unreachable().
      
      It seems that now '-mllvm -debug' does not cause any crashes anywhere (at
      least not on SPEC).
      
      Review: Ulrich Weigand
      https://reviews.llvm.org/D53328
      
      llvm-svn: 345349
      dda46307
    • Zachary Turner's avatar
      Dump public symbol records in pdb2yaml mode · ed2597e9
      Zachary Turner authored
      llvm-svn: 345348
      ed2597e9
    • Jonas Paulsson's avatar
      [SystemZ] Pass the DAG pointer from SystemZAddressingMode::dump(). · e2c5cbc1
      Jonas Paulsson authored
      In order to print the IR slot number for the memory operand, the DAG pointer
      must be passed to SDNode::dump().
      
      The isel-debug.ll test updated to also check for the IR Value reference being
      printed correctly.
      
      Review: Ulrich Weigand
      https://reviews.llvm.org/D53333
      
      llvm-svn: 345347
      e2c5cbc1
    • Jonas Devlieghere's avatar
      Add functionality to export settings · b76e25a2
      Jonas Devlieghere authored
      For the reproducer feature I need to be able to export and import the
      current LLDB configuration. To realize this I've extended the existing
      functionality to print settings. With the help of a new formatting
      option, we can now write the settings and their values to a file
      structured as regular commands.
      
      Concretely the functionality works as follows:
      
        (lldb) settings export -f /path/to/file
      
      This file contains a bunch of settings set commands, followed by the
      setting's name and value.
      
        ...
        settings set use-external-editor false
        settings set use-color true
        settings set auto-one-line-summaries true
        settings set auto-indent true
        ...
      
      You can import the settings again by either sourcing the file or using
      the settings read command.
      
        (lldb) settings read -f /path/to/file
      
      Differential revision: https://reviews.llvm.org/D52651
      
      llvm-svn: 345346
      b76e25a2
    • Heejin Ahn's avatar
      Reland "[WebAssembly] LSDA info generation" · 24faf859
      Heejin Ahn authored
      Summary:
      This adds support for LSDA (exception table) generation for wasm EH.
      Wasm EH mostly follows the structure of Itanium-style exception tables,
      with one exception: a call site table entry in wasm EH corresponds to
      not a call site but a landing pad.
      
      In wasm EH, the VM is responsible for stack unwinding. After an
      exception occurs and the stack is unwound, the control flow is
      transferred to wasm 'catch' instruction by the VM, after which the
      personality function is called from the compiler-generated code. (Refer
      to WasmEHPrepare pass for more information on this part.)
      
      This patch:
      - Changes wasm.landingpad.index intrinsic to take a token argument, to
      make this 1:1 match with a catchpad instruction
      - Stores landingpad index info and catch type info MachineFunction in
      before instruction selection
      - Lowers wasm.lsda intrinsic to an MCSymbol pointing to the start of an
      exception table
      - Adds WasmException class with overridden methods for table generation
      - Adds support for LSDA section in Wasm object writer
      
      Reviewers: dschuff, sbc100, rnk
      
      Subscribers: mgorny, jgravelle-google, sunfish, llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D52748
      
      llvm-svn: 345345
      24faf859
    • Bryan Chan's avatar
      [AArch64] Implement FP16FML intrinsics · 223307b3
      Bryan Chan authored
      Generate the FP16FML intrinsics into arm_neon.h (AArch64 only for now).
      Add two new type modifiers to NeonEmitter to handle the new prototypes.
      Define __ARM_FEATURE_FP16FML when +fp16fml is enabled and guard the
      intrinsics with the macro in arm_neon.h.
      
      Based on a patch by Gao Yiling.
      
      Differential Revision: https://reviews.llvm.org/D53633
      
      llvm-svn: 345344
      223307b3
    • Heejin Ahn's avatar
      [WebAssembly] Support EH instructions in InstPrinter · 3103d3dc
      Heejin Ahn authored
      Summary: This adds support for exception handling instructions to InstPrinter.
      
      Reviewers: dschuff, aardappel
      
      Subscribers: sbc100, jgravelle-google, sunfish, llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D53634
      
      llvm-svn: 345343
      3103d3dc
    • Jonas Paulsson's avatar
      Fix in MachineOperand::printIRValueReference(). · f213f81d
      Jonas Paulsson authored
      Handle the case where getCurrentFunction() returns nullptr by passing -1 to
      printIRSlotNumber(). This will result in <badref> being printed instead of an
      assertion failure.
      
      Review: Francis Visoiu Mistrih
      https://reviews.llvm.org/D53333
      
      llvm-svn: 345342
      f213f81d
    • George Karpenkov's avatar
      [analyzer] Fix a bug in "collapsed" graph viewer · ff6df778
      George Karpenkov authored
      Nodes which have only one predecessor and only one successor can not
      always be hidden, even if all states are the same.
      An additional condition is needed: the predecessor may have only one successor.
      This can be seen on this example:
      
      ```
        A
       / \
      B   C
       \ /
        D
      ```
      
      Nodes B and C can not be hidden even if all nodes in the graph have the
      same state.
      
      Differential Revision: https://reviews.llvm.org/D53735
      
      llvm-svn: 345341
      ff6df778
    • George Karpenkov's avatar
    • George Karpenkov's avatar
      [analyzer] Remove custom rule for OSIterator in RetainCountChecker · 7cdccb14
      George Karpenkov authored
      Differential Revision: https://reviews.llvm.org/D53628
      
      llvm-svn: 345339
      7cdccb14
    • George Karpenkov's avatar
      [analyzer] Correct modelling of OSDynamicCast: eagerly state split · 3c2ed8f3
      George Karpenkov authored
      Previously, OSDynamicCast was modeled as an identity.
      
      This is not correct: the output of OSDynamicCast may be zero even if the
      input was not zero (if the class is not of desired type), and thus the
      modeling led to false positives.
      
      Instead, we are doing eager state split:
      in one branch, the returned value is identical to the input parameter,
      and in the other branch, the returned value is zero.
      
      This patch required a substantial refactoring of canEval infrastructure,
      as now it can return different function summaries, and not just true/false.
      
      rdar://45497400
      
      Differential Revision: https://reviews.llvm.org/D53624
      
      llvm-svn: 345338
      3c2ed8f3
    • Bryan Chan's avatar
      [AArch64] Implement FP16FML intrinsics · f0923f16
      Bryan Chan authored
      Add LLVM intrinsics for the ARMv8.2-A FP16FML vector-form instructions. Add a
      DAG pattern to define the indexed-form intrinsics in terms of the vector-form
      ones, similarly to how the Dot Product intrinsics were implemented.
      
      Based on a patch by Gao Yiling.
      
      Differential Revision: https://reviews.llvm.org/D53632
      
      llvm-svn: 345337
      f0923f16
    • Heejin Ahn's avatar
      Delete test case. Assertions can't be tested. · 8370a95d
      Heejin Ahn authored
      llvm-svn: 345336
      8370a95d
    • Heejin Ahn's avatar
      Tidy up test case · cc719ba0
      Heejin Ahn authored
      llvm-svn: 345335
      cc719ba0
    • Heejin Ahn's avatar
      Address comments · 1d13e6be
      Heejin Ahn authored
      - Add llvm-mc test case (and delete the old one)
      - Change report_fatal_error to assertions
      
      llvm-svn: 345334
      1d13e6be
    • Heejin Ahn's avatar
      [WebAssembly] Error out when block/loop markers mismatch · 1147d914
      Heejin Ahn authored
      Summary:
      Currently InstPrinter ignores if there are mismatches between block/loop
      and end markers by skipping the case if ControlFlowStack is empty. I
      guess it is better to explicitly error out in this case, because this
      signals invalid input.
      
      Reviewers: aardappel
      
      Subscribers: dschuff, sbc100, jgravelle-google, sunfish, llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D53620
      
      llvm-svn: 345333
      1147d914
    • Fangrui Song's avatar
      [ELF] Add --{,no-}call-graph-profile-sort (enabled by default) · cc18f8aa
      Fangrui Song authored
      Summary: Add an option to disable sorting sections with call graph profile
      
      Reviewers: ruiu, Bigcheese, espindola
      
      Reviewed By: Bigcheese
      
      Subscribers: grimar, emaste, arichardson, llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D53683
      
      llvm-svn: 345332
      cc18f8aa
    • Jonas Paulsson's avatar
      [SystemZ] NFC reformatting in SystemZTargetTransformInfo.cpp · 2b280ea6
      Jonas Paulsson authored
      Some lines more than 80 characters long reformatted.
      
      llvm-svn: 345331
      2b280ea6
    • Richard Smith's avatar
      Add MS ABI mangling for operator<=>. · 1db7bd7a
      Richard Smith authored
      Thanks to Cameron DaCamara at Microsoft for letting us know what their
      chosen mangling is here!
      
      llvm-svn: 345330
      1db7bd7a
    • Reid Kleckner's avatar
      Avoid std::map&vector in hexagon builtin code to save code size · 9e9606ec
      Reid Kleckner authored
      Constructing a global std::map requires clang to generate a linear
      amount of code to construct the initializer list if the elements are not
      constexpr-constructible. std::vector is not constexpr-constructible, so
      this code pattern was generating large amounts of code.
      
      Also, because of PR38829, LLVM is pathologically slow on large basic
      blocks, and this causes slow compilation. This works around the bug and
      reduces code size.
      
      SemaChecking.cpp -debug-info-kind=limited:
              time      objsize
      before: 1m45.023s 9.8M
      after:  0m25.205s 6.9M
      
      So, a 42% obj size reduction and 3.2x speedup.
      
      llvm-svn: 345329
      9e9606ec
    • Richard Smith's avatar
      Avoid STMT_ and DECL_ bitcodes overlapping. · a0254cac
      Richard Smith authored
      This doesn't appear to matter for deserialization purposes, because we
      always know what kind of entity (declaration or statement/expression)
      we're trying to load, but it makes the llvm-bcanalyzer output a lot less
      mysterious.
      
      llvm-svn: 345328
      a0254cac
    • Jonas Paulsson's avatar
      [SystemZ] Improve getMemoryOpCost() to find foldable loads that are converted. · b7caa809
      Jonas Paulsson authored
      The SystemZ backend can do arithmetic of memory by loading and then extending
      one of the operands. Similarly, a load + truncate can be folded into an
      operand.
      
      This patch improves the SystemZ TTI cost function to recognize this.
      
      Review: Ulrich Weigand
      https://reviews.llvm.org/D52692
      
      llvm-svn: 345327
      b7caa809
    • David Blaikie's avatar
      DebugInfo: Explain why DW_LLE_(GNU_)startx_length is used · 73c2f197
      David Blaikie authored
      This isn't the most object-size efficient encoding, but it's the only
      one GDB supports for the pre-standard fission format. I've written fixes
      for this twice now... - so perhaps this comment will help me remember
      why neither of these have been committed and why I shouldn't try to
      write a third fix another year from now...
      
      llvm-svn: 345326
      73c2f197
    • Sanjay Patel's avatar
      [x86] add tests for missed load folding; NFC · c14aafda
      Sanjay Patel authored
      llvm-svn: 345325
      c14aafda
    • Evgeniy Stepanov's avatar
      [sanitizer] Fix mallopt interceptor. · ea857e82
      Evgeniy Stepanov authored
      On error, mallopt is supposed to return 0, not -1.
      
      llvm-svn: 345323
      ea857e82
    • Fangrui Song's avatar
      [ELF] Don't check if symbols in .llvm.call-graph-profile are unorderable · 018b0634
      Fangrui Song authored
      Summary: There are too many reasonable cases that would be considered unorderable.
      
      Reviewers: ruiu, espindola, Bigcheese
      
      Reviewed By: ruiu
      
      Subscribers: grimar, emaste, arichardson, llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D53669
      
      llvm-svn: 345322
      018b0634
    • Jonas Paulsson's avatar
      [SystemZ] Improve handling and cost estimates of vector integer div/rem · 4645711a
      Jonas Paulsson authored
      Enable the DAG optimization that converts vector div/rem with constants into
      multiply+shifts sequences by expanding them early. This is needed since
      ISD::SMUL_LOHI is 'Custom' lowered on SystemZ, and will therefore not be
      available to BuildSDIV after legalization.
      
      Better cost values for these instructions based on how they will be
      implemented (a constant divisor is cheaper).
      
      Review: Ulrich Weigand
      https://reviews.llvm.org/D53196
      
      llvm-svn: 345321
      4645711a
    • David Blaikie's avatar
    • Sumanth Gundapaneni's avatar
      [Pipeliner] Ignore Artificial dependences while computing recurrences. · ada0f511
      Sumanth Gundapaneni authored
      The artificial dependencies are not real dependencies. In some cases, they
      form circuits with bigger MII. However, they are used to schedule instructions
      better.
      
      Differential Revision: https://reviews.llvm.org/D53450
      
      llvm-svn: 345319
      ada0f511
    • Sumanth Gundapaneni's avatar
      [Pipeliner] Remove the unneeded include header(NFC). · dfdbc716
      Sumanth Gundapaneni authored
      Differential Revision: https://reviews.llvm.org/D53451
      
      llvm-svn: 345318
      dfdbc716
    • Craig Topper's avatar
      [X86] Change X86 backend to look for 'min-legal-vector-width' attribute... · 813064bf
      Craig Topper authored
      [X86] Change X86 backend to look for 'min-legal-vector-width' attribute instead of 'required-vector-width' when determining whether 512-bit vectors should be legal.
      
      The required-vector-width attribute was only used for backend testing and has never been generated by clang.
      
      I believe clang is now generating min-legal-vector-width for vector uses in user code.
      
      With this I believe passing -mprefer-vector-width=256 to clang should prevent use of zmm registers in the generated assembly unless the user used a 512-bit intrinsic in their source code.
      
      llvm-svn: 345317
      813064bf
    • Francis Visoiu Mistrih's avatar
      [CodeGen] Remove operands from FENTRY_CALL · 5be9e6de
      Francis Visoiu Mistrih authored
      FENTRY_CALL is actually not taking any input / output operands. The
      machine verifier complains now because the target description says that:
      
      * It needs 1 unknown output
      * It needs 1 or more variable inputs
      
      llvm-svn: 345316
      5be9e6de
    • David Greene's avatar
      [AArch64] Create proper memoperand for multi-vector stores · 53e869da
      David Greene authored
      Include all of the store's source vector operands when creating the
      MachineMemOperand. Previously, we were missing the first operand,
      making the store size seem smaller than it really is.
      
      Differential Revision: https://reviews.llvm.org/D52816
      
      llvm-svn: 345315
      53e869da
    • Zachary Turner's avatar
      Don't type-erase the FunctionNameType or TypeClass enums. · 117b1fa1
      Zachary Turner authored
      This is similar to D53597, but following up with 2 more enums.
      After this, all flag enums should be strongly typed all the way
      through to the symbol files plugins.
      
      Differential Revision: https://reviews.llvm.org/D53616
      
      llvm-svn: 345314
      117b1fa1
    • Zachary Turner's avatar
      Don't type-erase the SymbolContextItem enumeration. · 991e4453
      Zachary Turner authored
      When we get the `resolve_scope` parameter from the SB API, it's a
      `uint32_t`.  We then pass it through all of LLDB this way, as a uint32.
      This is unfortunate, because it means the user of an API never actually
      knows what they're dealing with.  We can call it something like
      `resolve_scope` and have comments saying "this is a value from the
      `SymbolContextItem` enumeration, but it makes more sense to just have it
      actually *be* the correct type in the actual C++ type system to begin
      with.  This way the person reading the code just knows what it is.
      
      The reason to use integers instead of enumerations for flags is because
      when you do bitwise operations on enumerations they get promoted to
      integers, so it makes it tedious to constantly be casting them back
      to the enumeration types, so I've introduced a macro to make this
      happen magically.  By writing LLDB_MARK_AS_BITMASK_ENUM after defining
      an enumeration, it will define overloaded operators so that the
      returned type will be the original enum.  This should address all
      the mechanical issues surrounding using rich enum types directly.
      
      This way, we get a better debugger experience, and new users to
      the codebase can get more easily acquainted with the codebase because
      their IDE features can help them understand what the types mean.
      
      Differential Revision: https://reviews.llvm.org/D53597
      
      llvm-svn: 345313
      991e4453
    • Zachary Turner's avatar
      [NFC] Refactor SetBaseClasses and DeleteBaseClasses. · 970f38ea
      Zachary Turner authored
      We currently had a 2-step process where we had to call
      SetBaseClassesForType and DeleteBaseClasses.  Every single caller
      followed this exact 2-step process, and there was manual memory
      management going on with raw pointers.  We can do better than this
      by storing a vector of unique_ptrs and passing this around.
      This makes for a cleaner API, and we only need to call one method
      so there is no possibility of a user forgetting to call
      DeleteBaseClassSpecifiers.
      
      In addition to this, it also makes for a *simpler* API.  Part of
      why I wanted to do this is because when I was implementing the native
      PDB interface I had to spend some time understanding exactly what I
      was deleting and why.  ClangAST has significant mental overhead
      associated with it, and reducing the API surface can go along
      way to making it simpler for people to understand.
      
      Differential Revision: https://reviews.llvm.org/D53590
      
      llvm-svn: 345312
      970f38ea
    • Nicolas Lesser's avatar
      [C++17] Reject shadowing of capture by parameter in lambda · 3cde5e4a
      Nicolas Lesser authored
      Summary:
      This change rejects the shadowing of a capture by a parameter in lambdas in C++17.
      
      ```
      int main() {
        int a;
        auto f = [a](int a) { return a; };
      }
      ```
      
      results in:
      
      ```
      main.cpp:3:20: error: a lambda parameter cannot shadow an explicitly captured entity
        auto f = [a](int a) { return a; };
                         ^
      main.cpp:3:13: note: variable a is explicitly captured here
        auto f = [a](int a) { return a; };
                  ^
      ```
      
      Reviewers: rsmith
      
      Reviewed By: rsmith
      
      Subscribers: lebedev.ri, erik.pilkington, cfe-commits
      
      Differential Revision: https://reviews.llvm.org/D53595
      
      llvm-svn: 345308
      3cde5e4a