summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2016-06-26Fixed build failure (due to unused variable error) in r273807.Amjad Aboud1-3/+1
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273809 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-26Apply clang-tidy's modernize-loop-convert to most of lib/Transforms.Benjamin Kramer53-519/+398
Only minor manual fixes. No functionality change intended. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273808 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-26[codeview] Improved array type support.Amjad Aboud2-2/+240
Added support for: 1. Multi dimension array. 2. Array of structure type, which previously was declared incompletely. 3. Dynamic size array. Differential Revision: http://reviews.llvm.org/D21526 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273807 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-26[RSForGC] Appease MSVCSanjoy Das1-2/+4
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273805 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-26[X86] Rewrite lowerVectorShuffleWithPSHUFB to not require a ZeroableMask to ↵Craig Topper1-39/+21
be created. We can do everything with the starting mask and zeroable bit vector. This removes the last usage of isSingleInputShuffleMask. NFC git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273804 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-26[X86] Replace calls to isSingleInputShuffleMask with just checking if V2 is ↵Craig Topper1-25/+25
UNDEF. Canonicalization and creation of shuffle vector ensures this is equivalent. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273803 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-26[SelectionDAG] Use DAG.getCommutedVectorShuffle instead of reimplementing it.Craig Topper1-15/+2
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273802 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-26[LoopUnswitch] Unswitch on conditions feeding into guardsSanjoy Das2-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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273801 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-26[RSForGC] Bring the BDVState struct up to code; NFCSanjoy Das1-25/+33
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273800 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-26[RSForGC] Bring computeLiveInValues up to code; NFCSanjoy Das1-8/+5
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273799 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-26[RSForGC] Bring computeLiveOutSeed up to code; NFCSanjoy Das1-7/+7
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273798 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-26[RSForGC] Bring computeLiveInValues up to code; NFCSanjoy Das1-19/+8
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273797 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-26[RSForGC] Bring recomputeLiveInValues up to code; NFCSanjoy Das1-9/+9
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273796 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-26[RSForGC] Bring containsGCPtrType, isGCPointerType up to code; NFCSanjoy Das1-3/+2
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273795 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-26[RSForGC] Bring analyzeParsePointLiveness up to code; NFCSanjoy Das1-7/+7
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273794 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-26[RSForGC] Bring meetBDVStateImpl up to code; NFCSanjoy Das1-14/+13
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273793 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-26[RSForGC] Get rid of the unnecessary MeetBDVStates struct; NFCSanjoy Das1-58/+36
All of its implementation is in just one function. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273792 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-26[RSForGC] Bring findBasePointer up to code; NFCSanjoy Das2-110/+96
Name-casing and minor style changes to bring the function up to the LLVM coding style. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273791 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-26[Object, COFF] An import data directory might not consist soley of importsDavid Majnemer3-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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273790 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-26[llvm-cov] Simplify the way expansion views are rendered (NFC)Vedant Kumar4-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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273789 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-25[X86] Convert ==/!= comparisons with -1 for checking undef in shuffle ↵Craig Topper1-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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273788 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-25[X86] Pull similar bitcasts on different paths to earlier shared point. NFCCraig Topper1-10/+9
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273787 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-25AMDGPU/R600: Fix GlobalValue regressions.Jan Vesely3-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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273785 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-25update tests to use FileCheckSanjay Patel1-34/+47
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273784 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-25[cmake] Port the llvm-config option --build-mode to LLVMConfig.cmake via the ↵Michael Gottesman1-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@. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273782 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-25Reapply r273664 with workaround for MSVCHubert Tong1-0/+45
Reviewers: rsmith, faisalv, aaron.ballman Subscribers: llvm-commits, cfe-commits, nwilson Differential Revision: http://reviews.llvm.org/D19770 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273781 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-25Just a small cleanupDavid Majnemer1-30/+21
No functional change is intended git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273780 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-25Revert "[SimplifyCFG] Stop inserting calls to llvm.trap for UB"David Majnemer10-31/+73
This reverts commit r273778, it seems to break UBSan :/ git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273779 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-25[SimplifyCFG] Stop inserting calls to llvm.trap for UBDavid Majnemer10-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... git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273778 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-25[InstSimplify] Replace calls to null with undefDavid Majnemer2-1/+18
Calling null is undefined behavior, we can simplify the resulting value to undef. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273777 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-25[SimplifyCFG] Replace calls to null/undef with unreachableDavid Majnemer3-1/+42
Calling null is undefined behavior, a call to undef can be trivially treated as a call to null. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273776 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-25Fix a typo in FindAvailableLoadedValue, introduced by r273734. [-Wdocumentation]NAKAMURA Takumi1-1/+1
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273774 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-25[llvm-cov] Make an API more consistent, NFCVedant Kumar4-12/+14
Make renderExpansionView() look a bit more like renderLine(), and clarify its doxygen comment. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273773 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-25[llvm-cov] Flesh out some doxygen comments, NFCVedant Kumar4-16/+20
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273772 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-25Try to fix the MSVC buildVedant Kumar1-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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273770 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-25[AMDGPU] Emit debugger prologue and emit the rest of the debugger fields in ↵Konstantin Zhuravlyov12-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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273769 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-25llvm-ar: add some tests for llvm-ar default selectionSaleem Abdulrasool8-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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273768 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-25[llvm-cov] Separate presentation logic from formatting logic, NFCVedant Kumar6-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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273767 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-25MachineScheduler: Remember top/bottom choice in bidirectional schedulingMatthias Braun2-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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273766 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-25AMDGPU/SI: Make sure not to fold offsets into local address space globalsTom Stellard3-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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273765 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-25[PlaceSafepoints] Don't call undef in test case; NFCSanjoy Das1-1/+3
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273764 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-25[LoopUnswitch] Avoid exponential behaviorSanjoy Das2-4/+73
Summary: (No semantic change intended). Reviewers: majnemer, bogner, mzolotukhin Subscribers: mcrosier, llvm-commits, mzolotukhin Differential Revision: http://reviews.llvm.org/D21707 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273763 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-25The absence of noreturn doesn't ensure mayReturnDavid Majnemer3-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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273762 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-25It isn't meaningful for a transform to preserve another transform. NFC.Michael Kuperstein2-10/+0
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273761 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-25IR: Introduce llvm.type.checked.load intrinsic.Peter Collingbourne12-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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273756 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-25MachineScheduler: Fully compare top/bottom candidatesMatthias Braun22-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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273755 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-25Reinstate r273711David Majnemer10-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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273753 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-25Silence a -Wsign-compare warningDavid Majnemer1-2/+2
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273752 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-24AMDGPU: Define a schedule class for COPY.Matthias Braun10-16/+39
COPY was lacking a scheduling class, define it to avoid regressions in the upcoming change to the bidirectional MachineScheduler. Approved by tstellar on IRC. Differential Revision: http://reviews.llvm.org/D21540 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273751 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-24[PM] Port float2int to the new pass managerMichael Kuperstein7-44/+98
Differential Revision: http://reviews.llvm.org/D21704 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273747 91177308-0d34-0410-b5e6-96231b3b80d8