summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* [LoopUnswitch] Unswitch on conditions feeding into guardsSanjoy Das2016-06-262-7/+130
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This is a straightforward extension of what LoopUnswitch does to branches to guards. That is, we unswitch ``` for (;;) { ... guard(loop_invariant_cond); ... } ``` into ``` if (loop_invariant_cond) { for (;;) { ... // There is no need to emit guard(true) ... } } else { for (;;) { ... guard(false); // SimplifyCFG will clean this up by adding an // unreachable after the guard(false) ... } } ``` Reviewers: majnemer Subscribers: mcrosier, llvm-commits, mzolotukhin Differential Revision: http://reviews.llvm.org/D21725 llvm-svn: 273801
* [RSForGC] Bring the BDVState struct up to code; NFCSanjoy Das2016-06-261-25/+33
| | | | llvm-svn: 273800
* [RSForGC] Bring computeLiveInValues up to code; NFCSanjoy Das2016-06-261-8/+5
| | | | llvm-svn: 273799
* [RSForGC] Bring computeLiveOutSeed up to code; NFCSanjoy Das2016-06-261-7/+7
| | | | llvm-svn: 273798
* [RSForGC] Bring computeLiveInValues up to code; NFCSanjoy Das2016-06-261-19/+8
| | | | llvm-svn: 273797
* [RSForGC] Bring recomputeLiveInValues up to code; NFCSanjoy Das2016-06-261-9/+9
| | | | llvm-svn: 273796
* [RSForGC] Bring containsGCPtrType, isGCPointerType up to code; NFCSanjoy Das2016-06-261-3/+2
| | | | llvm-svn: 273795
* [RSForGC] Bring analyzeParsePointLiveness up to code; NFCSanjoy Das2016-06-261-7/+7
| | | | llvm-svn: 273794
* [RSForGC] Bring meetBDVStateImpl up to code; NFCSanjoy Das2016-06-261-14/+13
| | | | llvm-svn: 273793
* [RSForGC] Get rid of the unnecessary MeetBDVStates struct; NFCSanjoy Das2016-06-261-58/+36
| | | | | | All of its implementation is in just one function. llvm-svn: 273792
* [RSForGC] Bring findBasePointer up to code; NFCSanjoy Das2016-06-262-110/+96
| | | | | | | Name-casing and minor style changes to bring the function up to the LLVM coding style. llvm-svn: 273791
* [Object, COFF] An import data directory might not consist soley of importsDavid Majnemer2016-06-263-31/+47
| | | | | | | | | | | | | The last import is the penultimate entry, the last entry is nulled out. Data beyond the null entry should not be considered to hold import entries. This fixes PR28302. N.B. I am working on a reduced testcase, the one in PR28302 is too large. llvm-svn: 273790
* [llvm-cov] Simplify the way expansion views are rendered (NFC)Vedant Kumar2016-06-264-35/+38
| | | | | | | | | If a sub-view has already been rendered, it's helpful to re-render the expansion site before rendering the next expansion view. Make this fact explicit in the rendering interface, instead of hiding it behind an awkward Optional<LineRef> parameter. llvm-svn: 273789
* [X86] Convert ==/!= comparisons with -1 for checking undef in shuffle ↵Craig Topper2016-06-251-47/+54
| | | | | | lowering to comparisons of <0 or >=0. While there do the same for other kinds of index checks that can just check for greater than 0. No functional change intended. llvm-svn: 273788
* [X86] Pull similar bitcasts on different paths to earlier shared point. NFCCraig Topper2016-06-251-10/+9
| | | | llvm-svn: 273787
* [clang-tidy] Add modernize-use-usingKrystyna Gajczyk2016-06-258-0/+250
| | | | | | http://reviews.llvm.org/D18919 llvm-svn: 273786
* AMDGPU/R600: Fix GlobalValue regressions.Jan Vesely2016-06-253-7/+13
| | | | | | | | | | | | | | | Don't cast GV expression to MCSymbolRefExpr. r272705 changed GV to binary expressions by including offset even if the offset it 0 (we haven't hit this sooner since tested workloads don't include static offsets) We don't really care about the type of expression, so set it directly. Fixes: r272705 Consider section relative relocations. Since all const as data is in one boffer section relative is equivalent to abs32. Fixes: r273166 Differential Revision: http://reviews.llvm.org/D21633 llvm-svn: 273785
* update tests to use FileCheckSanjay Patel2016-06-251-34/+47
| | | | llvm-svn: 273784
* Fix unused variable warning after r273754.James Y Knight2016-06-251-0/+1
| | | | llvm-svn: 273783
* [cmake] Port the llvm-config option --build-mode to LLVMConfig.cmake via the ↵Michael Gottesman2016-06-251-0/+2
| | | | | | | | | | | | variable LLVM_BUILD_TYPE. This is just a small step in the direction of making LLVMConfig.cmake a complete replacement for llvm-config. For those unfamiliar, llvm-config --build-mode prints out CMAKE_BUILD_TYPE. Thus as one can imagine, LLVM_BUILD_TYPE is @CMAKE_BUILD_TYPE@. llvm-svn: 273782
* Reapply r273664 with workaround for MSVCHubert Tong2016-06-251-0/+45
| | | | | | | | | | Reviewers: rsmith, faisalv, aaron.ballman Subscribers: llvm-commits, cfe-commits, nwilson Differential Revision: http://reviews.llvm.org/D19770 llvm-svn: 273781
* Just a small cleanupDavid Majnemer2016-06-251-30/+21
| | | | | | No functional change is intended llvm-svn: 273780
* Revert "[SimplifyCFG] Stop inserting calls to llvm.trap for UB"David Majnemer2016-06-2510-31/+73
| | | | | | This reverts commit r273778, it seems to break UBSan :/ llvm-svn: 273779
* [SimplifyCFG] Stop inserting calls to llvm.trap for UBDavid Majnemer2016-06-2510-73/+31
| | | | | | | | | | | | | | | | | SimplifyCFG had logic to insert calls to llvm.trap for two very particular IR patterns: stores and invokes of undef/null. While InstCombine canonicalizes certain undefined behavior IR patterns to stores of undef, phase ordering means that this cannot be relied upon in general. There are much better tools than llvm.trap: UBSan and ASan. N.B. I could be argued into reverting this change if a clear argument as to why it is important that we synthesize llvm.trap for stores, I'd be hard pressed to see why it'd be useful for invokes... llvm-svn: 273778
* [InstSimplify] Replace calls to null with undefDavid Majnemer2016-06-252-1/+18
| | | | | | | Calling null is undefined behavior, we can simplify the resulting value to undef. llvm-svn: 273777
* [SimplifyCFG] Replace calls to null/undef with unreachableDavid Majnemer2016-06-253-1/+42
| | | | | | | Calling null is undefined behavior, a call to undef can be trivially treated as a call to null. llvm-svn: 273776
* [X86] Fix pslldq/psrldq intrinsics to not fail compilation with immediates ↵Craig Topper2016-06-254-250/+256
| | | | | | larger than 16. This was accidentally broken in r272246. llvm-svn: 273775
* Fix a typo in FindAvailableLoadedValue, introduced by r273734. [-Wdocumentation]NAKAMURA Takumi2016-06-251-1/+1
| | | | llvm-svn: 273774
* [llvm-cov] Make an API more consistent, NFCVedant Kumar2016-06-254-12/+14
| | | | | | | Make renderExpansionView() look a bit more like renderLine(), and clarify its doxygen comment. llvm-svn: 273773
* [llvm-cov] Flesh out some doxygen comments, NFCVedant Kumar2016-06-254-16/+20
| | | | llvm-svn: 273772
* Do not lookup the same option twice. NFC.Rui Ueyama2016-06-251-2/+2
| | | | llvm-svn: 273771
* Try to fix the MSVC buildVedant Kumar2016-06-251-2/+2
| | | | | | | | | There's some kind of issue with using "constexpr unsigned" in an anonymous namespace. http://lab.llvm.org:8011/builders/clang-x64-ninja-win7/builds/13395 llvm-svn: 273770
* [AMDGPU] Emit debugger prologue and emit the rest of the debugger fields in ↵Konstantin Zhuravlyov2016-06-2512-5/+287
| | | | | | | | | | | | | | | | | | | | | | | the kernel code header Debugger prologue is emitted if -mattr=+amdgpu-debugger-emit-prologue. Debugger prologue writes work group IDs and work item IDs to scratch memory at fixed location in the following format: - offset 0: work group ID x - offset 4: work group ID y - offset 8: work group ID z - offset 16: work item ID x - offset 20: work item ID y - offset 24: work item ID z Set - amd_kernel_code_t::debug_wavefront_private_segment_offset_sgpr to scratch wave offset reg - amd_kernel_code_t::debug_private_segment_buffer_sgpr to scratch rsrc reg - amd_kernel_code_t::is_debug_supported to true if all debugger features are enabled Differential Revision: http://reviews.llvm.org/D20335 llvm-svn: 273769
* llvm-ar: add some tests for llvm-ar default selectionSaleem Abdulrasool2016-06-258-0/+179
| | | | | | | This adds some tests for the smarter llvm-ar selection mode as well as some additional tests as per Rafael's post commit review comments. llvm-svn: 273768
* [llvm-cov] Separate presentation logic from formatting logic, NFCVedant Kumar2016-06-256-201/+363
| | | | | | | | | | This makes it easier to add renderers for new kinds of output formats. - Define and document a pure-virtual coverage rendering interface. - Move the text-based rendering logic into its a new file. - Re-work the API to better reflect the presentation/formatting split. llvm-svn: 273767
* MachineScheduler: Remember top/bottom choice in bidirectional schedulingMatthias Braun2016-06-252-11/+77
| | | | | | | | | | | | | Remember the last choice for the top/bottom scheduling boundary in bidirectional scheduling mode. The top choice should not change if we schedule at the bottom and vice versa. This allows us to improve compiletime: We only recalculate the best pick for one border and re-use the cached top-pick from the other border. Differential Revision: http://reviews.llvm.org/D19350 llvm-svn: 273766
* AMDGPU/SI: Make sure not to fold offsets into local address space globalsTom Stellard2016-06-253-0/+31
| | | | | | | | | | | | | | Summary: Offset folding only works if you are emitting relocations, and we don't emit relocations for local address space globals. Reviewers: arsenm, nhaustov Subscribers: arsenm, llvm-commits, kzhuravl Differential Revision: http://reviews.llvm.org/D21647 llvm-svn: 273765
* [PlaceSafepoints] Don't call undef in test case; NFCSanjoy Das2016-06-251-1/+3
| | | | llvm-svn: 273764
* [LoopUnswitch] Avoid exponential behaviorSanjoy Das2016-06-252-4/+73
| | | | | | | | | | | | Summary: (No semantic change intended). Reviewers: majnemer, bogner, mzolotukhin Subscribers: mcrosier, llvm-commits, mzolotukhin Differential Revision: http://reviews.llvm.org/D21707 llvm-svn: 273763
* The absence of noreturn doesn't ensure mayReturnDavid Majnemer2016-06-253-33/+1
| | | | | | | | | | | There are two separate issues: - LLVM doesn't consider infinite loops to be side effects: we happily hoist/sink above/below loops whose bounds are unknown. - The absence of the noreturn attribute is insufficient for us to know if a function will definitely return. Relying on noreturn in the middle-end for any property is an accident waiting to happen. llvm-svn: 273762
* It isn't meaningful for a transform to preserve another transform. NFC.Michael Kuperstein2016-06-252-10/+0
| | | | llvm-svn: 273761
* Fix bad test expectation.Peter Collingbourne2016-06-251-2/+2
| | | | llvm-svn: 273760
* [lld][MachO] Add support for x86-64 negDelta64 references and fix negDelta32.Lang Hames2016-06-253-77/+146
| | | | | | | | | | These references are used to implement MachO/x64-64 subtractor relocations where the minuend is being fixed up, rather than the subtrahend. The 64-bit version was not previously supported, the 32-bit version was partially implemented but contained bugs not caught by existing test cases. This patch fixes both functionality and test coverage. llvm-svn: 273759
* cfi: Start testing CFI in both standalone and devirtualization modes.Peter Collingbourne2016-06-256-7/+34
| | | | | | Differential Revision: http://reviews.llvm.org/D21123 llvm-svn: 273758
* CodeGen: Start emitting checked loads when both trapping CFI and ↵Peter Collingbourne2016-06-256-30/+111
| | | | | | | | -fwhole-program-vtables are enabled. Differential Revision: http://reviews.llvm.org/D21122 llvm-svn: 273757
* IR: Introduce llvm.type.checked.load intrinsic.Peter Collingbourne2016-06-2512-32/+508
| | | | | | | | | | | | | | | | This intrinsic safely loads a function pointer from a virtual table pointer using type metadata. This intrinsic is used to implement control flow integrity in conjunction with virtual call optimization. The virtual call optimization pass will optimize away llvm.type.checked.load intrinsics associated with devirtualized calls, thereby removing the type check in cases where it is not needed to enforce the control flow integrity constraint. This patch also introduces the capability to copy type metadata between global variables, and teaches the virtual call optimization pass to do so. Differential Revision: http://reviews.llvm.org/D21121 llvm-svn: 273756
* MachineScheduler: Fully compare top/bottom candidatesMatthias Braun2016-06-2522-150/+154
| | | | | | | | | | In bidirectional scheduling this gives more stable results than just comparing the "reason" fields of the top/bottom node because the reason field may be higher depending on what other nodes are in the queue. Differential Revision: http://reviews.llvm.org/D19401 llvm-svn: 273755
* Implement C++17 P0386R2, inline variables. (The 'inline' specifier gives aRichard Smith2016-06-2527-70/+371
| | | | | | | variable weak discardable linkage and partially-ordered initialization, and is implied for constexpr static data members.) llvm-svn: 273754
* Reinstate r273711David Majnemer2016-06-2510-33/+103
| | | | | | | | | | r273711 was reverted by r273743. The inliner needs to know about any call sites in the inlined function. These were obscured if we replaced a call to undef with an undef but kept the call around. This fixes PR28298. llvm-svn: 273753
* Silence a -Wsign-compare warningDavid Majnemer2016-06-251-2/+2
| | | | llvm-svn: 273752
OpenPOWER on IntegriCloud