1. May 17, 2018
    • whitequark's avatar
      [OR1K] Add a dedicated PC register to register state. · 3f948cd7
      whitequark authored
      Before this commit, R9, the link register, was used as PC register.
      However, a stack frame may have R9 not set to PC on entry, either
      because it uses a custom calling convention, or, more likely,
      because this is a signal or exception stack frame. Using R9 as
      PC register made it impossible to unwind such frames.
      
      All other architectures similarly use a dedicated PC register.
      
      llvm-svn: 332512
      3f948cd7
    • Greg Clayton's avatar
    • Simon Pilgrim's avatar
      [X86] Fix typo in instregex for CVTSI642SDrr · d5d77dcb
      Simon Pilgrim authored
      llvm-svn: 332510
      d5d77dcb
    • Volodymyr Sapsai's avatar
      [Sema] Fix assertion when constructor is disabled with partially specialized template. · 9b973483
      Volodymyr Sapsai authored
      The added test case was triggering assertion
      
      > Assertion failed: (!SpecializedTemplate.is<SpecializedPartialSpecialization*>() && "Already set to a class template partial specialization!"), function setInstantiationOf, file clang/include/clang/AST/DeclTemplate.h, line 1825.
      
      It was happening with ClassTemplateSpecializationDecl
      `enable_if_not_same<int, int>`. Because this template is specialized for
      equal types not to have a definition, it wasn't instantiated and its
      specialization kind remained TSK_Undeclared. And because it was implicit
      instantiation, we didn't mark the decl as invalid. So when we try to
      find the best matching partial specialization the second time, we hit
      the assertion as partial specialization is already set.
      
      Fix by reusing stored partial specialization when available, instead of
      looking for the best match every time.
      
      rdar://problem/39524996
      
      Reviewers: rsmith, arphaman
      
      Reviewed By: rsmith
      
      Subscribers: cfe-commits
      
      Differential Revision: https://reviews.llvm.org/D46909
      
      llvm-svn: 332509
      9b973483
    • Greg Clayton's avatar
      Fix llvm::sys::path::remove_dots() to return "." instead of an empty path. · b24957e2
      Greg Clayton authored
      Differential Revision: https://reviews.llvm.org/D46887
      
      llvm-svn: 332508
      b24957e2
    • Max Moroz's avatar
      [libFuzzer] add a symbolic execution puzzle (difficult for today's libFuzzer). · d6339609
      Max Moroz authored
      Summary:
      This can be solved just in seconds with KLEE. Current libFuzzer
      is able to satistfy 101 constraints out of 410 constraints presented during
      the first hour of running with -use_value_profile=1 and -max_len=20.
      During the next 3 hours, libFuzzer is able to generate ~50 NEW inputs,
      bot none of those solve any new constraint.
      During the next 20 hours, it didn't find any NEW inputs.
      
      This test might be interesting for experimenting with the data flow tracing
      approach started in https://reviews.llvm.org/D46666.
      
      For the solution with KLEE and other information, see
      https://github.com/Dor1s/codegate2017-quals-angrybird
      
      Reviewers: kcc
      
      Reviewed By: kcc
      
      Subscribers: delcypher, llvm-commits, #sanitizers
      
      Differential Revision: https://reviews.llvm.org/D46924
      
      llvm-svn: 332507
      d6339609
    • Roman Lebedev's avatar
      [Timers] TimerGroup: add constructor from StringMap<TimeRecord> · e592104c
      Roman Lebedev authored
      Summary:
      This is needed for the continuation of D46504,
      to be able to store the timings.
      
      Reviewers: george.karpenkov, NoQ, alexfh, sbenza
      
      Reviewed By: alexfh
      
      Subscribers: llvm-commits, cfe-commits
      
      Differential Revision: https://reviews.llvm.org/D46939
      
      llvm-svn: 332506
      e592104c
    • Roman Lebedev's avatar
      [Timers] TimerGroup: make printJSONValues() method public · d9ade38d
      Roman Lebedev authored
      Summary:
      This is needed for the continuation of D46504,
      to be able to store the timings.
      
      Reviewers: george.karpenkov, NoQ, alexfh, sbenza
      
      Reviewed By: alexfh
      
      Subscribers: llvm-commits, cfe-commits
      
      Differential Revision: https://reviews.llvm.org/D46938
      
      llvm-svn: 332505
      d9ade38d
    • Roman Lebedev's avatar
      [Timers] TimerGroup::printJSONValue(): print doubles with no precision loss · ddfefc35
      Roman Lebedev authored
      Summary:
      Although this is not stricly required, i would very much prefer
      not to have known random precision losses along the way.
      
      Reviewers: george.karpenkov, NoQ, alexfh, sbenza
      
      Reviewed By: george.karpenkov
      
      Subscribers: llvm-commits, cfe-commits
      
      Differential Revision: https://reviews.llvm.org/D46937
      
      llvm-svn: 332504
      ddfefc35
    • Roman Lebedev's avatar
      [Timers] TimerGroup::printJSONValues(): print mem timer with .mem suffix · c39ad98d
      Roman Lebedev authored
      Summary: We have just used `.sys` suffix for the previous timer, this is clearly a typo
      
      Reviewers: george.karpenkov, NoQ, alexfh, sbenza
      
      Reviewed By: alexfh
      
      Subscribers: llvm-commits, cfe-commits
      
      Differential Revision: https://reviews.llvm.org/D46936
      
      llvm-svn: 332503
      c39ad98d
    • Kostya Kortchinsky's avatar
      [scudo] Quarantine optimization · e5c9e9f0
      Kostya Kortchinsky authored
      Summary:
      It turns out that the previous code construct was not optimizing the allocation
      and deallocation of batches. The class id was read as a class member (even
      though a precomputed one) and nothing else was optimized. By changing the
      construct this way, the compiler actually optimizes most of the allocation and
      deallocation away to only work with a single class id, which not only saves some
      CPU but also some code footprint.
      
      Reviewers: alekseyshl, dvyukov
      
      Reviewed By: dvyukov
      
      Subscribers: dvyukov, delcypher, llvm-commits, #sanitizers
      
      Differential Revision: https://reviews.llvm.org/D46961
      
      llvm-svn: 332502
      e5c9e9f0
    • Sanjay Patel's avatar
      [x86] preserve test intent by removing undef · 332bbb0f
      Sanjay Patel authored
      We need to clean up the DAG floating-point undef logic.
      This process is similar to how we handled integer undef
      logic in D43141. 
      
      And as we did there, I'm trying to reduce the patch by 
      changing tests that would probably become meaningless
      once we make those fixes.
      
      llvm-svn: 332501
      332bbb0f
    • Sanjay Patel's avatar
      [x86] preserve test intent by removing undef · 502d1155
      Sanjay Patel authored
      We need to clean up the DAG floating-point undef logic.
      This process is similar to how we handled integer undef
      logic in D43141. 
      
      And as we did there, I'm trying to reduce the patch by 
      changing tests that would probably become meaningless
      once we make those fixes.
      
      llvm-svn: 332500
      502d1155
    • Sanjay Patel's avatar
      [x86] preserve test intent by removing undef · a7874a52
      Sanjay Patel authored
      We need to clean up the DAG floating-point undef logic.
      This process is similar to how we handled integer undef
      logic in D43141. 
      
      And as we did there, I'm trying to reduce the patch by 
      changing tests that would probably become meaningless
      once we make those fixes.
      
      llvm-svn: 332499
      a7874a52
    • Craig Topper's avatar
      [X86][AVX512DQ] Use packed instructions for scalar FP<->i64 conversions on 32-bit targets · 67aa726f
      Craig Topper authored
      As i64 types are not legal on 32-bit targets, insert these into a suitable zero vector and use the packed vXi64<->FP conversion instructions instead.
      
      Fixes PR3163.
      
      Differential Revision: https://reviews.llvm.org/D43441
      
      llvm-svn: 332498
      67aa726f
    • Vedant Kumar's avatar
      [Debugify] Tighten up the test for -debugify-each, NFC · 5c6b3fb8
      Vedant Kumar authored
      In post-commit review for r332416, Paul Robinson pointed out that the
      test for -debugify-each is not checking what it needs to.
      
      This commit tightens up the test.
      
      llvm-svn: 332497
      5c6b3fb8
    • JF Bastien's avatar
      Signal handling should be signal-safe · aa1333a9
      JF Bastien authored
      Summary:
      Before this patch, signal handling wasn't signal safe. This leads to real-world
      crashes. It used ManagedStatic inside of signals, this can allocate and can lead
      to unexpected state when a signal occurs during llvm_shutdown (because
      llvm_shutdown destroys the ManagedStatic). It also used cl::opt without custom
      backing storage. Some de-allocation was performed as well. Acquiring a lock in a
      signal handler is also a great way to deadlock.
      
      We can't just disable signals on llvm_shutdown because the signals might do
      useful work during that shutdown. We also can't just disable llvm_shutdown for
      programs (instead of library uses of clang) because we'd have to then mark the
      pointers as not leaked and make sure all the ManagedStatic uses are OK to leak
      and remain so.
      
      Move all of the code to lock-free datastructures instead, and avoid having any
      of them in an inconsistent state. I'm not trying to be fancy, I'm not using any
      explicit memory order because this code isn't hot. The only purpose of the
      atomics is to guarantee that a signal firing on the same or a different thread
      doesn't see an inconsistent state and crash. In some cases we might miss some
      state (for example, we might fail to delete a temporary file), but that's fine.
      
      Note that I haven't touched any of the backtrace support despite it not
      technically being totally signal-safe. When that code is called we know
      something bad is up and we don't expect to continue execution, so calling
      something that e.g. sets errno is the least of our problems.
      
      A similar patch should be applied to lib/Support/Windows/Signals.inc, but that
      can be done separately.
      
      Fix r332428 which I reverted in r332429. I originally used double-wide CAS
      because I was lazy, but some platforms use a runtime function for that which
      thankfully failed to link (it would have been bad for signal handlers
      otherwise). I use a separate flag to guard the data instead.
      
      <rdar://problem/28010281>
      
      Reviewers: dexonsmith
      
      Subscribers: steven_wu, llvm-commits
      llvm-svn: 332496
      aa1333a9
    • Jonas Hahnfeld's avatar
      [libomptarget-nvptx-bc] Pass found CUDA installations · 9228f971
      Jonas Hahnfeld authored
      We already know where the CUDA SDK is, so there is no point in
      letting Clang search for it again and possibly finding no or
      a different installation.
      
      --cuda-path is supported since the beginning of CUDA support in
      Clang, so making this required doesn't impose additional restrictions.
      
      Differential Revision: https://reviews.llvm.org/D46930
      
      llvm-svn: 332495
      9228f971
    • Jonas Hahnfeld's avatar
      [libomptarget-nvptx] Test bitcode compiler flags and enable by default · 37bbe1a6
      Jonas Hahnfeld authored
      Move all logic related to selecting the bitcode compiler and linker
      into a new file and dynamically test required compiler flags. This
      also adds -fcuda-rdc for Clang trunk as previously attempted in D44992
      which fixes the build.
      
      As a result this change also enables building the library by default
      if all prerequisites are met.
      
      Differential Revision: https://reviews.llvm.org/D46901
      
      llvm-svn: 332494
      37bbe1a6
    • Matt Davis's avatar
      [llvm-mca] Move the RegisterFile class into its own translation unit. NFC · b7972f88
      Matt Davis authored
      Summary: This change will help us turn the DispatchUnit into its own stage.
      
      Reviewers: andreadb, RKSimon, courbet
      
      Reviewed By: andreadb, courbet
      
      Subscribers: mgorny, tschuett, gbedwell, llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D46916
      
      llvm-svn: 332493
      b7972f88
    • Erich Keane's avatar
      Add lit tests forgotten for R332470 · a3c0c9a2
      Erich Keane authored
      I forgot to svn-add the lit tests for R332470.  
      Added here!
      
      llvm-svn: 332492
      a3c0c9a2
    • Bruno Cardoso Lopes's avatar
      [Modules] Do not diagnose missing import in recovery mode if there isn't a decl to lookup · c39e85d1
      Bruno Cardoso Lopes authored
      Clang often tries to create implicit module import for error recovery,
      which does a great job helping out with diagnostics. However, sometimes
      clang does not have enough information given that it's using an invalid
      context to move on. Be more strict in those cases to avoid crashes.
      
      We hit crash on invalids because of this but unfortunately there are no
      testcases and I couldn't manage to create one. The crashtrace however
      indicates pretty clear why it's happening.
      
      rdar://problem/39313933
      
      llvm-svn: 332491
      c39e85d1
    • Nirav Dave's avatar
      [DAG] Prune cycle check in store merge. · 11fd14c1
      Nirav Dave authored
      As part of merging stores we check that fusing the nodes does not
      cause a cycle due to one candidate store being indirectly dependent on
      another store (this may happen via chained memory copies). This is
      done by searching if a store is a predecessor to another store's
      value.
      
      Prune the search at the candidate search's root node which is a
      predecessor to all candidate stores. This reduces the
      size of the subgraph searched in large basic blocks.
      
      Reviewers: jyknight
      
      Subscribers: llvm-commits, hiraditya
      
      Differential Revision: https://reviews.llvm.org/D46955
      
      llvm-svn: 332490
      11fd14c1
    • Nirav Dave's avatar
      [DAG] Defer merge store cycle checking to just before merge. NFCI. · d9d86cb7
      Nirav Dave authored
      llvm-svn: 332489
      d9d86cb7
    • Michael Kruse's avatar
      [DeLICM] Avoid assertion on out-of-quota. · d6c2ca8d
      Michael Kruse authored
      An assertion was not prepared to be passed a nullptr because the
      out-of-quota limit was exceeded.  Bail-out before the assertion
      since the assertion does not apply on out-of-quote.
      
      This fixes llvm.org/PR37477.
      
      llvm-svn: 332488
      d6c2ca8d
    • Nico Weber's avatar
      Give shared modules in unittests the platform-native extension, make PipSqueak a MODULE · 12389819
      Nico Weber authored
      As far as I can tell from revision history, there's no good reason to call
      these files .so instead of .dll in Windows, so use the normal extension.
      
      Also change PipSquak from SHARED to MODULE -- it's never passed to
      target_link_libraries() and only loaded via dlopen(), so MODULE is more
      appropriate. This makes it possible to delete a workaround for SHARED ldflags
      being not quite right as well.
      
      No intended behavior change.
      https://reviews.llvm.org/D46898
      
      llvm-svn: 332487
      12389819
    • Sanjay Patel's avatar
      [x86] add run with unsafe global param; NFC · 84caa965
      Sanjay Patel authored
      llvm-svn: 332486
      84caa965
    • Tony Tye's avatar
      [AMDGPU] Change llvm.debugtrap to be a debug breakpoint that can resume execution. · 43259df4
      Tony Tye authored
      No longer require the queue pointer to be passed in in fixed SGPRs.
      
      Differential Revision: https://reviews.llvm.org/D46769
      
      llvm-svn: 332485
      43259df4
    • Sanjay Patel's avatar
      [x86] add tests for DAG FP undef operands; NFC · b3ac148c
      Sanjay Patel authored
      llvm-svn: 332484
      b3ac148c
  2. May 16, 2018