1. Sep 14, 2018
    • Fangrui Song's avatar
      [clangd] Fix TUScheduler typos · 847bd331
      Fangrui Song authored
      llvm-svn: 342198
      847bd331
    • Hideki Saito's avatar
      [VPlan] Implement initial vector code generation support for simple outer loops. · ea7f3035
      Hideki Saito authored
      Summary:
      [VPlan] Implement vector code generation support for simple outer loops.
      
      Context: Patch Series #1 for outer loop vectorization support in LV  using VPlan. (RFC: http://lists.llvm.org/pipermail/llvm-dev/2017-December/119523.html).
                                                                
      This patch introduces vector code generation support for simple outer loops that are currently supported in the VPlanNativePath. Changes here essentially do the following:
      
        - force vector code generation using explicit vectorize_width
      
        - add conservative early returns in cost model and other places for VPlanNativePath
      
        - add code for setting up outer loop inductions 
      
        - support for widening non-induction PHIs that can result from inner loops and uniform conditional branches
      
        - support for generating uniform inner branches
      
      We plan to add a handful C outer loop executable tests once the initial code generation support is committed. This patch is expected to be NFC for the inner loop vectorizer path. Since we are moving in the direction of supporting outer loop vectorization in LV, it may also be time to rename classes such as InnerLoopVectorizer. 
      
      Reviewers: fhahn, rengolin, hsaito, dcaballe, mkuper, hfinkel, Ayal
      
      Reviewed By: fhahn, hsaito
      
      Subscribers: dmgreen, bollu, tschuett, rkruppe, rogfer01, llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D50820
      
      llvm-svn: 342197
      ea7f3035
    • Vedant Kumar's avatar
      Relax alignment assumptions in a test after r342194 · ce9e2965
      Vedant Kumar authored
      Don't hardcode align 8.
      
      Fixes a bot failure:
      http://lab.llvm.org:8011/builders/clang-cmake-armv8-full/builds/6373
      
      llvm-svn: 342196
      ce9e2965
    • Vedant Kumar's avatar
      Update a clang-tidy test for r342194 · 8d8579ff
      Vedant Kumar authored
      The location of implicit captures has changed. Update a use-after-move
      checker test to reflect that.
      
      This fixes a bot failure:
      http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-ubuntu-fast/builds/36500
      
      llvm-svn: 342195
      8d8579ff
    • Vedant Kumar's avatar
      [Sema] Remove location from implicit capture init expr · 35d303ad
      Vedant Kumar authored
      A lambda's closure is initialized when the lambda is declared. For
      implicit captures, the initialization code emitted from EmitLambdaExpr
      references source locations *within the lambda body* in the function
      containing the lambda. This results in a poor debugging experience: we
      step to the line containing the lambda, then into lambda, out again,
      over and over, until every capture's field is initialized.
      
      To improve stepping behavior, assign the starting location of the lambda
      to expressions which initialize an implicit capture within it.
      
      rdar://39807527
      
      Differential Revision: https://reviews.llvm.org/D50927
      
      llvm-svn: 342194
      35d303ad
    • Richard Diamond's avatar
      [NFC] Link LLVMCore into LLVMExegesisARMTests. · 975ff5a6
      Richard Diamond authored
      Fixes missing `llvm::LLVMContext::~LLVMContext()` symbols w/
      `BUILD_SHARED_LIBS`.
      
      llvm-svn: 342193
      975ff5a6
    • Richard Smith's avatar
      Fix crash on call to __builtin_memcpy with a null pointer to an · 128719c4
      Richard Smith authored
      incomplete type.
      
      Also improve the diagnostics for similar situations.
      
      llvm-svn: 342192
      128719c4
    • Rui Ueyama's avatar
      COFF: Add support for /force:multiple option · 11ca38f4
      Rui Ueyama authored
      Patch by Thomas Roughton.
      
      This patch adds support for linking with multiple definitions to LLD's
      COFF driver, in line with link.exe's /force:multiple option.
      
      Differential Revision: https://reviews.llvm.org/D50598
      
      llvm-svn: 342191
      11ca38f4
    • Jim Ingham's avatar
      svn add the new files... · e19adf54
      Jim Ingham authored
      I started from a clean slate to do the checkin, but forgot to svn add the new files.
      Do that now.
      
      Also add the one new source file to CMakeLists.txt
      
      llvm-svn: 342190
      e19adf54
    • Tim Renouf's avatar
      [AMDGPU] Removed unused method · c8af6a46
      Tim Renouf authored
      Summary:
      I accidentally left this behind in D50306, and it causes a build warning
      when I build with gcc7.
      
      Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, t-tye, llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D52022
      
      Change-Id: I30f7a47047e9d9d841f652da66d2fea19e74842c
      llvm-svn: 342189
      c8af6a46
    • Jim Ingham's avatar
      Remember to sort the Xcode project file. NFC. · 2e947040
      Jim Ingham authored
      llvm-svn: 342188
      2e947040
    • Matt Morehouse's avatar
      [SanitizerCoverage] Create comdat for global arrays. · 3bea25e5
      Matt Morehouse authored
      Summary:
      Place global arrays in comdat sections with their associated functions.
      This makes sure they are stripped along with the functions they
      reference, even on the BFD linker.
      
      Reviewers: eugenis
      
      Reviewed By: eugenis
      
      Subscribers: eraman, hiraditya, llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D51902
      
      llvm-svn: 342186
      3bea25e5
    • Jim Ingham's avatar
      Add a "scripted" breakpoint type to lldb. · 3815e702
      Jim Ingham authored
      This change allows you to write a new breakpoint type where the
      logic for setting breakpoints is determined by a Python callback
      written using the SB API's.
      
      Differential Revision: https://reviews.llvm.org/D51830
      
      llvm-svn: 342185
      3815e702
    • Roman Lebedev's avatar
      [NFC][InstCombine] PR38708 - inefficient pattern for high-bits checking 3. · d2316d75
      Roman Lebedev authored
      The last, non-canonical variant:
      https://godbolt.org/z/aCMsPk
      https://rise4fun.com/Alive/I6f
      
      It can only happen due to the extra use on the inner shift.
      But here it is ok.
      
      https://bugs.llvm.org/show_bug.cgi?id=38708
      
      llvm-svn: 342184
      d2316d75
    • Amara Emerson's avatar
    • Roman Lebedev's avatar
      LLVMExegesisX86Tests: link to LLVMCore, too. · b6d188da
      Roman Lebedev authored
      Fixes build for me.
      Refs. D52054
      
      [215/217] Linking CXX executable unittests/tools/llvm-exegesis/X86/LLVMExegesisX86Tests
      FAILED: unittests/tools/llvm-exegesis/X86/LLVMExegesisX86Tests
      : && /usr/bin/g++  -pipe -O2 -g0 -UNDEBUG -fPIC -fvisibility-inlines-hidden -Werror=date-time -std=c++11 -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wno-maybe-uninitialized -Wno-class-memaccess -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wno-comment -fdiagnostics-color -ffunction-sections -fdata-sections -pipe -O2 -g0 -UNDEBUG  -fuse-ld=lld -Wl,--color-diagnostics -Wl,-allow-shlib-undefined     -Wl,-O3 -Wl,--gc-sections unittests/tools/llvm-exegesis/X86/CMakeFiles/LLVMExegesisX86Tests.dir/AssemblerTest.cpp.o unittests/tools/llvm-exegesis/X86/CMakeFiles/LLVMExegesisX86Tests.dir/AnalysisTest.cpp.o unittests/tools/llvm-exegesis/X86/CMakeFiles/LLVMExegesisX86Tests.dir/SnippetGeneratorTest.cpp.o unittests/tools/llvm-exegesis/X86/CMakeFiles/LLVMExegesisX86Tests.dir/RegisterAliasingTest.cpp.o unittests/tools/llvm-exegesis/X86/CMakeFiles/LLVMExegesisX86Tests.dir/TargetTest.cpp.o  -o unittests/tools/llvm-exegesis/X86/LLVMExegesisX86Tests  -Wl,-rpath,/build/llvm-build-GCC-release/lib lib/libLLVMMC.so.8svn lib/libLLVMMCParser.so.8svn lib/libLLVMObject.so.8svn lib/libLLVMSymbolize.so.8svn lib/libLLVMX86CodeGen.so.8svn lib/libLLVMX86AsmParser.so.8svn lib/libLLVMX86AsmPrinter.so.8svn lib/libLLVMX86Desc.so.8svn lib/libLLVMX86Disassembler.so.8svn lib/libLLVMX86Info.so.8svn lib/libLLVMX86Utils.so.8svn lib/libLLVMSupport.so.8svn -lpthread lib/libgtest_main.so.8svn lib/libgtest.so.8svn -lpthread lib/libLLVMExegesis.so.8svn lib/libLLVMExegesisX86.so.8svn && :
      ld.lld: error: undefined symbol: llvm::LLVMContext::~LLVMContext()
      >>> referenced by AssemblerTest.cpp
      >>>               unittests/tools/llvm-exegesis/X86/CMakeFiles/LLVMExegesisX86Tests.dir/AssemblerTest.cpp.o:(exegesis::(anonymous namespace)::X86MachineFunctionGeneratorTest_DISABLED_JitFunction_Test::TestBody())
      
      ld.lld: error: undefined symbol: llvm::LLVMContext::~LLVMContext()
      >>> referenced by AssemblerTest.cpp
      >>>               unittests/tools/llvm-exegesis/X86/CMakeFiles/LLVMExegesisX86Tests.dir/AssemblerTest.cpp.o:(exegesis::(anonymous namespace)::X86MachineFunctionGeneratorTest_DISABLED_JitFunctionXOR32rr_Default_Test::TestBody())
      
      ld.lld: error: undefined symbol: llvm::LLVMContext::~LLVMContext()
      >>> referenced by AssemblerTest.cpp
      >>>               unittests/tools/llvm-exegesis/X86/CMakeFiles/LLVMExegesisX86Tests.dir/AssemblerTest.cpp.o:(void exegesis::MachineFunctionGeneratorBaseTest::Check<int, int, int, int, int, int, int, int>(exegesis::ExegesisTarget const&, llvm::ArrayRef<unsigned int>, llvm::MCInst, int, int, int, int, int, int, int, int))
      
      ld.lld: error: undefined symbol: llvm::LLVMContext::~LLVMContext()
      >>> referenced by AssemblerTest.cpp
      >>>               unittests/tools/llvm-exegesis/X86/CMakeFiles/LLVMExegesisX86Tests.dir/AssemblerTest.cpp.o:(exegesis::(anonymous namespace)::X86MachineFunctionGeneratorTest_DISABLED_JitFunctionMOV32ri_Test::TestBody())
      collect2: error: ld returned 1 exit status
      ninja: build stopped: subcommand failed.
      
      llvm-svn: 342182
      b6d188da
    • Raphael Isemann's avatar
      Add support for descriptions with command completions. · 7f88829c
      Raphael Isemann authored
      Summary:
      This patch adds a framework for adding descriptions to the command completions we provide.
      It also adds descriptions for completed top-level commands so that we can test this code.
      
      Completions are in general supposed to be displayed alongside the completion itself. The descriptions
      can be used to provide additional information about the completion to the user. Examples for descriptions
      are function signatures when completing function calls in the expression command or the binary name
      when providing completion for a symbol.
      
      There is still some boilerplate code from the old completion API left in LLDB (mostly because the respective
      APIs are reused for non-completion related purposes, so the CompletionRequest doesn't make sense to be
      used), so that's why I still had to change some function signatures. Also, as the old API only passes around a
      list of matches, and the descriptions are for these functions just another list, I had to add some code that
      essentially just ensures that both lists are always the same side (e.g. all the manual calls to
      `descriptions->AddString(X)` below a `matches->AddString(Y)` call).
      
      The initial command descriptions that come with this patch are just reusing the existing
      short help that is already added in LLDB.
      
      An example completion with descriptions looks like this:
      ```
      (lldb) pl
      Available completions:
              platform -- Commands to manage and create platforms.
              plugin   -- Commands for managing LLDB plugins.
      ```
      
      Reviewers: #lldb, jingham
      
      Reviewed By: #lldb, jingham
      
      Subscribers: jingham, JDevlieghere, lldb-commits
      
      Differential Revision: https://reviews.llvm.org/D51175
      
      llvm-svn: 342181
      7f88829c
    • Sam Clegg's avatar
      [llvm-exegesis] Add missing MC dependency to CMakeLists.txt · 9b3e7c36
      Sam Clegg authored
      See rL342148
      
      This probably only shows up in BUILD_SHARED_LIBS=ON builds
      which might explain how it crept in.
      
      Differential Revision: https://reviews.llvm.org/D52054
      
      llvm-svn: 342180
      9b3e7c36
    • Peter Collingbourne's avatar
      [bindings/go] Add DebugLoc parameter to InsertXXXAtEnd() · 33d37b2e
      Peter Collingbourne authored
      These functions previously passed nil for the location, which always resulted in a crash.
      
      This is a signature breaking change, but I cannot see how they could have been used before.
      
      Patch by Ben Clayton!
      
      Differential Revision: https://reviews.llvm.org/D51970
      
      llvm-svn: 342179
      33d37b2e
    • Richard Smith's avatar
      Add dependency on new llvm-cxxmap tool to check-llvm. · 3e32c815
      Richard Smith authored
      llvm-svn: 342178
      3e32c815
    • Richard Smith's avatar
      Diagnose likely typos in #include directives. · 2ce63b42
      Richard Smith authored
      Summary:
      When someone writes
      
        #include "<some_file>"
      
      or
      
        #include " some_file "
      
      the compiler returns "file not fuond..." with fonts and quotes that may
      make it hard to see there are excess quotes or surprising bytes in the
      filename.  Assuming that files are usually logically named and start and
      end with an alphanumeric character, we can check for the file's
      existence by stripping the non-alphanumeric leading or trailing
      characters.  If the file is found, emit a non-fatal error with a
      FixItHint.
      
      Patch by Christy Lee!
      
      Reviewers: aaron.ballman, erikjv, rsmith
      
      Reviewed By: rsmith
      
      Subscribers: lebedev.ri, xbolva00, sammccall, modocache, erikjv, aaron.ballman, cfe-commits
      
      Differential Revision: https://reviews.llvm.org/D51333
      
      llvm-svn: 342177
      2ce63b42
    • Craig Topper's avatar
      [MachineInstr] In addRegisterKilled and addRegisterDead, don't remove operands... · 2f88006c
      Craig Topper authored
      [MachineInstr] In addRegisterKilled and addRegisterDead, don't remove operands from inline assembly instructions if they have an associated flag operand.
      
      INLINEASM instructions use extra operands to carry flags. If a register operand is removed without removing the flag operand, then the flags will no longer make sense.
      
      This patch fixes this by preventing the removal when a flag operand is present.
      
      The included test case was generated by MS inline assembly. Longer term maybe we should fix the inline assembly parsing to not generate redundant operands.
      
      Differential Revision: https://reviews.llvm.org/D51829
      
      llvm-svn: 342176
      2f88006c
    • Nirav Dave's avatar
      [X86] Fix register resizings for inline assembly register operands. · 59ad1c84
      Nirav Dave authored
      When replacing a named register input to the appropriately sized
      sub/super-register. In the case of a 64-bit value being assigned to a
      register in 32-bit mode, match GCC's assignment.
      
      Reviewers: eli.friedman, craig.topper
      
      Subscribers: nickdesaulniers, llvm-commits, hiraditya
      
      Differential Revision: https://reviews.llvm.org/D51502
      
      llvm-svn: 342175
      59ad1c84
    • Nirav Dave's avatar
      [X86] Cleanup pair returns. NFCI. · 2060a16d
      Nirav Dave authored
      llvm-svn: 342174
      2060a16d
    • Roman Lebedev's avatar
      [InstCombine] Inefficient pattern for high-bits checking 2 (PR38708) · 6dc87004
      Roman Lebedev authored
      Summary:
      It is sometimes important to check that some newly-computed value
      is non-negative and only n bits wide (where n is a variable.)
      There are many ways to check that:
      https://godbolt.org/z/o4RB8D
      The last variant seems best?
      (I'm sure there are some other variations i haven't thought of..)
      
      More complicated, canonical pattern:
      https://rise4fun.com/Alive/uhA
      
      We do need to have two `switch()`'es like this,
      to not mismatch the swappable predicates.
      
      https://bugs.llvm.org/show_bug.cgi?id=38708
      
      Reviewers: spatel, craig.topper, RKSimon
      
      Reviewed By: spatel
      
      Subscribers: llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D52001
      
      llvm-svn: 342173
      6dc87004
    • George Burgess IV's avatar
      [PartiallyInlineLibCalls] Add DebugCounter support · d565b0f0
      George Burgess IV authored
      This adds DebugCounter support to the PartiallyInlineLibCalls pass,
      which should make debugging/automated bisection easier in the future.
      
      Patch by Zhizhou Yang!
      
      Differential Revision: https://reviews.llvm.org/D50093
      
      llvm-svn: 342172
      d565b0f0
    • Roman Lebedev's avatar
      [NFC][InstCombine] Test what happens if 'unefficient high bit check' pattern is on both sides. · 08374485
      Roman Lebedev authored
      Came up in https://reviews.llvm.org/D52001#1233827
      While we don't do a good job here, we at least want to make
      sure that we don't have any inf-loops.
      
      llvm-svn: 342171
      08374485
    • George Burgess IV's avatar
      [DCE] Add DebugCounter support · 7a8dc3da
      George Burgess IV authored
      Patch by Zhizhou Yang!
      
      Differential Revision: https://reviews.llvm.org/D50092
      
      llvm-svn: 342170
      7a8dc3da
    • Volodymyr Sapsai's avatar
      Revert "[cmake] Fix a unittest when `LLVM_LINK_LLVM_DYLIB` is requested." · 008982d0
      Volodymyr Sapsai authored
      This reverts commit r342150 as it caused test failure
      
          LLVM-Unit :: Passes/./PluginsTests/PluginsTests.LoadPlugin
      
      on multiple bots.
      
      llvm-svn: 342169
      008982d0
    • Richard Smith's avatar
      Add flag to llvm-profdata to allow symbols in profile data to be remapped, and · 3164fcfd
      Richard Smith authored
      add a tool to generate symbol remapping files.
      
      Summary:
      The new tool llvm-cxxmap builds a symbol mapping table from a file containing
      a description of partial equivalences to apply to mangled names and files
      containing old and new symbol tables.
      
      Reviewers: davidxl
      
      Subscribers: mgorny, llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D51470
      
      llvm-svn: 342168
      3164fcfd
    • Pavel Labath's avatar
      NativeProcessProtocol: Sink ReadMemoryWithoutTrap into base class · 2ce26527
      Pavel Labath authored
      The two existing implementations have the function implemented
      identically, and there's no reason to believe that this would be
      different for other implementations.
      
      llvm-svn: 342167
      2ce26527
    • Richard Smith's avatar
      Fix a couple of mangling canonicalizer corner case bugs. · 8d8c057e
      Richard Smith authored
      Summary:
      The hash computed for an ArrayType was different when first constructed
      versus when later profiled due to the constructor default argument, and
      we were not tracking constructor / destructor variant as part of the
      mangled name AST, leading to incorrect equivalences.
      
      Reviewers: erik.pilkington
      
      Subscribers: llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D51463
      
      llvm-svn: 342166
      8d8c057e
    • Stephen Hines's avatar
      Support -fno-omit-frame-pointer with -pg. · f9ca6dd8
      Stephen Hines authored
      Summary:
      Previously, any instance of -fomit-frame-pointer would make it such that
      -pg was an invalid flag combination. If -fno-omit-frame-pointer is
      passed later on the command line (such that it actually takes effect),
      -pg should be allowed.
      
      Reviewers: nickdesaulniers
      
      Reviewed By: nickdesaulniers
      
      Subscribers: manojgupta, nickdesaulniers, cfe-commits, kongyi, chh, pirama
      
      Differential Revision: https://reviews.llvm.org/D51713
      
      llvm-svn: 342165
      f9ca6dd8
    • Kostya Serebryany's avatar
    • Craig Topper's avatar
      [InstCombine] Fold (xor (min/max X, Y), -1) -> (max/min ~X, ~Y) when X and Y are freely invertible. · 8fc05ce3
      Craig Topper authored
      This allows the xor to be removed completely.
      
      This might help with recomitting r341674, but seems good regardless.
      
      Coincidentally fixes PR38915.
      
      Differential Revision: https://reviews.llvm.org/D51964
      
      llvm-svn: 342163
      8fc05ce3
    • Craig Topper's avatar
      [InstCombine] Add test cases for D51964. NFC · 3fc5e72d
      Craig Topper authored
      llvm-svn: 342162
      3fc5e72d
    • Richard Smith's avatar
      Common infrastructure for reading a profile remapping file and building · 327f0550
      Richard Smith authored
      a mangling remapper from it.
      
      Differential Revision: https://reviews.llvm.org/D51246
      
      llvm-svn: 342161
      327f0550
    • Ana Pazos's avatar
      [RISCV][MC] Reject bare symbols for the simm6 and simm6nonzero operand types · 065b0887
      Ana Pazos authored
      Summary:
      Fixed assertions due to invalid fixup when encoding compressed instructions
       (c.addi, c.addiw, c.li, c.andi) with bare symbols with/without modifiers.
        This matches GAS behavior as well.
      
      This bug was uncovered by a LLVM MC Disassembler Protocol Buffer Fuzzer
      for the RISC-V assembly language.
      
      Reviewers: asb
      
      Reviewed By: asb
      
      Subscribers: rbar, johnrusso, simoncook, sabuasal, niosHD, kito-cheng, shiva0217, zzheng, edward-jones, mgrang, rogfer01, MartinMosbeck, brucehoult, the_o, rkruppe, PkmX, jocewei, asb
      
      Differential Revision: https://reviews.llvm.org/D52005
      
      llvm-svn: 342160
      065b0887
    • Ana Pazos's avatar
      [RISCV] Fix decoding of invalid instruction with C extension enabled. · b0799dda
      Ana Pazos authored
      Summary:
      The illegal instruction 0x00 0x00 is being wrongly decoded as
      c.addi4spn with 0 immediate.
      
      The invalid instruction 0x01 0x61 is being wrongly decoded as
      c.addi16sp with 0 immediate.
      
      This bug was uncovered by a LLVM MC Disassembler Protocol Buffer Fuzzer
      for the RISC-V assembly language.
      
      Reviewers: asb
      
      Reviewed By: asb
      
      Subscribers: rbar, johnrusso, simoncook, sabuasal, niosHD, kito-cheng, shiva0217, zzheng, edward-jones, mgrang, rogfer01, MartinMosbeck, brucehoult, the_o, rkruppe, PkmX, jocewei, asb
      
      Differential Revision: https://reviews.llvm.org/D51815
      
      llvm-svn: 342159
      b0799dda
    • Nico Weber's avatar
      lld-link: For nonexisting inputs, omit follow-on diagnostics · f1828e32
      Nico Weber authored
      For lld-link missing.obj, lld-link currently prints:
      
        lld-link: error: could not open foo.obj: No such file or directory
        lld-link: warning: /machine is not specified. x64 is assumed
        lld-link: error: subsystem must be defined
      
      The 2nd and 3rd diagnostics are consequences of the input not existing and are
      not interesting. If input files are missing, the best thing we can do is point
      that out and then return.
      
      Differential Revision: https://reviews.llvm.org/D51981
      
      llvm-svn: 342158
      f1828e32