1. Apr 25, 2018
    • Aaron Smith's avatar
      [lit, lldbsuite] Update the lldbsuite to correctly run tests on windows and windows server · ba48c9bd
      Aaron Smith authored
      Summary:
      The new script to run the lldbtests as part of lit invokes each test by calling dotest.py, however, we cannot rely on the system to always correctly interpret the script as python causing the tests to be unresolved on windows (at least). To fix this, we need to make sure that the first parameter in the command line is the python executable itself.
      
      In Makefile.rules, there are a number of windows specific definitions that rely on the HOST_OS being set as Windows_NT but the logic detecting the OS currently does not detect server versions of windows correctly. This change updates the logic to detect windows server as well.
      
      Reviewers: asmith, labath, JDevlieghere, zturner
      
      Reviewed By: JDevlieghere, zturner
      
      Subscribers: zturner, llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D46020
      
      llvm-svn: 330740
      ba48c9bd
    • Diego Caballero's avatar
      [LV][VPlan] Detect outer loops for explicit vectorization. · 60f2776b
      Diego Caballero authored
      Patch #2 from VPlan Outer Loop Vectorization Patch Series #1
      (RFC: http://lists.llvm.org/pipermail/llvm-dev/2017-December/119523.html).
      
      This patch introduces the basic infrastructure to detect, legality check
      and process outer loops annotated with hints for explicit vectorization.
      All these changes are protected under the feature flag
      -enable-vplan-native-path. This should make this patch NFC for the existing
      inner loop vectorizer.
      
      Reviewers: hfinkel, mkuper, rengolin, fhahn, aemerson, mssimpso.
      
      Differential Revision: https://reviews.llvm.org/D42447
      
      llvm-svn: 330739
      60f2776b
    • Florian Hahn's avatar
      [LoopInterchange] Make isProfitableForVectorization slightly more conservative. · ceee7889
      Florian Hahn authored
      After D43236, we started interchanging loops with empty dependence
      matrices.  In isProfitableForVectorization, we try to determine if
      interchanging makes the loop dependences more friendly to the
      vectorizer. If there are no dependences, we should not interchange,
      based on that heuristic.
      
      Reviewers: efriedma, mcrosier, karthikthecool, blitz.opensource
      
      Reviewed By: mcrosier
      
      Differential Revision: https://reviews.llvm.org/D45208
      
      llvm-svn: 330738
      ceee7889
    • Simon Pilgrim's avatar
      [X86][F16C] Add WriteCvtF2FSt scheduling class · f0945aa0
      Simon Pilgrim authored
      Fixes the classification of VCVTPS2PHmr/VCVTPS2PHYmr which were tagged as WriteCvtF2FLd_WriteRMW (PR36887)
      
      llvm-svn: 330737
      f0945aa0
    • Fangrui Song's avatar
      [ADT] Remove ilist_default_traits · 11b1e889
      Fangrui Song authored
      llvm-svn: 330736
      11b1e889
    • Simon Pilgrim's avatar
      [X86][BtVer2] Fix VCVTPS2PHmr/VCVTPS2PHYmr latencies · 828ef9e0
      Simon Pilgrim authored
      These are stores, not loads, so don't need to account for load latency.
      
      llvm-svn: 330735
      828ef9e0
    • Simon Pilgrim's avatar
      [X86][IVB] Add F16C resource tests. · f35b8ac1
      Simon Pilgrim authored
      Note this is IvyBridge (which shares the model) NOT SandyBridge.
      
      llvm-svn: 330734
      f35b8ac1
    • Andrea Di Biagio's avatar
      [llvm-mca] Default the output asm dialect used by the instruction printer to the input asm dialect. · 0626864f
      Andrea Di Biagio authored
      The instruction printer used by llvm-mca to generate the performance report now
      defaults the output assembly format to the format used for the input assembly
      file.
      
      On x86, the asm format can be either AT&T or Intel, depending on the
      presence/absence of directive `.intel_syntax`.
      
      Users can still specify a different assembly dialect with the command line flag
      -output-asm-variant=<uint>.
      
      llvm-svn: 330733
      0626864f
    • Simon Atanasyan's avatar
      [mips] Show an error if register number is out of range · 9df3be3c
      Simon Atanasyan authored
      Current code does not check that a register number is in the 0-31 range.
      Sometimes the parser checks that later for some kinds of instructions,
      but that leads to unclear / incorrect error messages like that:
      
        % cat test.s
        .text
        lb $4, 8($32)
      
        % llvm-mc test.s -triple=mips64-unknown-linux
        test.s:2:10: error: expected memory with 16-bit signed offset
          lb $4, 8($32)
                 ^
      
      Sometimes the parser just crashes:
      
        % cat test.s
        .text
        lw  $4, 8($32)
      
        % llvm-mc test.s -triple=mips64-unknown-linux
      
      This patch resolves the problem by checking that register number after
      '$' sign is in the 0-31 range. If the number is out of the range the
      parser shows the `invalid register number` error, but treats invalid
      register number as a normal one to continue parsing and catch other
      possible errors.
      
      Differential Revision: https://reviews.llvm.org/D45919
      
      llvm-svn: 330732
      9df3be3c
    • Sanjay Patel's avatar
      [InstCombine] regenerate checks; NFC · 510af48e
      Sanjay Patel authored
      The first step in fixing problems raised in D45862
      is to make the problems visible. Now we can more easily
      see/update cases where selects have been turned into 
      multiple instructions with no apparent improvement in 
      analysis or benefits for other passes (vectorization).
      
      llvm-svn: 330731
      510af48e
  2. Apr 24, 2018
    • Mark Searles's avatar
      [AMDGPU][Waitcnt] NFC. Cleanup some code/naming consistency: · 70901b90
      Mark Searles authored
      - s/SWaitcnt/Waitcnt s/WaitCnt/Waitcnt
      
      llvm-svn: 330730
      70901b90
    • Sanjay Patel's avatar
      [InstCombine] regenerate checks; NFC · f03ec655
      Sanjay Patel authored
      The current version of the script uses regex for params.
      This could mask a bug (param values got wrongly swapped),
      but it seems unlikely in practice, so let's just update
      the whole file to reduce diffs when there is a meaningful
      change here.
      
      llvm-svn: 330729
      f03ec655
    • Dan Liew's avatar
      [lit] Remove spurious `-` in invocation of lit in · 97a60c21
      Dan Liew authored
      `shtest-xunit-output.py` test.
      
      Although there is no `-` file Jeremy Morse has reported to me that it
      causes problems in their setup because lit tries to find it and ends up
      loading an out of tree lit configuration file.
      
      llvm-svn: 330728
      97a60c21
    • Nico Weber's avatar
      Remove LLVM_INSTALL_CCTOOLS_SYMLINKS · 8c77bf9e
      Nico Weber authored
      It used to symlink dsymutil to llvm-dsymutil, but after r327790 llvm's dsymutil
      binary is now called dsymutil without prefix.
      
      r327792 then reversed the direction of the symlink if
      LLVM_INSTALL_CCTOOLS_SYMLINKS was set, but that looks like a buildfix and not
      like something anyone should need.
      
      https://reviews.llvm.org/D45966
      
      llvm-svn: 330727
      8c77bf9e
    • David Blaikie's avatar
      ba47dd16
    • Benjamin Kramer's avatar
      [LoadStoreVectorize] Ignore interleaved invariant loads. · f85f5da3
      Benjamin Kramer authored
      The memory location an invariant load is using can never be clobbered by
      any store, so it's safe to move the load ahead of the store.
      
      Differential Revision: https://reviews.llvm.org/D46011
      
      llvm-svn: 330725
      f85f5da3
    • Kostya Kortchinsky's avatar
      [sanitizer] More dead code removal · efe5afbc
      Kostya Kortchinsky authored
      Summary:
      The following functions are only used in tests: `SetEnv`,
      `SanitizerSetThreadName`, `SanitizerGetThreadName`. I don't think they are
      going to be used in the future, and I propose to get rid of them, and associated
      tests and include.
      
      Reviewers: alekseyshl, eugenis, vitalybuka
      
      Reviewed By: vitalybuka
      
      Subscribers: dvyukov, vitalybuka, kubamracek, delcypher, llvm-commits, #sanitizers
      
      Differential Revision: https://reviews.llvm.org/D45838
      
      llvm-svn: 330724
      efe5afbc
    • Andrea Di Biagio's avatar
      [llvm-mca] Refactor the Scheduler interface in preparation for PR36663. · 27c4b096
      Andrea Di Biagio authored
      Zero latency instructions are now scheduled the same way as other instructions.
      Before this patch, there was a specialzed code path for those instructions.
      
      All scheduler events are now generated from method `scheduleInstruction()` and
      from method `cycleEvent()`. This will make easier to implement a "execution
      stage", and let that stage publish all the scheduler events.
      
      No functional change intended.
      
      llvm-svn: 330723
      27c4b096
    • Joel E. Denny's avatar
      [Attr] Print enum attributes at correct position · c2575a37
      Joel E. Denny authored
      For example, given:
      
        void fn() {
          enum __attribute__((deprecated)) T *p;
        }
      
      -ast-print produced:
      
        void fn() {
          enum T __attribute__((deprecated(""))) *p;
        }
      
      -ast-print on that produced:
      
        void fn() {
          enum T *p __attribute__((deprecated("")));
        }
      
      The attribute is on enum T in the first case, but it's on p in the
      other cases.
      
      Details:
      
      Within enum declarations, enum attributes were always printed after
      the tag and any member list.  When no member list was present but the
      enum was a type specifier in a variable declaration, the attribute
      then applied to the variable not the enum, changing the semantics.
      
      This patch fixes that by always printing attributes between the enum's
      keyword and tag, as clang already does for structs, unions, and
      classes.
      
      Reviewed By: rsmith
      
      Differential Revision: https://reviews.llvm.org/D45456
      
      llvm-svn: 330722
      c2575a37
    • Sven van Haastregt's avatar
      [OpenCL] Fix diagnostic of thread_local · c4100833
      Sven van Haastregt authored
      Commit 08c258670c ("[OpenCL] Generic address space has been added in
      OpenCL v2.0.", 2014-11-26) did not mark the thread_local keyword as a
      storage class specifier, whereas it did mark _Thread_local as such.
      According to the C++14 spec s7.1.1, thread_local is a storage class
      specifier, so mark it as such.
      
      I will add a test for this in a follow-up commit that adds keyword
      restrictions to the OpenCL C++ language mode.
      
      llvm-svn: 330721
      c4100833
    • Simon Pilgrim's avatar
      [X86] Remove unnecessary FMA reg-mem InstRW scheduler overrides. · 16299273
      Simon Pilgrim authored
      llvm-svn: 330720
      16299273
    • Gabor Horvath's avatar
      [clang-tidy] Fix PR35468 · 27351661
      Gabor Horvath authored
      Differential Revision: https://reviews.llvm.org/D46003
      
      llvm-svn: 330719
      27351661
    • Ulrich Weigand's avatar
      [SystemZ] Use preferred 16-byte function alignment · 497c70ff
      Ulrich Weigand authored
      While not necessary for correctness, it is preferable for
      performance reasons on all architectures we currently support
      to align functions to 16-byte boundaries by default.
      
      llvm-svn: 330718
      497c70ff
    • Ilya Biryukov's avatar
      [CodeComplete] Fix completion at the end of keywords · b3510c42
      Ilya Biryukov authored
      Summary:
      Make completion behave consistently no matter if it is run at the
      start, in the middle or at the end of an identifier that happens to
      be a keyword or a macro name. Since completion is often ran on
      incomplete identifiers, they may turn into keywords by accident.
      
      For example, we should produce same results for all of these
      completion points:
      
          // ^ is completion point.
          ^class
          cla^ss
          class^
      
      Previously clang produced different results for the last case (as if
      the completion point was after a space: `class ^`).
      
      This change also updates some offsets in tests that (unintentionally?)
      relied on the old behavior.
      
      Reviewers: sammccall, bkramer, arphaman, aaron.ballman
      
      Reviewed By: sammccall
      
      Subscribers: cfe-commits
      
      Differential Revision: https://reviews.llvm.org/D45887
      
      llvm-svn: 330717
      b3510c42
    • Simon Pilgrim's avatar
      Fix Wdocumentation warnings. NFCI. · d6ceda84
      Simon Pilgrim authored
      llvm-svn: 330716
      d6ceda84
    • Simon Pilgrim's avatar
      [X86] Fix missing cfi from sitofp checks · 23d29250
      Simon Pilgrim authored
      llvm-svn: 330715
      23d29250
    • Simon Pilgrim's avatar
      [X86] Add vector element insertion/extraction scheduler classes · f7d2a93d
      Simon Pilgrim authored
      Split off pinsr/pextr and extractps instructions.
      
      (Mostly) fixes PR36887.
      
      Note: It might be worth adding a WriteFInsertLd class as well in the future.
      
      Differential Revision: https://reviews.llvm.org/D45929
      
      llvm-svn: 330714
      f7d2a93d
    • Simon Pilgrim's avatar
      2922c102
    • Rainer Orth's avatar
      The OpenBSD UBsan port introduced two typos that broke the Solaris sanitizer build. · 482cef6c
      Rainer Orth authored
      The following patch restores it, will shortly commit as obvious.
      
      Differential Revision: https://reviews.llvm.org/D46006
      
      llvm-svn: 330712
      482cef6c
    • Alexander Ivchenko's avatar
      [X86] Replace action Promote with Expand for operation ISD::SINT_TO_FP · 5717fbaf
      Alexander Ivchenko authored
      Summary:
      If attribute "use-soft-float"="true" is set then X86ISelLowering.cpp sets
      'Promote' action for ISD::SINT_TO_FP operation on type i32.
      
      But 'Promote' action is not proper in this case since lib function
      __floatsidf is available for casting from signed int to float type.
      Thus Expand action is more suitable here.
      
      The Expand action should be set for ISD::UINT_TO_FP for soft float as well.
      
      If function attribute "use-soft-float"="true" is set then infinite looping
      can happen in DAG combining, function visitSINT_TO_FP() replaces SINT_TO_FP
      node with UINT_TO_FP node and function combineUIntToFP() replace vice versa in cycle.
      The fix prevents it.
      
      Patch by vrybalov
      
      Differential Revision: https://reviews.llvm.org/D45572
      
      llvm-svn: 330711
      5717fbaf
    • Martin Storsjo's avatar
      [GCC] Don't keep a StringRef to a temporary std::string · 7054b49e
      Martin Storsjo authored
      This fixes failures in asan builds and possibly other buildbots
      as well, after SVN r330696.
      
      Prior to that revision, the std::string was stored in another
      variable, before assigning to a StringRef.
      
      llvm-svn: 330710
      7054b49e
    • Francis Visoiu Mistrih's avatar
      [CodeGen] Print user-friendly debug locations as MI comments · 8ed0f741
      Francis Visoiu Mistrih authored
      If available, print the file, line and column of the DebugLoc attached
      to the MachineInstr:
      
      MOV16mr $rbp, 1, $noreg, -112, $noreg, killed renamable $ax, debug-location !56 :: (store 2 into %ir.._value12); stepping.swift:10:17
      renamable $edx = MOVZX32rm16 $rbp, 1, $noreg, -112, $noreg, debug-location !62 :: (dereferenceable load 2 from %ir.._value13); stepping.swift:10:17
      
      Differential Revision: https://reviews.llvm.org/D45992
      
      llvm-svn: 330709
      8ed0f741
    • Pavel Labath's avatar
      [dotest] Make the set of tests independent of the test configuration · fdfeefd6
      Pavel Labath authored
      Summary:
      In the magic test duplicator, we were making the decision whether to
      create a test variant based on the compiler and the target platform.
      This meant that the set of known tests was different for each test
      configuration.
      
      This patch makes the set of generated test variants static and handles
      the skipping via runtime checks instead. This is more consistent with
      how we do other test-skipping decision (e.g. for libc++ tests), and
      makes it easier to expose the full set of tests to lit, which now does
      not need to know anything about what things can potentially cause tests
      to appear or disappear.
      
      Reviewers: JDevlieghere, aprantl
      
      Subscribers: eraman, lldb-commits
      
      Differential Revision: https://reviews.llvm.org/D45949
      
      llvm-svn: 330708
      fdfeefd6
    • Chandler Carruth's avatar
      [PM/LoopUnswitch] Fix a bug in the loop block set formation of the new · 43acdb35
      Chandler Carruth authored
      loop unswitch.
      
      This code incorrectly added the header to the loop block set early. As
      a consequence we would incorrectly conclude that a nested loop body had
      already been visited when the header of the outer loop was the preheader
      of the nested loop. In retrospect, adding the header eagerly doesn't
      really make sense. It seems nicer to let the cycle be formed naturally.
      This will catch crazy bugs in the CFG reconstruction where we can't
      correctly form the cycle earlier rather than later, and makes the rest
      of the logic just fall out.
      
      I've also added various asserts that make these issues *much* easier to
      debug.
      
      llvm-svn: 330707
      43acdb35
    • Petar Jovanovic's avatar
      Correct dwarf unwind information in function epilogue · e2bfcd63
      Petar Jovanovic authored
      This patch aims to provide correct dwarf unwind information in function
      epilogue for X86.
      It consists of two parts. The first part inserts CFI instructions that set
      appropriate cfa offset and cfa register in emitEpilogue() in
      X86FrameLowering. This part is X86 specific.
      
      The second part is platform independent and ensures that:
      
      * CFI instructions do not affect code generation (they are not counted as
        instructions when tail duplicating or tail merging)
      * Unwind information remains correct when a function is modified by
        different passes. This is done in a late pass by analyzing information
        about cfa offset and cfa register in BBs and inserting additional CFI
        directives where necessary.
      
      Added CFIInstrInserter pass:
      
      * analyzes each basic block to determine cfa offset and register are valid
        at its entry and exit
      * verifies that outgoing cfa offset and register of predecessor blocks match
        incoming values of their successors
      * inserts additional CFI directives at basic block beginning to correct the
        rule for calculating CFA
      
      Having CFI instructions in function epilogue can cause incorrect CFA
      calculation rule for some basic blocks. This can happen if, due to basic
      block reordering, or the existence of multiple epilogue blocks, some of the
      blocks have wrong cfa offset and register values set by the epilogue block
      above them.
      CFIInstrInserter is currently run only on X86, but can be used by any target
      that implements support for adding CFI instructions in epilogue.
      
      Patch by Violeta Vukobrat.
      
      Differential Revision: https://reviews.llvm.org/D42848
      
      llvm-svn: 330706
      e2bfcd63
    • Simon Dardis's avatar
      [mips] Correct the patterns for bswap · fce722e6
      Simon Dardis authored
      Guard the MIPS64 variant correctly for i64, mark the MIPS32 version as not
      in microMIPS and provide the microMIPS version.
      
      Additionally, remove a related stale XFAIL'd test as bswap has its own test
      case providing coverage.
      
      Reviewers: smaksimovic, abeserminji, atanasyan
      
      Differential Revision: https://reviews.llvm.org/D45816
      
      llvm-svn: 330705
      fce722e6
    • Aleksei Sidorin's avatar
      [ASTImporter] Allow testing of import sequences; fix import of typedefs for anonymous decls · 04fbffcc
      Aleksei Sidorin authored
      This patch introduces the ability to test an arbitrary sequence of imports
      between a given set of virtual source files. This should finally allow
      us to write simple tests and fix annoying issues inside ASTImporter
      that cause failures in CSA CTU. This is done by refactoring
      ASTImporterTest functions and introducing `testImportSequence` facility.
      As a side effect, `testImport` facility was generalized a bit more. It
      should now allow import of non-decl AST nodes; however, there is still no
      test using this ability.
      
      As a "test for test", there is also a fix for import anonymous TagDecls
      referred by typedef. Before this patch, the setting of typedef for anonymous
      structure was delayed; however, this approach misses the corner case if
      an enum constant is imported directly. In this patch, typedefs for
      anonymous declarations are imported right after the anonymous declaration
      is imported, without any delay.
      
      Thanks to Adam Balogh for suggestions included into this patch.
      
      Differential Revision: https://reviews.llvm.org/D44079
      
      llvm-svn: 330704
      04fbffcc
    • Andrea Di Biagio's avatar
      [llvm-mca][CommandGuide] Fix typo in example. · ef507cb4
      Andrea Di Biagio authored
      llvm-svn: 330703
      ef507cb4
    • George Rimar's avatar
      [ELF] - Never use std::sort. · de83cbf3
      George Rimar authored
      It turns out we should not use the std::sort anymore.
      r327219 added a new wrapper llvm::sort (D39245).
      When EXPENSIVE_CHECKS is defined, it shuffles the
      input container and that helps to find non-deterministic
      ordering.
      
      Patch changes code to use llvm::sort and std::stable_sort
      instead of std::sort
      
      Differential revision: https://reviews.llvm.org/D45969
      
      llvm-svn: 330702
      de83cbf3
    • George Rimar's avatar
      [ELF] - Refactor lazy symbol duplicated code. · 19f9b814
      George Rimar authored
      Our code for LazyObject and LazyArchive duplicates.
      
      This patch extracts the common part to remove
      the duplication.
      
      Differential revision: https://reviews.llvm.org/D45516
      
      llvm-svn: 330701
      19f9b814