1. Mar 03, 2018
  2. Mar 02, 2018
    • Momchil Velikov's avatar
      [ARM] Fix access to stack arguments when re-aligning SP in Armv6m · 505614bb
      Momchil Velikov authored
      When an Armv6m function dynamically re-aligns the stack, access to incoming
      stack arguments (and to stack area, allocated for register varargs) is done via
      SP, which is incorrect, as the SP is offset by an unknown amount relative to the
      value of SP upon function entry.
      
      This patch fixes it, by making access to "fixed" frame objects be done via FP
      when the function needs stack re-alignment.  It also changes the access to
      "fixed" frame objects be done via FP (instead of using R6/BP) also for the case
      when the stack frame contains variable sized objects. This should allow more
      objects to fit within the immediate offset of the load instruction.
      
      All of the above via a small refactoring to reuse the existing
      `ARMFrameLowering::ResolveFrameIndexReference.`
      
      Differential Revision: https://reviews.llvm.org/D43566
      
      llvm-svn: 326584
      505614bb
    • Nicholas Wilson's avatar
      36f14f41
    • Clement Courbet's avatar
      [MergeICmps] Revert accidentally submitted failing test case. · c9119b3b
      Clement Courbet authored
      Reverts r326574.
      
      llvm-svn: 326582
      c9119b3b
    • Nicholas Wilson's avatar
      [WebAssembly] Export non-hidden defined data symbols via wasm globals · f2f6d5e0
      Nicholas Wilson authored
      This fixes a TODO introduced in rLLD325861.
      
      Differential Revision: https://reviews.llvm.org/D43930
      
      llvm-svn: 326581
      f2f6d5e0
    • Nicholas Wilson's avatar
      [WebAssembly] Pass ownership of body to SyntheticFunction. NFC · f6dbc2ed
      Nicholas Wilson authored
      This avoids the Writer unnecessarily having a member to retain ownership
      of the function body.
      
      Differential Revision: https://reviews.llvm.org/D43933
      
      llvm-svn: 326580
      f6dbc2ed
    • Nicholas Wilson's avatar
      [WebAssembly] Add validation for init function signature · cb81a0c9
      Nicholas Wilson authored
      Differential Revision: https://reviews.llvm.org/D43947
      
      llvm-svn: 326579
      cb81a0c9
    • Stefan Pintilie's avatar
      [Power9] Add missing instructions to the Power 9 scheduler · b5a9440a
      Stefan Pintilie authored
      Adding more instructions using InstRW so that we can move away from ItinRW
      and ultimately have a complete Power 9 scheduler.
      
      llvm-svn: 326578
      b5a9440a
    • Nicholas Wilson's avatar
      [WebAssembly] Check function type indexes · 3b825105
      Nicholas Wilson authored
      Also update tests containing invalid Wasm files, exposed by the check
      
      Differential Revision: https://reviews.llvm.org/D43954
      
      llvm-svn: 326577
      3b825105
    • Florian Hahn's avatar
      [Docs] Add LLVM for Grad Students to Contributing page. · 9cc67133
      Florian Hahn authored
      Adrian Sampson's blog post provides a good and relatively up-do-date
      introduction to LLVM. I think this post could be helpful for people wanting
      to get started with LLVM.
      
      Reviewers: asb, tonic, silvas, probinson, kristof.beyls, rengolin
      
      Reviewed By: rengolin
      
      Differential Revision: https://reviews.llvm.org/D42904
      
      llvm-svn: 326576
      9cc67133
    • Clement Courbet's avatar
      [MergeICmps] Revert 324317 "Enable the MergeICmps Pass by default." · c6638c81
      Clement Courbet authored
      While working on PR36557.
      
      llvm-svn: 326575
      c6638c81
    • Clement Courbet's avatar
      [MergeIcmps] Add the test case from PR36557. · 1de4a183
      Clement Courbet authored
      Summary: See PR36557.
      
      Subscribers: llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D44009
      
      llvm-svn: 326574
      1de4a183
    • David Stenberg's avatar
      Test commit: Remove an extraneous space. NFC · 3fb8c324
      David Stenberg authored
      Test commit access.
      
      llvm-svn: 326573
      3fb8c324
    • Nicholas Wilson's avatar
      Revert "[WebAssembly] More uses of uint8_t" and "[WebAssembly] Update tests" · be28e61a
      Nicholas Wilson authored
      This reverts commits r326541 and r326571.
      
      The tests were correct, and were updated with incorrect expectations.
      The original commit was broken and should be reverted to get things back
      to a working state.
      
      llvm-svn: 326572
      be28e61a
    • Ilya Biryukov's avatar
      [WebAssembly] Update tests after r326541 · 45f8b19a
      Ilya Biryukov authored
      r326541 slightly increased the size of WebAssembly object files
      and it broke test/MC/WebAssembly/global-ctor-dtor.ll.
      
      This commit updates the test to unbreak it, also mentioned this to the
      author of the original commit in case they don't want it.
      
      llvm-svn: 326571
      45f8b19a
    • Florian Hahn's avatar
      [ARM] Fix codegen for VLD3/VLD4/VST3/VST4 with WB · 9deef20b
      Florian Hahn authored
      Code generation of VLD3, VLD4, VST3 and VST4 with register writeback is
      broken due to 2 separate bugs:
      
      1) VLD1d64TPseudoWB_register and VLD1d64QPseudoWB_register are missing
         rules to expand them to non pseudo MIR. These are selected for
         ARMISD::VLD3_UPD/VLD4_UPD with v1i64 vectors in SelectVLD.
      
      2) Selection of the right VLD/VST instruction is broken for load and
         store of 3 and 4 v1i64 vectors. SelectVLD and SelectVST are called
         with MIR opcode for fixed writeback (ie increment is access size)
         and call getVLDSTRegisterUpdateOpcode() to select an opcode with
         register writeback if base register update is of a different size.
         Since getVLDSTRegisterUpdateOpcode() only knows about
         VLD1/VLD2/VST1/VST2 the call is currently conditional on the number
         of element in the vector.
      
         However, VLD1/VST1 is selected by SelectVLD/SelectVST's caller for
         load and stores of 3 or 4 v1i64 vectors. Therefore the opcode is not
         updated which later lead to a fixed writeback instruction being
         constructed with an extra operand for the register writeback.
      
      This patch addresses the two issues as follows:
      - it adds the necessary mapping from VLD1d64TPseudoWB_register and
        VLD1d64QPseudoWB_register to VLD1d64Twb_register and
        VLD1d64Qwb_register respectively. Like for the existing _fixed
        variants, the cost of these is bumped for unaligned access.
      - it changes the logic in SelectVLD and SelectVSD to call isVLDfixed
        and isVSTfixed respectively to decide whether the opcode should be
        updated. It also reworks the logic and comments for pushing the
        writeback offset operand and r0 operand to clarify the logic:
        writeback offset needs to be pushed if it's a register writeback,
        r0 needs to be pushed if not and the instruction is a
        VLD1/VLD2/VST1/VST2.
      
      Reviewers: rengolin, t.p.northover, samparker
      
      Reviewed By: samparker
      
      Patch by Thomas Preud'homme <thomas.preudhomme@arm.com>
      
      Differential Revision: https://reviews.llvm.org/D42970
      
      llvm-svn: 326570
      9deef20b
    • Ilya Biryukov's avatar
      [clang] Fix use-after-free on code completion · ddf6a333
      Ilya Biryukov authored
      Summary:
      Found by asan. Fiddling with code completion AST after
      FrontendAction::Exceute can lead to errors.
      Calling the callback in ProcessCodeCompleteResults to make sure we
      don't access uninitialized state.
      
      This particular issue comes from the fact that Sema::TUScope is
      deleted when destructor of ~Parser runs, but still present in
      Sema::TUScope and accessed when building completion items.
      
      I'm still struggling to come up with a small repro. The relevant
      stackframes reported by asan are:
      ERROR: AddressSanitizer: heap-use-after-free on address
      READ of size 8 at 0x61400020d090 thread T175
          #0 0x5632dff7821b in llvm::SmallPtrSetImplBase::isSmall() const include/llvm/ADT/SmallPtrSet.h:195:33
          #1 0x5632e0335901 in llvm::SmallPtrSetImplBase::insert_imp(void const*) include/llvm/ADT/SmallPtrSet.h:127:9
          #2 0x5632e067347d in llvm::SmallPtrSetImpl<clang::Decl*>::insert(clang::Decl*) include/llvm/ADT/SmallPtrSet.h:372:14
          #3 0x5632e065df80 in clang::Scope::AddDecl(clang::Decl*) tools/clang/include/clang/Sema/Scope.h:287:18
          #4 0x5632e0623eea in clang::ASTReader::pushExternalDeclIntoScope(clang::NamedDecl*, clang::DeclarationName) clang/lib/Serialization/ASTReader.cpp
          #5 0x5632e062ce74 in clang::ASTReader::finishPendingActions() tools/clang/lib/Serialization/ASTReader.cpp:9164:9
          ....
          #30 0x5632e02009c4 in clang::index::generateUSRForDecl(clang::Decl const*, llvm::SmallVectorImpl<char>&) tools/clang/lib/Index/USRGeneration.cpp:1037:6
          #31 0x5632dff73eab in clang::clangd::(anonymous namespace)::getSymbolID(clang::CodeCompletionResult const&) tools/clang/tools/extra/clangd/CodeComplete.cpp:326:20
          #32 0x5632dff6fe91 in clang::clangd::CodeCompleteFlow::mergeResults(std::vector<clang::CodeCompletionResult, std::allocator<clang::CodeCompletionResult> > const&, clang::clangd::SymbolSlab const&)::'lambda'(clang::CodeCompletionResult const&)::operator()(clang::CodeCompletionResult const&) tools/clang/tools/extra/clangd/CodeComplete.cpp:938:24
          #33 0x5632dff6e426 in clang::clangd::CodeCompleteFlow::mergeResults(std::vector<clang::CodeCompletionResult, std::allocator<clang::CodeCompletionResult> > const&, clang::clangd::SymbolSlab const&) third_party/llvm/llvm/tools/clang/tools/extra/clangd/CodeComplete.cpp:949:38
          #34 0x5632dff7a34d in clang::clangd::CodeCompleteFlow::runWithSema() llvm/tools/clang/tools/extra/clangd/CodeComplete.cpp:894:16
          #35 0x5632dff6df6a in clang::clangd::CodeCompleteFlow::run(clang::clangd::(anonymous namespace)::SemaCompleteInput const&) &&::'lambda'()::operator()() const third_party/llvm/llvm/tools/clang/tools/extra/clangd/CodeComplete.cpp:858:35
          #36 0x5632dff6cd42 in clang::clangd::(anonymous namespace)::semaCodeComplete(std::unique_ptr<clang::CodeCompleteConsumer, std::default_delete<clang::CodeCompleteConsumer> >, clang::CodeCompleteOptions const&, clang::clangd::(anonymous namespace)::SemaCompleteInput const&, llvm::function_ref<void ()>) tools/clang/tools/extra/clangd/CodeComplete.cpp:735:5
      
      0x61400020d090 is located 80 bytes inside of 432-byte region [0x61400020d040,0x61400020d1f0)
      freed by thread T175  here:
          #0 0x5632df74e115 in operator delete(void*, unsigned long) projects/compiler-rt/lib/asan/asan_new_delete.cc:161:3
          #1 0x5632e0b06973 in clang::Parser::~Parser() tools/clang/lib/Parse/Parser.cpp:410:3
          #2 0x5632e0b06ddd in clang::Parser::~Parser() clang/lib/Parse/Parser.cpp:408:19
          #3 0x5632e0b03286 in std::unique_ptr<clang::Parser, std::default_delete<clang::Parser> >::~unique_ptr() .../bits/unique_ptr.h:236:4
          #4 0x5632e0b021c4 in clang::ParseAST(clang::Sema&, bool, bool) tools/clang/lib/Parse/ParseAST.cpp:182:1
          #5 0x5632e0726544 in clang::FrontendAction::Execute() tools/clang/lib/Frontend/FrontendAction.cpp:904:8
          #6 0x5632dff6cd05 in clang::clangd::(anonymous namespace)::semaCodeComplete(std::unique_ptr<clang::CodeCompleteConsumer, std::default_delete<clang::CodeCompleteConsumer> >, clang::CodeCompleteOptions const&, clang::clangd::(anonymous namespace)::SemaCompleteInput const&, llvm::function_ref<void ()>) tools/clang/tools/extra/clangd/CodeComplete.cpp:728:15
      
      Reviewers: sammccall
      
      Reviewed By: sammccall
      
      Subscribers: klimek, jkorous-apple, cfe-commits, ioeric
      
      Differential Revision: https://reviews.llvm.org/D44000
      
      llvm-svn: 326569
      ddf6a333
    • Florian Hahn's avatar
      [LV][CFG] Add irreducible CFG detection for outer loops · 515acd64
      Florian Hahn authored
      This patch adds support for detecting outer loops with irreducible control
      flow in LV. Current detection uses SCCs and only works for innermost loops.
      This patch adds a utility function that works on any CFG, given its RPO
      traversal and its LoopInfoBase. This function is a generalization
      of isIrreducibleCFG  from lib/CodeGen/ShrinkWrap.cpp. The code in
      lib/CodeGen/ShrinkWrap.cpp is also updated to use the new generic utility
      function.
      
      Patch by Diego Caballero <diego.caballero@intel.com>
      
      Differential Revision: https://reviews.llvm.org/D40874
      
      llvm-svn: 326568
      515acd64
    • Matt Arsenault's avatar
      AMDGPU/GlobalISel: Define instruction mapping for @llvm.maxnum · b46c191c
      Matt Arsenault authored
      Patch by Tom Stellard
      
      llvm-svn: 326567
      b46c191c
    • Alexey Sotkin's avatar
      Add possibility to specify output stream for CompilerInstance · aba98fc9
      Alexey Sotkin authored
      Patch by: krisb
      
      Reviewers: teemperor
      
      Reviewed By: teemperor
      
      Subscribers: klimek, mgorny, cfe-commits
      
      Differential Revision: https://reviews.llvm.org/D43809
      
      llvm-svn: 326566
      aba98fc9
    • Simon Pilgrim's avatar
      [X86] Remove old UNIMPLEMENTED list · c879aa7e
      Simon Pilgrim authored
      All of these are implemented and have appropriate test coverage
      
      llvm-svn: 326553
      c879aa7e
    • Jonas Devlieghere's avatar
      [testsuite] Remove workaround for categories and inline tests. · 3a9d4313
      Jonas Devlieghere authored
      Adding categories to inline tests does not work because the attribute
      is set at the function level. For methods, this means it applies to all
      instances of that particular class. While this is what we want in most
      cases, it's not for inline tests, where different instances correspond
      to different tests.
      
      With the workaround in place, assigning a category to one test resulted
      in the category applied to *all* inline tests.
      
      This patch removes the workaround and throws an exception with an
      informative error message, to prevent this from happening in the future.
      
      llvm-svn: 326552
      3a9d4313
    • Mikhail Maltsev's avatar
      [Sema] Improve test coverage of narrowing conversion diagnostics · 2373516c
      Mikhail Maltsev authored
      Summary:
      This patch adds tests of narrowing conversion diagnostics for the
      'unscoped enum -> integer' case.
      
      Reviewers: faisalv, rsmith, rogfer01
      
      Reviewed By: rogfer01
      
      Subscribers: cfe-commits, rogfer01
      
      Differential Revision: https://reviews.llvm.org/D43572
      
      llvm-svn: 326551
      2373516c
    • Eric Liu's avatar
      [clangd:vscode] Bump clangd-vscode version to 0.0.4. · fdaeb9bf
      Eric Liu authored
      llvm-svn: 326548
      fdaeb9bf