1. Aug 31, 2019
    • Nandor Licker's avatar
      [Clang Interpreter] Initial patch for the constexpr interpreter · d4c1002e
      Nandor Licker authored
      Summary:
      This patch introduces the skeleton of the constexpr interpreter,
      capable of evaluating a simple constexpr functions consisting of
      if statements. The interpreter is described in more detail in the
      RFC. Further patches will add more features.
      
      Reviewers: Bigcheese, jfb, rsmith
      
      Subscribers: bruno, uenoku, ldionne, Tyker, thegameg, tschuett, dexonsmith, mgorny, cfe-commits
      
      Tags: #clang
      
      Differential Revision: https://reviews.llvm.org/D64146
      
      llvm-svn: 370531
      d4c1002e
    • Sanjay Patel's avatar
      [x86] add tests for shift-logic-shift; NFC · cfe95970
      Sanjay Patel authored
      llvm-svn: 370529
      cfe95970
    • Sanjay Patel's avatar
      [AArch64] add tests for shift-logic-shift; NFC · 82847b50
      Sanjay Patel authored
      llvm-svn: 370528
      82847b50
    • Daniel Sanders's avatar
      Make add_new_check.py's insertion of registerCheck<> match the sort order · 0cdb04c3
      Daniel Sanders authored
      Summary:
      Following on from review comments in D65919 about the ordering
      of the registerCheck<> calls. Sort based on the check name which might
      be on the line after the registerCheck<>
      
      Reviewers: aaron.ballman
      
      Subscribers: cfe-commits, llvm-commits
      
      Tags: #clang
      
      Differential Revision: https://reviews.llvm.org/D66505
      
      llvm-svn: 370527
      0cdb04c3
    • Jonas Devlieghere's avatar
      [test] Make sure PROMPT is a string · c847cf31
      Jonas Devlieghere authored
      Currently tests using expect_prompt are failing on the Python 3 bot with
      an error saying "argument must be str, not bytes". I don't have a Python
      3 build handy, but I suspect this might fix that.
      
      llvm-svn: 370526
      c847cf31
    • Reid Kleckner's avatar
      [Windows] Disable TrapUnreachable for Win64, add SEH_NoReturn · 0bb16306
      Reid Kleckner authored
      Users have complained llvm.trap produce two ud2 instructions on Win64,
      one for the trap, and one for unreachable. This change fixes that.
      
      TrapUnreachable was added and enabled for Win64 in r206684 (April 2014)
      to avoid poorly understood issues with the Windows unwinder.
      
      There seem to be two major things in play:
      - the unwinder
      - C++ EH, _CxxFrameHandler3 & co
      
      The unwinder disassembles forward from the return address to scan for
      epilogues. Inserting a ud2 had the effect of stopping the unwinder, and
      ensuring that it ran the EH personality function for the current frame.
      However, it's not clear what the unwinder does when the return address
      happens to be the last address of one function and the first address of
      the next function.
      
      The Visual C++ EH personality, _CxxFrameHandler3, needs to figure out
      what the current EH state number is. It does this by consulting the
      ip2state table, which maps from PC to state number. This seems to go
      wrong when the return address is the last PC of the function or catch
      funclet.
      
      I'm not sure precisely which system is involved here, but in order to
      address these real or hypothetical problems, I believe it is enough to
      insert int3 after a call site if it would otherwise be the last
      instruction in a function or funclet.  I was able to reproduce some
      similar problems locally by arranging for a noreturn call to appear at
      the end of a catch block immediately before an unrelated function, and I
      confirmed that the problems go away when an extra trailing int3
      instruction is added.
      
      MSVC inserts int3 after every noreturn function call, but I believe it's
      only necessary to do it if the call would be the last instruction. This
      change inserts a pseudo instruction that expands to int3 if it is in the
      last basic block of a function or funclet. I did what I could to run the
      Microsoft compiler EH tests, and the ones I was able to run showed no
      behavior difference before or after this change.
      
      Differential Revision: https://reviews.llvm.org/D66980
      
      llvm-svn: 370525
      0bb16306
    • Puyan Lotfi's avatar
      0227208b
    • Sanjay Patel's avatar
      [Thumb2] tighten CHECK lines in test; NFC · a39ef6de
      Sanjay Patel authored
      The sequence between the function call and the asm start
      may change without affecting what this test is looking for,
      but we should have a better idea about what that sequence
      looks like.
      
      llvm-svn: 370518
      a39ef6de
    • Puyan Lotfi's avatar
      [IFS][NFC] llvm-ifs: Fixing build bot error due to commit conflicts. · 7e9dd09d
      Puyan Lotfi authored
      r370510 and r370504
      
      Again only on gcc.
      
      llvm-svn: 370517
      7e9dd09d
    • Nico Weber's avatar
      gn build: Merge r370512 · b83b4e94
      Nico Weber authored
      llvm-svn: 370516
      b83b4e94
    • Craig Topper's avatar
      [X86] Fix mul test cases in avx512-broadcast-unfold.ll to not get... · 4b61b647
      Craig Topper authored
      [X86] Fix mul test cases in avx512-broadcast-unfold.ll to not get canonicalized to fadd. Remove the fsub test cases which were also testing fadd.
      
      Not sure how to prevent an fsub by constant getting turned into an fadd by negative constant.
      
      llvm-svn: 370515
      4b61b647
    • Daniel Sanders's avatar
      [clang-tidy] Add llvm-prefer-register-over-unsigned to clang-tidy · 5b4f6404
      Daniel Sanders authored
      Summary:
      This clang-tidy check is looking for unsigned integer variables whose initializer
      starts with an implicit cast from llvm::Register and changes the type of the
      variable to llvm::Register (dropping the llvm:: where possible).
      
      Reviewers: arsenm, bogner
      
      Subscribers: jholewinski, MatzeB, qcolombet, dschuff, jyknight, dylanmckay, sdardis, nemanjai, jvesely, wdng, nhaehnle, mgorny, sbc100, jgravelle-google, kristof.beyls, hiraditya, aheejin, kbarton, fedor.sergeev, javed.absar, asb, rbar, johnrusso, simoncook, apazos, sabuasal, niosHD, jrtc27, MaskRay, zzheng, edward-jones, atanasyan, rogfer01, MartinMosbeck, brucehoult, the_o, tpr, PkmX, jocewei, jsji, Petar.Avramovic, asbirlea, Jim, s.egerton, cfe-commits, llvm-commits
      
      Tags: #clang, #llvm
      
      Differential Revision: https://reviews.llvm.org/D65919
      
      llvm-svn: 370512
      5b4f6404
    • Puyan Lotfi's avatar
      [IFS][NFC] llvm-ifs: Fixing build errors for bots using GCC. · 979e7cda
      Puyan Lotfi authored
      gcc produces the error:
      
      error: specialization of
      ‘template<class T, class Enable> struct llvm::yaml::ScalarTraits’ in
      different namespace
      
      For all specializations outside of llvm::yaml. So I added llvm::yaml to these
      specializations to fix the errors on the bots building with gcc (/usr/bin/c++).
      
      llvm-svn: 370510
      979e7cda
    • Sam Clegg's avatar
      [lld][WebAssembly] Fix spurious signature mismatch warnings · fecfc592
      Sam Clegg authored
      Summary:
      This a follow up on: https://reviews.llvm.org/D62153
      
      Handle the case where there are multiple object files that contain
      undefined references to the same function.  We only generate a function
      variant if the existing symbol is directly called.
      
      See: https://github.com/emscripten-core/emscripten/issues/8995
      
      Subscribers: dschuff, jgravelle-google, aheejin, sunfish, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D67015
      
      llvm-svn: 370509
      fecfc592
    • James Molloy's avatar
      [DFAPacketizer] Allow namespacing of automata per-itinerary · 6ccd6732
      James Molloy authored
      The Hexagon itineraries are cunningly crafted such that functional units between
      itineraries do not clash. Because all itineraries are bundled into the same DFA,
      a functional unit index clash would cause an incorrect DFA to be generated.
      
      A workaround for this is to ensure all itineraries declare the universe of all
      possible functional units, but this isn't ideal for three reasons:
        1) We only have a limited number of FUs we can encode in the packetizer, and
           using the universe causes us to hit the limit without care.
        2) Silent codegen faults are bad, and careful triage of the FU list shouldn't
           be required.
        3) Smooshing all itineraries into the same automaton allows combinations of
           instruction classes that cannot exist, which bloats the table.
      
      A simple solution is to allow "namespacing" packetizers.
      
      Differential Revision: https://reviews.llvm.org/D66940
      
      llvm-svn: 370508
      6ccd6732
    • Craig Topper's avatar
      [X86] Regenerate the test cases added in r370506. · a707ced1
      Craig Topper authored
      Something weird happened with the v2i64/v2f64 test cases which
      don't use broadcast. So they should already be hoisted, but
      weren't in the version I submitted in r370506. This fixes that.
      Not sure if something changed or I screwed up.
      
      llvm-svn: 370507
      a707ced1
    • Craig Topper's avatar
      [X86] Add test caes for opportunities for machine LICM to unfold broadcasted constant pool loads. · 23969192
      Craig Topper authored
      MachineLICM is able to unfold loads to move an invariant load out
      a loop, but X86 infrastructure currently lacks the ability to do
      this when avx512 embedded broadcasting is used.
      
      This test adds examples for the basic float point operations,
      add, mul, and, or, and xor.
      
      llvm-svn: 370506
      23969192
    • Jinsong Ji's avatar
      [PowerPC][NFC] Avoid checking non-relevant .cfi instructions · fb4b86af
      Jinsong Ji authored
      Summary:
      This is brought up in
      https://reviews.llvm.org/D64662?id=209923#inline-599490
      
      CFI information are non-relevant to quite some testcases,
      we should get rid of checking them when its unecessary.
      
      This patch avoid generating cfi info in testcases that are not
      testing prolog/epilog or exception handling.
      
      Reviewers: kbarton, hfinkel, nemanjai, #powerpc
      
      Reviewed By: hfinkel
      
      Subscribers: MaskRay, shchenz, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D67016
      
      llvm-svn: 370505
      fb4b86af
    • Michael Liao's avatar
      Fix compilation warnings. NFC. · 0e0f3029
      Michael Liao authored
      llvm-svn: 370504
      0e0f3029
    • Raphael Isemann's avatar
      [lldb][NFC] More tests for invalid register command invocations · 80840c1b
      Raphael Isemann authored
      llvm-svn: 370503
      80840c1b
    • Eric Fiselier's avatar
      Make `vector` unconditionally move elements when exceptions are disabled. · 2dd37a31
      Eric Fiselier authored
      Summary:
      `std::vector<T>` is free choose between using copy or move operations when it needs to resize. The standard only candidates that the correct exception safety guarantees are provided. When exceptions are disabled these guarantees are trivially satisfied. Meaning vector is free to optimize it's implementation by moving instead of copying.
      
      This patch makes `std::vector` unconditionally move elements when exceptions are disabled.
      
      This optimization is conforming according to the current standard wording.
      
      There are concerns that moving in `-fno-noexceptions`mode will be a surprise to users. For example, a user may be surprised to find their code is slower with exceptions enabled than it is disabled. I'm sympathetic to this surprised, but I don't think it should block this optimization.
      
      
      Reviewers: mclow.lists, ldionne, rsmith
      
      Reviewed By: ldionne
      
      Subscribers: zoecarver, christof, dexonsmith, libcxx-commits
      
      Tags: #libc
      
      Differential Revision: https://reviews.llvm.org/D62228
      
      llvm-svn: 370502
      2dd37a31
    • Nico Weber's avatar
      gn build: Merge r370500 · 7b832322
      Nico Weber authored
      llvm-svn: 370501
      7b832322
    • James Molloy's avatar
      [MachinePipeliner] Separate schedule emission, NFC · 790a779f
      James Molloy authored
      This is the first stage in refactoring the pipeliner and making it more
      accessible for backends to override and control. This separates the logic and
      state required to *emit* a scheudule from the logic that *computes* and
      validates a schedule.
      
      This will enable (a) new schedule emitters and (b) new modulo scheduling
      implementations to coexist.
      
      NFC.
      
      Differential Revision: https://reviews.llvm.org/D67006
      
      llvm-svn: 370500
      790a779f
    • Puyan Lotfi's avatar
      [llvm-ifs][IFS] llvm Interface Stubs merging + object file generation tool. · d719c506
      Puyan Lotfi authored
      This tool merges interface stub files to produce a merged interface stub file
      or a stub library. Currently it for stub library generation it can produce an
      ELF .so stub file, or a TBD file (experimental). It will be used by the clang
      -emit-interface-stubs compilation pipeline to merge and assemble the per-CU
      stub files into a stub library.
      
      The new IFS format is as follows:
      
      --- !experimental-ifs-v1
      IfsVersion:      1.0
      Triple:          <llvm triple>
      ObjectFileFormat: <ELF | TBD>
      Symbols:
        _ZSymbolName: { Type: <type>, etc... }
      ...
      
      Differential Revision: https://reviews.llvm.org/D66405
      
      llvm-svn: 370499
      d719c506
    • Simon Pilgrim's avatar
      [DAGCombine] ReduceLoadWidth - remove duplicate SDLoc. NFCI. · 3be7081a
      Simon Pilgrim authored
      SDLoc(N0) and SDLoc(cast<LoadSDNode>(N0)) should be equivalent.
      
      llvm-svn: 370498
      3be7081a
    • Simon Pilgrim's avatar
      [TargetLowering] SimplifyDemandedBits ADD/SUB/MUL - correctly inherit... · 2d1e0899
      Simon Pilgrim authored
      [TargetLowering] SimplifyDemandedBits ADD/SUB/MUL - correctly inherit SDNodeFlags from the original node.
      
      Just disable NSW/NUW flags. This matches what we're already doing for the other situations for these nodes, it was just missed for the demanded constant case.
      
      Noticed by inspection - confirmed in offline discussion with @spatel. I've checked we have test coverage in the x86 extract-bits.ll and extract-lowbits.ll tests
      
      llvm-svn: 370497
      2d1e0899
    • Matt Arsenault's avatar
      GlobalISel: Fix missing pass dependency · 466ec2d5
      Matt Arsenault authored
      llvm-svn: 370496
      466ec2d5
    • Craig Topper's avatar
      [X86] Pass v32i16/v64i8 in zmm registers on KNL target. · 18e8d02e
      Craig Topper authored
      gcc and icc pass these types in zmm registers in zmm registers.
      
      This patch implements a quick hack to override the register
      type before calling convention handling to one that is legal.
      Longer term we might want to do something similar to 256-bit
      integer registers on AVX1 where we just split all the operations.
      
      Fixes PR42957
      
      Differential Revision: https://reviews.llvm.org/D66708
      
      llvm-svn: 370495
      18e8d02e
    • Craig Topper's avatar
      [ValueTypes] Add v16f16 and v32f16 to EVT::getEVTString and Tablegen's getEnumName · 30ddd2ab
      Craig Topper authored
      Missed these when I hadded the enum entries
      
      llvm-svn: 370494
      30ddd2ab
    • Alex Lorenz's avatar
      [clang-scan-deps] NFC, remove outdated implementation comment · c4130cf1
      Alex Lorenz authored
      There's no need to purge symlinked entries in the FileManager,
      as the new FileEntryRef API allows us to compute dependencies more
      accurately when the FileManager is reused.
      
      llvm-svn: 370493
      c4130cf1
    • Nico Weber's avatar
      gn build: Merge r370490 · 9976a5bc
      Nico Weber authored
      llvm-svn: 370492
      9976a5bc
    • Martin Storsjo's avatar
      8c189e50
    • Evgeniy Stepanov's avatar
      MemTag: unchecked load/store optimization. · 04647f5e
      Evgeniy Stepanov authored
      Summary:
      MTE allows memory access to bypass tag check iff the address argument
      is [SP, #imm]. This change takes advantage of this to demote uses of
      tagged addresses to regular FrameIndex operands, reducing register
      pressure in large functions.
      
      MO_TAGGED target flag is used to signal that the FrameIndex operand
      refers to memory that might be tagged, and needs to be handled with
      care. Such operand must be lowered to [SP, #imm] directly, without a
      scratch register.
      
      The transformation pass attempts to predict when the offset will be
      out of range and disable the optimization.
      AArch64RegisterInfo::eliminateFrameIndex has an escape hatch in case
      this prediction has been wrong, but it is quite inefficient and should
      be avoided.
      
      Reviewers: pcc, vitalybuka, ostannard
      
      Subscribers: mgorny, javed.absar, kristof.beyls, hiraditya, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D66457
      
      llvm-svn: 370490
      04647f5e
    • Simon Pilgrim's avatar
      ab8cb1a3
    • Duncan P. N. Exon Smith's avatar
      FileManager: Remove ShouldCloseOpenFile argument from getBufferForFile, NFC · 122705b9
      Duncan P. N. Exon Smith authored
      Remove this dead code.  We always close it.
      
      llvm-svn: 370488
      122705b9
    • Bob Haarman's avatar
      [lld-link] implement -start-lib and -end-lib · fd7569c8
      Bob Haarman authored
      Summary:
      This implements -start-lib and -end-lib flags for lld-link, analogous
      to the similarly named options in ld.lld. Object files after
      -start-lib are included in the link only when needed to resolve
      undefined symbols. The -end-lib flag goes back to the normal behavior
      of always including object files in the link. This mimics the
      semantics of static libraries, but without needing to actually create
      the archive file.
      
      Reviewers: ruiu, smeenai, MaskRay
      
      Reviewed By: ruiu, MaskRay
      
      Subscribers: akhuang, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D66848
      
      llvm-svn: 370487
      fd7569c8
    • Whitney Tsang's avatar
      [INSTRUCTIONS] Add support of const for getLoadStorePointerOperand() and · b8a35649
      Whitney Tsang authored
      getLoadStorePointerOperand().
      Reviewer: hsaito, sebpop, reames, hfinkel, mkuper, bogner, haicheng,
      arsenm, lattner, chandlerc, grosser, rengolin
      Reviewed By: reames
      Subscribers: wdng, llvm-commits, bmahjour
      Tag: LLVM
      Differential Revision: https://reviews.llvm.org/D66595
      
      llvm-svn: 370486
      b8a35649
    • Johannes Doerfert's avatar
      [Attributor] Fix: do not pretend to preserve the CFG · 659a8707
      Johannes Doerfert authored
      llvm-svn: 370485
      659a8707
    • Craig Topper's avatar
      [X86] Merge X86InstrInfo::loadRegFromAddr/storeRegToAddr into their only call site. · 66f03ba1
      Craig Topper authored
      I'm looking at unfolding broadcast loads on AVX512 which will
      require refactoring this code to select broadcast opcodes instead
      of regular load/stores in some cases. Merging them to avoid
      further complicating their interfaces.
      
      llvm-svn: 370484
      66f03ba1
  2. Aug 30, 2019