1. Jun 26, 2017
    • Rui Ueyama's avatar
      Remove a stale comment. · fb02869b
      Rui Ueyama authored
      llvm-svn: 306295
      fb02869b
    • Simon Pilgrim's avatar
      e77df9bc
    • Reid Kleckner's avatar
      [COFF] Improve synthetic symbol handling · 502d4ce2
      Reid Kleckner authored
      Summary:
      The main change is that we can have SECREL and SECTION relocations
      against ___safe_se_handler_table, which is important for handling the
      debug info in the MSVCRT.
      
      Previously we were using DefinedRelative for __safe_se_handler_table and
      __ImageBase, and after we implement CFGuard, we plan to extend it to
      handle __guard_fids_table, __guard_longjmp_table, and more.  However,
      DefinedRelative is really only suitable for implementing __ImageBase,
      because it lacks a Chunk, which you need in order to figure out the
      output section index and output section offset when resolving SECREl and
      SECTION relocations.
      
      This change renames DefinedRelative to DefinedSynthetic and gives it a
      Chunk. One wart is that __ImageBase doesn't have a chunk. It points to
      the PE header, effectively. We could split DefinedRelative and
      DefinedSynthetic if we think that's cleaner and creates fewer special
      cases.
      
      I also added safeseh.s, which checks that we don't emit a safe seh table
      entries pointing to garbage collected handlers and that we don't emit a
      table at all when there are no handlers.
      
      Reviewers: ruiu
      
      Reviewed By: ruiu
      
      Subscribers: inglorion, pcc, llvm-commits, aprantl
      
      Differential Revision: https://reviews.llvm.org/D34577
      
      llvm-svn: 306293
      502d4ce2
    • Rui Ueyama's avatar
      Add GlobalOffsetTable to ElfSym. NFC. · 92c37819
      Rui Ueyama authored
      Most "reserved" symbols are in ElfSym and it looks like there's no
      reason to not do the same thing for _GLOBAL_OFFSET_TABLE_. This should
      help https://reviews.llvm.org/D34618 too.
      
      llvm-svn: 306292
      92c37819
    • Axel Naumann's avatar
      Improve const-correctness. · 19520027
      Axel Naumann authored
      llvm-svn: 306291
      19520027
    • Siddharth Bhat's avatar
      [PPCGCodeGeneration] Add flag to allow polly to fail in GPU kernel fails. · 65d7f72f
      Siddharth Bhat authored
      - This is useful for debugging GPU code.
      
      llvm-svn: 306290
      65d7f72f
    • Sanjay Patel's avatar
      [x86] transform vector inc/dec to use -1 constant (PR33483) · 15748d23
      Sanjay Patel authored
      Convert vector increment or decrement to sub/add with an all-ones constant:
      
      add X, <1, 1...> --> sub X, <-1, -1...>
      sub X, <1, 1...> --> add X, <-1, -1...>
      
      The all-ones vector constant can be materialized using a pcmpeq instruction that is 
      commonly recognized as an idiom (has no register dependency), so that's better than 
      loading a splat 1 constant.
      
      AVX512 uses 'vpternlogd' for 512-bit vectors because there is apparently no better
      way to produce 512 one-bits.
      
      The general advantages of this lowering are:
      1. pcmpeq has lower latency than a memop on every uarch I looked at in Agner's tables, 
         so in theory, this could be better for perf, but...
      
      2. That seems unlikely to affect any OOO implementation, and I can't measure any real 
         perf difference from this transform on Haswell or Jaguar, but...
      
      3. It doesn't look like it from the diffs, but this is an overall size win because we 
         eliminate 16 - 64 constant bytes in the case of a vector load. If we're broadcasting 
         a scalar load (which might itself be a bug), then we're replacing a scalar constant 
         load + broadcast with a single cheap op, so that should always be smaller/better too.
      
      4. This makes the DAG/isel output more consistent - we use pcmpeq already for padd x, -1 
         and psub x, -1, so we should use that form for +1 too because we can. If there's some
         reason to favor a constant load on some CPU, let's make the reverse transform for all
         of these cases (either here in the DAG or in a later machine pass).
      
      This should fix:
      https://bugs.llvm.org/show_bug.cgi?id=33483
      
      Differential Revision: https://reviews.llvm.org/D34336
      
      llvm-svn: 306289
      15748d23
    • Krzysztof Parzyszek's avatar
      918e6d70
    • Jonas Paulsson's avatar
      [SystemZ] Add a check against zero before calling getTestUnderMaskCond() · 8c33647b
      Jonas Paulsson authored
      Csmith discovered that this function can be called with a zero argument,
      in which case an assert for this triggered.
      
      This patch also adds a guard before the other call to this function since
      it was missing, although the test only covers the case where it was
      discovered.
      
      Reduced test case attached as CodeGen/SystemZ/int-cmp-54.ll.
      
      Review: Ulrich Weigand
      llvm-svn: 306287
      8c33647b
    • Michael Zuckerman's avatar
      [X86][LLVM][test]Expanding Supports lowerInterleavedStore() in X86InterleavedAccess test. · ce7e187f
      Michael Zuckerman authored
      Adding base tast (to trunk) for Store strid=4 vf=32. 
      
      llvm-svn: 306286
      ce7e187f
    • Simon Pilgrim's avatar
      [llvm-stress] Remove Rand32 helper function · 3d116189
      Simon Pilgrim authored
      To try and help avoid repeats of PR32585, remove Rand32 which is only called by Rand64
      
      llvm-svn: 306285
      3d116189
    • Siddharth Bhat's avatar
      [PPCGCodeGeneration] Allow intrinsics within kernels. · f291c8d5
      Siddharth Bhat authored
      - In D33414, if any function call was found within a kernel, we would bail out.
      
      - This is an over-approximation. This patch changes this by allowing the
        `llvm.sqrt.*` family of intrinsics.
      
      - This introduces an additional step when creating a separate llvm::Module
        for a kernel (GPUModule). We now copy function declarations from the
        original module to new module.
      
      - We also populate IslNodeBuilder::ValueMap so it replaces the function
        references to the old module to the ones in the new module
        (GPUModule).
      
      Differential Revision: https://reviews.llvm.org/D34145
      
      llvm-svn: 306284
      f291c8d5
    • Andreas Simbuerger's avatar
      [NFC] Return both polly.start and polly.exiting from executeScopConditionally. · 256070d8
      Andreas Simbuerger authored
      This commit returns both the start and the exit block that are created
      by executeScopConditionally.
      
      In a future commit we will make use of the exit block. Before we would
      have to use the implicit property that there won't be any code generated
      between polly.start and polly.exiting at the time of use to find the
      correct block ('polly.exiting').
      
      All usage location are semantically unchanged.
      
      llvm-svn: 306283
      256070d8
    • Peter Smith's avatar
      [ELF] Define _GLOBAL_OFFSET_TABLE_ symbol relative to .got · 113a59e7
      Peter Smith authored
      On many architectures gcc and clang will recognize _GLOBAL_OFFSET_TABLE_ - .
      and produce a relocation that can be processed without needing to know the
      value of _GLOBAL_OFFSET_TABLE_. This is not always the case; for example ARM
      gcc produces R_ARM_BASE_PREL but clang produces the more general
      R_ARM_REL32 to _GLOBAL_OFFSET_TABLE_. To evaluate this relocation
      correctly _GLOBAL_OFFSET_TABLE_ must be defined to be the either the base of
      the GOT or end of the GOT dependent on architecture..
      
      If/when llvm-mc is changed to recognize _GLOBAL_OFFSET_TABLE_ - . this
      change will not be necessary for new objects. However there may still be
      old objects and versions of clang.
      
      Differential Revision: https://reviews.llvm.org/D34355
      
      llvm-svn: 306282
      113a59e7
    • Simon Pilgrim's avatar
      [llvm-stress] Ensure that the C++11 random device respects its min/max values (PR32585) · 1158fe97
      Simon Pilgrim authored
      As noted on PR32585, the change in D29780/rL295325 resulted in calls to Rand32() (values 0 -> 0xFFFFFFFF) but the min()/max() operators indicated it would be (0 -> 0x7FFFF).
      
      This patch changes the random operator to call Rand() instead which does respect the 0 -> 0x7FFFF range and asserts that the value is in range as well.
      
      Differential Revision: https://reviews.llvm.org/D34089
      
      llvm-svn: 306281
      1158fe97
    • Petar Jovanovic's avatar
      [mips] Enable IAS by default for Android 64-bit MIPS target (N64) · c02bda3c
      Petar Jovanovic authored
      IAS is already used for MIPS64 in majority of Android projects.
      Android MIPS64 uses N64 ABI. Set IAS as a default now.
      
      Differential Revision: https://reviews.llvm.org/D34514
      
      llvm-svn: 306280
      c02bda3c
    • Mikael Holmen's avatar
      [IfConversion] Hoist removeBranch calls out of if/else clauses [NFC] · 45bd32f9
      Mikael Holmen authored
      Summary:
      Also added a comment.
      
      Pulled out of https://reviews.llvm.org/D34099.
      
      Reviewers: iteratee
      
      Reviewed By: iteratee
      
      Subscribers: llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D34388
      
      llvm-svn: 306279
      45bd32f9
    • Pavel Labath's avatar
      Shorten sanitizer plugin names · 2a1c09fe
      Pavel Labath authored
      Summary:
      The new UndefinedBehaviorSanitizer plugin was breaking file path length
      limits, because it's (fairly long name) appears multiple times in the
      path. Cmake ends up putting the object file at path
      tools/lldb/source/Plugins/InstrumentationRuntime/UndefinedBehaviorSanitizer/CMakeFiles/lldbPluginInstrumentationRuntimeUndefinedBehaviorSanitizer.dir/UndefinedBehaviorSanitizerRuntime.cpp.obj
      which is 191 characters long and very dangerously close to the 260
      character path limit on windows systems (also, just the include line for
      that file was breaking the 80 character line limit).
      
      This renames the sanitizer plugins to use shorter names (asan, ubsan,
      tsan). I think this will still be quite understandable to everyone as
      those are the names everyone uses to refer to them anyway.
      
      Reviewers: zturner, kubamracek, jingham
      
      Subscribers: lldb-commits, mgorny
      
      Differential Revision: https://reviews.llvm.org/D34553
      
      llvm-svn: 306278
      2a1c09fe
    • Craig Topper's avatar
      [IR] Rename BinaryOperator::init to AssertOK and remove argument. Replace... · 700892fd
      Craig Topper authored
      [IR] Rename BinaryOperator::init to AssertOK and remove argument. Replace default case in switch with llvm_unreachable since all valid opcodes are covered.
      
      This method doesn't do any initializing. It just contains asserts. So renaming to AssertOK makes it consistent with similar instructions in other Instruction classes.
      
      llvm-svn: 306277
      700892fd
    • Serguei Katkov's avatar
      This reverts commit r306272. · 0e70206c
      Serguei Katkov authored
      Revert "[MBP] do not rotate loop if it creates extra branch"
      
      It breaks the sanitizer build bots. Need to fix this.
      
      llvm-svn: 306276
      0e70206c
    • Tobias Grosser's avatar
      [bugpoint] Do not initialize disassembler passes · 258245a6
      Tobias Grosser authored
      We added the initilization of disassembler passes in r306208 with the goal to
      bring bugpoint in line with 'opt'. However, 'opt' does itself not initialize
      dissassembler passes. As our goal was consistency, we drop the initialization
      of dissassembler passes again from bugpoint.
      
      Thanks to Chandler for pointing this out!
      
      llvm-svn: 306275
      258245a6
    • Hiroshi Inoue's avatar
      fix trivial typo in comment, NFC · 4484ff03
      Hiroshi Inoue authored
      llvm-svn: 306274
      4484ff03
    • Tobias Grosser's avatar
      [tests] Add forgotten pollyacc REQUIRES line · 2927cb75
      Tobias Grosser authored
      llvm-svn: 306273
      2927cb75
    • Serguei Katkov's avatar
      [MBP] do not rotate loop if it creates extra branch · b01fff06
      Serguei Katkov authored
      This is a last fix for the corner case of PR32214. Actually this is not really corner case in general.
      
      We should not do a loop rotation if we create an additional branch due to it.
      Consider the case where we have a loop chain H, M, B, C , where
      H is header with viable fallthrough from pre-header and exit from the loop
      M - some middle block
      B - backedge to Header but with exit from the loop also.
      C - some cold block of the loop.
      
      Let's H is determined as a best exit. If we do a loop rotation M, B, C, H we can introduce the extra branch.
      Let's compute the change in number of branches:
      +1 branch from pre-header to header
      -1 branch from header to exit
      +1 branch from header to middle block if there is such
      -1 branch from cold bock to header if there is one
      
      So if C is not a predecessor of H then we introduce extra branch.
      
      This change actually prohibits rotation of the loop if both true
      1) Best Exit has next element in chain as successor.
      2) Last element in chain is not a predecessor of first element of chain.
      
      Reviewers: iteratee, xur
      Reviewed By: iteratee
      Subscribers: llvm-commits
      Differential Revision: https://reviews.llvm.org/D34271
      
      llvm-svn: 306272
      b01fff06
    • Richard Smith's avatar
      Testcase missed from r306075. · c0de2f2b
      Richard Smith authored
      llvm-svn: 306270
      c0de2f2b
    • Marshall Clow's avatar
      Updated for the Toronto meeting · 77957d19
      Marshall Clow authored
      llvm-svn: 306269
      77957d19
    • Davide Italiano's avatar
      [CFL-AA] Remove unneeded function declaration. NFCI. · 9a024942
      Davide Italiano authored
      llvm-svn: 306268
      9a024942
    • Chandler Carruth's avatar
      [InstCombine] Factor the logic for propagating !nonnull and !range · 2abb65ae
      Chandler Carruth authored
      metadata out of InstCombine and into helpers.
      
      NFC, this just exposes the logic used by InstCombine when propagating
      metadata from one load instruction to another. The plan is to use this
      in SROA to address PR32902.
      
      If anyone has better ideas about how to factor this or name variables,
      I'm all ears, but this seemed like a pretty good start and lets us make
      progress on the PR.
      
      This is based on a patch by Ariel Ben-Yehuda (D34285).
      
      llvm-svn: 306267
      2abb65ae
    • Sylvestre Ledru's avatar
    • Matt Arsenault's avatar
      AMDGPU: Whitespace fixes · 8bcf2f20
      Matt Arsenault authored
      llvm-svn: 306265
      8bcf2f20
    • Matt Arsenault's avatar
      AMDGPU: Partially fix implicit.buffer.ptr intrinsic handling · 10fc062b
      Matt Arsenault authored
      This should not be treated as a different version of
      private_segment_buffer. These are distinct things with
      different uses and register classes, and requires the
      function argument info to have more context about the
      function's type and environment.
      
      Also add missing test coverage for the intrinsic, and
      emit an error for HSA. This also encovers that the intrinsic
      is broken unless there happen to be stack objects.
      
      llvm-svn: 306264
      10fc062b
    • Sylvestre Ledru's avatar
      Remove the script dump_check_docs.py. It was a one-shot migration script. · 19d0ccae
      Sylvestre Ledru authored
      Sign off from Alexander Kornienko by email
      
      llvm-svn: 306263
      19d0ccae
    • Sylvestre Ledru's avatar
      fix various typos · e3fdbaea
      Sylvestre Ledru authored
      llvm-svn: 306262
      e3fdbaea
    • Sylvestre Ledru's avatar
      Fix a typo · 94a21041
      Sylvestre Ledru authored
      llvm-svn: 306261
      94a21041
    • Derek Bruening's avatar
      [esan] Disable flaky tests for PR33590 · 92e4443c
      Derek Bruening authored
      Disables 3 esan workingset tests until their underlying failures are
      determined and resolved.
      
      llvm-svn: 306259
      92e4443c
    • Yuka Takahashi's avatar
      [bash-autocompletion] Delete space after flags which has '=' prefix · a4a87802
      Yuka Takahashi authored
      Summary:
      This is patch for bash completion for clang project.
      We don't need space when completing options like "-stdlib=".
      
      Differential Revision: https://reviews.llvm.org/D34594
      
      llvm-svn: 306258
      a4a87802
    • Chandler Carruth's avatar
      [LoopSimplify] Re-instate r306081 with a bug fix w.r.t. indirectbr. · 4a000883
      Chandler Carruth authored
      This was reverted in r306252, but I already had the bug fixed and was
      just trying to form a test case.
      
      The original commit factored the logic for forming dedicated exits
      inside of LoopSimplify into a helper that could be used elsewhere and
      with an approach that required fewer intermediate data structures. See
      that commit for full details including the change to the statistic, etc.
      
      The code looked fine to me and my reviewers, but in fact didn't handle
      indirectbr correctly -- it left the 'InLoopPredecessors' vector dirty.
      
      If you have code that looks *just* right, you can end up leaking these
      predecessors into a subsequent rewrite, and crash deep down when trying
      to update PHI nodes for predecessors that don't exist.
      
      I've added an assert that makes the bug much more obvious, and then
      changed the code to reliably clear the vector so we don't get this bug
      again in some other form as the code changes.
      
      I've also added a test case that *does* manage to catch this while also
      giving some nice positive coverage in the face of indirectbr.
      
      The real code that found this came out of what I think is CPython's
      interpreter loop, but any code with really "creative" interpreter loops
      mixing indirectbr and other exit paths could manage to tickle the bug.
      I was hard to reduce the original test case because in addition to
      having a particular pattern of IR, the whole thing depends on the order
      of the predecessors which is in turn depends on use list order. The test
      case added here was designed so that in multiple different predecessor
      orderings it should always end up going down the same path and tripping
      the same bug. I hope. At least, it tripped it for me without
      manipulating the use list order which is better than anything bugpoint
      could do...
      
      llvm-svn: 306257
      4a000883
    • Chandler Carruth's avatar
      [LoopSimplify] Improve a test for loop simplify minorly. NFC. · 73367b6a
      Chandler Carruth authored
      I did some basic testing while looking for a bug in my recent change to
      loop simplify and even though it didn't find the bug it seems like
      a useful improvement anyways.
      
      llvm-svn: 306256
      73367b6a
    • Davide Italiano's avatar
      [MemDep] Cleanup return after else & use `auto`. NFC. · f15fb368
      Davide Italiano authored
      llvm-svn: 306255
      f15fb368
    • Anna Thomas's avatar
      [LoopDeletion] NFC: Move phi node value setting into prepass · e7cb633d
      Anna Thomas authored
      Recommit NFC patch (rL306157) where I missed incrementing the basic block iterator,
      which caused loop deletion tests to hang due to infinite loop.
      Had reverted it in rL306162.
      
      rL306157 commit message:
      Currently, the implementation of delete dead loops has a special case
      when the loop being deleted is never executed. This special case
      (updating of exit block's incoming values for phis) can be
      run as a prepass for non-executable loops before performing
      the actual deletion.
      
      llvm-svn: 306254
      e7cb633d