1. Mar 21, 2019
    • David Green's avatar
      Fixup opt-remarks.ll gold plugin test. NFC · f0f01051
      David Green authored
      Now that rL356594 has added a TailCallElim pass to LTO, the call gets marked as
      tail.
      
      llvm-svn: 356669
      f0f01051
    • Florian Hahn's avatar
      [DAGCombiner] Use getTokenFactor in a few more cases. · 71033f29
      Florian Hahn authored
      SDNodes can only have 64k operands and for some inputs (e.g. large
      number of stores), we can reach this limit when creating TokenFactor
      nodes. This patch is a follow up to D56740 and updates a few more places
      that potentially can create TokenFactors with too many operands.
      
      Reviewers: efriedma, craig.topper, aemerson, RKSimon
      
      Reviewed By: RKSimon
      
      Differential Revision: https://reviews.llvm.org/D59156
      
      llvm-svn: 356668
      71033f29
    • Simon Pilgrim's avatar
      [DAGCombine] SimplifySelectCC - call FoldSetCC with the setcc result type · da4992bf
      Simon Pilgrim authored
      We were calling FoldSetCC with the compare operand type instead of the result type.
      
      Found by OSS-Fuzz #13838 (https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=13838)
      
      llvm-svn: 356667
      da4992bf
    • Peter Smith's avatar
      [ELF][ARM] Redesign of .ARM.exidx handling to use a SyntheticSection · d3511a21
      Peter Smith authored
      Instead of creating extra Synthetic .ARM.exidx sections to account for
      gaps in the table, create a single .ARM.exidx SyntheticSection that can
      derive the contents of the gaps from a sorted list of the executable
      InputSections. This has the benefit of moving the ARM specific code for
      SyntheticSections in SHF_LINK_ORDER processing and the table merging code
      into the ARM specific SyntheticSection. This also makes it easier to create
      EXIDX_CANTUNWIND table entries for executable InputSections that don't
      have an associated .ARM.exidx section.
      
      Fixes pr40277
      
      Differential Revision: https://reviews.llvm.org/D59216
      
      llvm-svn: 356666
      d3511a21
    • Sanjay Patel's avatar
      [CodeGenPrepare] limit formation of overflow intrinsics (PR41129) · d47eac59
      Sanjay Patel authored
      This is probably a bigger limitation than necessary, but since we don't have any evidence yet
      that this transform led to real-world perf improvements rather than regressions, I'm making a
      quick, blunt fix.
      
      In the motivating x86 example from:
      https://bugs.llvm.org/show_bug.cgi?id=41129
      ...and shown in the regression test, we want to avoid an extra instruction in the dominating
      block because that could be costly.
      
      The x86 LSR test diff is reversing the changes from D57789. There's no evidence that 1 version
      is any better than the other yet.
      
      Differential Revision: https://reviews.llvm.org/D59602
      
      llvm-svn: 356665
      d47eac59
    • Xing GUO's avatar
      [llvm-readobj] Format codes. NFC. · 3e9e5549
      Xing GUO authored
      llvm-svn: 356664
      3e9e5549
    • Erich Keane's avatar
      Permit redeclarations of a builtin to specify calling convention. · 505427cb
      Erich Keane authored
      After https://reviews.llvm.org/rL355317 we noticed that quite a decent
      amount of code redeclares builtins (memcpy in particular, I believe
      reduced from an MSVC header) with a calling convention specified.
      This gets particularly troublesome when the user specifies a new
      'default' calling convention on the command line.
      
      When looking to add a diagnostic for this case, it was noticed that we
      had 3 other diagnostics that differed only slightly.  This patch ALSO
      unifies those under a 'select'.  Unfortunately, the order of words in
      ONE of these diagnostics was reversed ("'thiscall' calling convention"
      vs "calling convention 'thiscall'"), so this patch also standardizes on
      the former.
      
      Differential Revision: https://reviews.llvm.org/D59560
      
      Change-Id: I79f99fe7c2301640755ffdd774b46eb44526bb22
      llvm-svn: 356663
      505427cb
    • Paul Hoad's avatar
      [clang-format] Add basic support for formatting C# files · cbb726d0
      Paul Hoad authored
      Summary:
      
      This revision adds basic support for formatting C# files with clang-format, I know the barrier to entry is high here  so I'm sending this revision in to test the water as to whether this might be something we'd consider landing.
      
      Tracking in Bugzilla as:
      https://bugs.llvm.org/show_bug.cgi?id=40850
      
      Justification:
      C# code just looks ugly in comparison to the C++ code in our source tree which is clang-formatted.
      
      I've struggled with Visual Studio reformatting to get a clean and consistent style, I want to format our C# code on saving like I do now for C++ and i want it to have the same style as defined in our .clang-format file, so it consistent as it can be with C++.  (Braces/Breaking/Spaces/Indent etc..)
      
      Using clang format without this patch leaves the code in a bad state, sometimes when the BreakStringLiterals is set, it  fails to compile.
      
      Mostly the C# is similar to Java, except instead of JavaAnnotations I try to reuse the TT_AttributeSquare.
      
      Almost the most valuable portion is to have a new Language in order to partition the configuration for C# within a common .clang-format file, with the auto detection on the .cs extension. But there are other C# specific styles that could be added later if this is accepted. in particular how  `{ set;get }` is formatted.
      
      Reviewers: djasper, klimek, krasimir, benhamilton, JonasToth
      
      Reviewed By: klimek
      
      Subscribers: llvm-commits, mgorny, jdoerfert, cfe-commits
      
      Tags: #clang, #clang-tools-extra
      
      Differential Revision: https://reviews.llvm.org/D58404
      
      llvm-svn: 356662
      cbb726d0
    • Simon Pilgrim's avatar
      [Thumb] Fix infinite loop in ABS expansion (PR41160) · 87d261bf
      Simon Pilgrim authored
      Don't expand ISD::ABS node if its legal.
      
      llvm-svn: 356661
      87d261bf
    • Tim Renouf's avatar
      [AMDGPU] Support for v3i32/v3f32 · 361b5b21
      Tim Renouf authored
      Added support for dwordx3 for most load/store types, but not DS, and not
      intrinsics yet.
      
      SI (gfx6) does not have dwordx3 instructions, so they are not enabled
      there.
      
      Some of this patch is from Matt Arsenault, also of AMD.
      
      Differential Revision: https://reviews.llvm.org/D58902
      
      Change-Id: I913ef54f1433a7149da8d72f4af54dbb13436bd9
      llvm-svn: 356659
      361b5b21
    • Simon Pilgrim's avatar
      Fix -Wmisleading-indentation gcc7 warning. NFCI. · 92cbcfc3
      Simon Pilgrim authored
      llvm-svn: 356658
      92cbcfc3
    • Oliver Stannard's avatar
      [AArch64] Allow -mattr=tpidr-el[1|2|3] · defdb107
      Oliver Stannard authored
      Added subtarget features for AArch64 to use TPIDR_EL[1|2|3] as the TLS base
      register, rather than the default TPIDR_EL0.
      
      Patch by Philip Derrin!
      
      Differential revision: https://reviews.llvm.org/D54685
      
      llvm-svn: 356657
      defdb107
    • Simon Pilgrim's avatar
      [SelectionDAG] Add scalarization of ABS node (PR41149) · 54ed6538
      Simon Pilgrim authored
      Patch by: @ikulagin (Ivan Kulagin)
      
      Differential Revision: https://reviews.llvm.org/D59577
      
      llvm-svn: 356656
      54ed6538
    • Pavel Labath's avatar
      Fix two more issues with r356652 · 045b8544
      Pavel Labath authored
      The first problem was a use-after-free in the tests (detected by asan
      bots). The temporary array created for the "create" call is guaranteed
      to live only until the end of the statement. The fix there is to store
      the test data in a local variable to ensure it has the right lifetime
      
      The second issue is broken BUILD_SHARED_LIBS build, which I fix by
      adding the appropriate BinaryFormat dependency to the Object unit tests.
      
      llvm-svn: 356655
      045b8544
    • Alex Bradbury's avatar
      [RISCV][NFC] Remove old CHECK lines from linker-relaxation.s test · 0a9541e9
      Alex Bradbury authored
      The RELOC: check lines are no longer used.
      
      llvm-svn: 356654
      0a9541e9
    • Pavel Labath's avatar
      Attempt to fix modules build for r356652 · 7da2de69
      Pavel Labath authored
      The commit added a new .def file. This adds it to the list of textual
      headers.
      
      llvm-svn: 356653
      7da2de69
    • Pavel Labath's avatar
      [Object] Add basic minidump support · 581d79a4
      Pavel Labath authored
      Summary:
      This patch adds basic support for reading minidump files. It contains
      the definitions of various important minidump data structures (header,
      stream directory), and of one minidump stream (SystemInfo). The ability
      to read other streams will be added in follow-up patches. However, all
      streams can be read even now as raw data, which means lldb's minidump
      support (where this code is taken from) can be immediately rebased on
      top of this patch as soon as it lands.
      
      As we don't have any support for generating minidump files (yet), this
      tests the code via unit tests with some small handcrafted binaries in
      the form of c char arrays.
      
      Reviewers: Bigcheese, jhenderson, zturner
      
      Subscribers: srhines, dschuff, mgorny, fedor.sergeev, lemo, clayborg, JDevlieghere, aprantl, lldb-commits, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D59291
      
      llvm-svn: 356652
      581d79a4
    • Fangrui Song's avatar
      [BasicAA] Use DenseMap::try_emplace after D59151. NFC · ebfb7852
      Fangrui Song authored
      llvm-svn: 356651
      ebfb7852
    • Zinovy Nis's avatar
      Reland r356547 after fixing the YAML module missing issue. · 72bb9a65
      Zinovy Nis authored
      [clang-tidy] Parallelize clang-tidy-diff.py
      
      This patch has 2 rationales:
      
      - large patches lead to long command lines and often cause max command line length restrictions imposed by OS;
      - clang-tidy runs on modified files are independent and can be done in parallel, the same as done for run-clang-tidy.
      
      Differential Revision: https://reviews.llvm.org/D5766
      
      llvm-svn: 356649
      72bb9a65
    • Mikael Holmen's avatar
      5b1754f9
    • Serge Guelton's avatar
      Use list comprehension instead of map/filter to prepare Python2/3 compat · 32cffcf1
      Serge Guelton authored
      Differential Revision: https://reviews.llvm.org/D59579
      
      llvm-svn: 356647
      32cffcf1
    • Craig Topper's avatar
      [ScalarizeMaskedMemIntrinsics] Reverse some if conditions to reduce... · 8de7bc0b
      Craig Topper authored
      [ScalarizeMaskedMemIntrinsics] Reverse some if conditions to reduce indentations to remove curly braces.
      
      Pre-commit for D59180
      
      llvm-svn: 356646
      8de7bc0b
    • Craig Topper's avatar
      [InstCombine] Add test case for PR41164. NFC · 72d888ba
      Craig Topper authored
      llvm-svn: 356645
      72d888ba
    • Alina Sbirlea's avatar
      [BasicAA] Reduce no of map seaches [NFCI]. · 4fdbd822
      Alina Sbirlea authored
      Summary:
      This is a refactoring patch.
      - Reduce the number of map searches by reusing the iterator.
      - Add asserts to check that the entry is in the cache, as this is something BasicAA relies on to avoid infinite recursion.
      
      Reviewers: chandlerc, aschwaighofer
      
      Subscribers: sanjoy, jlebar, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D59151
      
      llvm-svn: 356644
      4fdbd822
    • Jonas Devlieghere's avatar
      [Reproducers] Properly handle QEnvironment packets · a262531d
      Jonas Devlieghere authored
      On Linux, a QEnvironment packet is sent for every environment variable.
      This breaks replay when the number of environment variables is different
      then during capture. The solution is to always reply with OK.
      
      llvm-svn: 356643
      a262531d
    • Philip Reames's avatar
      [instcombine] Add some todos, and arrange code for readibility · 60212be6
      Philip Reames authored
      llvm-svn: 356642
      60212be6
    • George Burgess IV's avatar
      [MSSA] Delete move ctor; remove dynamic never-moved verification · ae84e9ab
      George Burgess IV authored
      Code archaeology in D59315 revealed that MSSA should never be moved.
      Rather than trying to check dynamically that this hasn't happened in the
      verify() functions of Walkers, it's likely best to just delete its move
      constructor.
      
      Since all these verify() functions did is check that MSSA hasn't moved,
      this allows us to remove these verify functions.
      
      I can readd the verification checks if someone's super concerned about
      us trying to `memcpy` MemorySSA or something somewhere, but I imagine we
      have other problems if we're trying anything like that...
      
      llvm-svn: 356641
      ae84e9ab
    • Eric Fiselier's avatar
      Add dylib-has-no-filesystem when filesystem is disabled · c9f4cbf7
      Eric Fiselier authored
      llvm-svn: 356640
      c9f4cbf7
    • Eric Fiselier's avatar
      Mark debug death tests as unsupported on Windows · e7e268d9
      Eric Fiselier authored
      llvm-svn: 356639
      e7e268d9
    • Jonas Devlieghere's avatar
      [Reproducers] Log inconsistencies during replay (NFC) · e3ea27b6
      Jonas Devlieghere authored
      Make debugging of the GDB remote packet aspect of reproducers easier by
      logging both requests and replies. This enables some sanity checking
      during replay.
      
      llvm-svn: 356638
      e3ea27b6
    • Eric Fiselier's avatar
      Remove type visibility specifiers from new chrono types. · 0e04ab7e
      Eric Fiselier authored
      _LIBCPP_TYPE_VIS is only really needed on types with a vtable.
      And on Windows it doesn't work with types that have only inline methods.
      
      This patch removes the unneeded attributes.
      
      llvm-svn: 356637
      0e04ab7e
    • George Burgess IV's avatar
      creduce-clang-crash.py: preprocess file + reduce commandline · eda3d11d
      George Burgess IV authored
      This CL causes our creduce-clang-crash.py util to:
      
      - try to preprocess the file before reducing
      - try to remove some command line arguments
      - now require a llvm bin directory, since the generated crash script
        doesn't have an absolute path for clang
      
      It also marks it as executable, since I forgot to do that in the last
      commit. :)
      
      Patch by Amy Huang!
      
      Differential Revision: https://reviews.llvm.org/D59440
      
      llvm-svn: 356636
      eda3d11d
    • Billy Robert O'Neal III's avatar
      [libcxx] [test] Revert r356632 add (void) casts to operator new calls, to... · 277cf30d
      Billy Robert O'Neal III authored
      [libcxx] [test] Revert r356632 add (void) casts to operator new calls, to suppress warnings generated by [[nodiscard]]."
      
      llvm-svn: 356635
      277cf30d
    • Artem Dergachev's avatar
      [CFG] [analyzer] pr41142: C++17: Skip transparent InitListExprs in constructors. · aa40315c
      Artem Dergachev authored
      When searching for construction contexts, i.e. figuring out which statements
      define the object that is constructed by each construct-expression, ignore
      transparent init-list expressions because they don't add anything to the
      context. This allows the Static Analyzer to model construction, destruction,
      materialization, lifetime extension correctly in more cases. Also fixes
      a crash caused by incorrectly evaluating initial values of variables
      initialized with such expressions.
      
      Differential Revision: https://reviews.llvm.org/D59573
      
      llvm-svn: 356634
      aa40315c
    • Eric Fiselier's avatar
      Allow disabling of filesystem library. · f1d87f8b
      Eric Fiselier authored
      Summary: Filesystem doesn't work on Windows, so we need a mechanism to turn it off for the time being.
      
      Reviewers: ldionne, serge-sans-paille, EricWF
      
      Reviewed By: EricWF
      
      Subscribers: mstorsjo, mgorny, christof, jdoerfert, libcxx-commits
      
      Differential Revision: https://reviews.llvm.org/D59619
      
      llvm-svn: 356633
      f1d87f8b
    • Billy Robert O'Neal III's avatar
      [libcxx] [test] Add (void) casts to operator new calls, to suppress warnings... · 49fc2655
      Billy Robert O'Neal III authored
      [libcxx] [test] Add (void) casts to operator new calls, to suppress warnings generated by [[nodiscard]].
      
      This allows these tests to pass when compiled by MSVC++.
      
      llvm-svn: 356632
      49fc2655
    • Craig Topper's avatar
      [X86] Add CMPXCHG8B feature flag. Set it for all CPUs except i386/i486... · 8d46403b
      Craig Topper authored
      [X86] Add CMPXCHG8B feature flag. Set it for all CPUs except i386/i486 including 'generic'. Disable use of CMPXCHG8B when this flag isn't set.
      
      CMPXCHG8B was introduced on i586/pentium generation.
      
      If its not enabled, limit the atomic width to 32 bits so the AtomicExpandPass will expand to lib calls. Unclear if we should be using a different limit for other configs. The default is 1024 and experimentation shows that using an i256 atomic will cause a crash in SelectionDAG.
      
      Differential Revision: https://reviews.llvm.org/D59576
      
      llvm-svn: 356631
      8d46403b
    • Douglas Yung's avatar
      Revert "Reland r356547 after fixing the tests for Linux." · 6452ba47
      Douglas Yung authored
      This reverts commit 538fb722 (r356565).
      
      This is still breaking a build bot:
      http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-ubuntu-fast/builds/45557
      
      llvm-svn: 356630
      6452ba47
    • Michael Trent's avatar
      Fix Mach-O bind and rebase validation errors in libObject · 02a2ce9a
      Michael Trent authored
      Summary:
      llvm-objdump (via libObject) validates DYLD_INFO rebase and bind
      entries against the basic structure found in the Mach-O file before
      evaluating the contents of those entries. Certain malformed Mach-Os can
      defeat the validation check and force llvm-objdump (libObject) to crash.
      
      The previous logic verified a rebase or bind started in a valid Mach-O
      section, but did not verify that the section wholely contained the
      fixup. It also generally allows rebases or binds to start immediately
      after a valid section even if that range is not itself part of a valid
      section. Finally, bind and rebase opcodes that indicate more than one
      fixup (apply N times...) are not completely validated: only the first
      and final fixups are checked.
      
      The previous logic also rejected certain binaries as false positives.
      Some bind and rebase opcodes can modify the state machine such that the
      next bind or rebase will fail. libObject will reject these opcodes as
      invalid in order to be helpful and print an error message associated
      with the instruction that caused the problem, even though the binary is
      not actually illegal until it consumes the invalid state in the state
      machine. In other words, libObject may reject a Mach-O binary that
      Apple's dynamic linker may consider legal. The original version of
      macho-rebase-add-addr-uleb-too-big is an example of such a binary.
      
      I have replaced the existing checkSegAndOffset and checkCountAndSkip
      functions with a single function, checkSegAndOffsets, which validates
      all of the fixups realized by a DYLD_INFO opcode. checkSegAndOffsets
      verifies that a Mach-O section fully contains each fixup. Every fixup
      realized by an opcode is validated, and some (but not all!)
      inconsistencies in the state machine are allowed until a fixup is
      realized. This means that libObject may fail on an opcode that realizes
      a fixup, not on the opcode that introduced the arithmetic error.
      
      Existing test cases have been modified to reflect the changes in error
      messages returned by libObject. What's more, the test case for 
      macho-rebase-add-addr-uleb-too-big has been modified so that it actually
      triggers the error condition; the new code in libObject considers the
      original test binary "legal".
      
      rdar://47797757
      
      Reviewers: lhames, pete, ab
      
      Reviewed By: pete
      
      Subscribers: rupprecht, jdoerfert, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D59574
      
      llvm-svn: 356629
      02a2ce9a
    • Jennifer Yu's avatar
      Remove extra white spaces · 506d74c8
      Jennifer Yu authored
      llvm-svn: 356628
      506d74c8