summaryrefslogtreecommitdiffstats
path: root/llvm/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* IR: Introduce Module::global_objects().Peter Collingbourne2016-06-224-32/+14
| | | | | | | | | | | | This is a convenience iterator that allows clients to enumerate the GlobalObjects within a Module. Also start using it in a few places where it is obviously the right thing to use. Differential Revision: http://reviews.llvm.org/D21580 llvm-svn: 273470
* AMDGPU: Run verifier after 2nd run of SIShrinkInstructionsMatt Arsenault2016-06-221-1/+1
| | | | llvm-svn: 273469
* AMDGPU: Fix verifier errors in SILowerControlFlowMatt Arsenault2016-06-2210-133/+217
| | | | | | | | | | | | | The main sin this was committing was using terminator instructions in the middle of the block, and then not updating the block successors / predecessors. Split the blocks up to avoid this and introduce new pseudo instructions for branches taken with exec masking. Also use a pseudo instead of emitting s_endpgm and erasing it in the special case of a non-void return. llvm-svn: 273467
* [Hexagon] Add SDAG preprocessing step to expose shifted addressing modesKrzysztof Parzyszek2016-06-221-1/+54
| | | | | | | | | | | Transform: (store ch addr (add x (add (shl y c) e))) to: (store ch addr (add x (shl (add y d) c))), where e = (shl d c) for some integer d. The purpose of this is to enable generation of loads/stores with shifted addressing mode, i.e. mem(x+y<<#c). For that, the shift value c must be 0, 1 or 2. llvm-svn: 273466
* [UpdateCompilerUsed] API rename and cleanup, suggested by Rafaael.Davide Italiano2016-06-223-3/+2
| | | | | | | | | * UpdateCompilerUsed() -> updateCompilerUsed() * ThinLTO doesn't use the API so we can remove the include * Clean up unused #include <functional> from the header * Rename #ifdef guard comment to be correct. llvm-svn: 273461
* [MBFI]: Add a new suboption for graph viewerXinliang David Li2016-06-221-3/+19
| | | | | | | | | -view-machine-block-freq-propagation-dags currently support integer and fraction as the suboptions. This patch adds the 'count' suboption to display actual profile count if available. llvm-svn: 273460
* [ValueTracking] improve ComputeNumSignBits for vector constantsSanjay Patel2016-06-221-4/+33
| | | | | | | | | | | This is similar to the computeKnownBits improvement in rL268479. There's probably more we can do for vector logic instructions, but this should let us see non-splat constant masking ops that can become vector selects instead of and/andn/or sequences. Differential Revision: http://reviews.llvm.org/D21610 llvm-svn: 273459
* [AArch64] Remove an overly aggressive assert.Chad Rosier2016-06-221-5/+0
| | | | llvm-svn: 273458
* Start using shouldAssumeDSOLocal on Hexagon.Rafael Espindola2016-06-221-2/+3
| | | | | | | Include a token test showing that access to private is now the same as to internal. llvm-svn: 273457
* Preserve DebugInfo when replacing values in DAGCombinerNirav Dave2016-06-226-12/+22
| | | | | | | | | | | | | | | | | | | | | Recommiting after fixing over-aggressive assertion [DAG] Previously debug values would transfer debuginfo for the selected start node for a replacement which allows for debug to be dropped. Push debug value transfer to occur with node/value replacement in SelectionDAG, remove now extraneous transfers of debug values. This refixes PR9817 which was being incompletely checked in the testsuite. Reviewers: jyknight Subscribers: dblaikie, llvm-commits Differential Revision: http://reviews.llvm.org/D21037 llvm-svn: 273456
* AMDGPU: Add convergent flag to INLINEASM instruction.Wei Ding2016-06-223-2/+7
| | | | | | Differential Revision: http://reviews.llvm.org/D21214 llvm-svn: 273455
* [codeview] Add IntroducingVirtual debug info flagReid Kleckner2016-06-221-21/+6
| | | | | | | | CodeView needs to know if a virtual method was introduced in the current class, and base classes may not have complete type information, so we need to thread this bit through from the frontend. llvm-svn: 273453
* Removing whitespace from test commit rL273447Jason Henline2016-06-221-1/+1
| | | | | | Undoing the trivial change I introduced in rL273447. llvm-svn: 273449
* AMDGPU: Make FrameLowering stack alignment 16Matt Arsenault2016-06-221-3/+4
| | | | | | | We don't need it to be that high. The natural alignment for a single workitem's stack is 16. llvm-svn: 273448
* Add whitespace to check commit accessJason Henline2016-06-221-1/+1
| | | | | | | No functional changes. Just adding whitespace in a comment in order to check that I am able to push a commit to the repo. llvm-svn: 273447
* [asan] Do not instrument accesses to profiling globalsVedant Kumar2016-06-221-5/+14
| | | | | | | | | | | | | It's only useful to asan-itize profiling globals while debugging llvm's profiling instrumentation passes. Enabling asan along with instrprof or gcov instrumentation shouldn't incur extra overhead. This patch is in the same spirit as r264805 and r273202, which disabled tsan instrumentation of instrprof/gcov globals. Differential Revision: http://reviews.llvm.org/D21541 llvm-svn: 273444
* [codeview] Defer emission of all referenced complete recordsReid Kleckner2016-06-222-2/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | This is the motivating example: struct B { int b; }; struct A { B *b; }; int f(A *p) { return p->b->b; } Clang emits complete types for both A and B because they are required to be complete, but our CodeView emission would only emit forward declarations of A and B. This was a consequence of the fact that the A* type must reference the forward declaration of A, which doesn't reference B at all. We can't eagerly emit complete definitions of A and B when we request the forward declaration's type index because of recursive types like linked lists. If we did that, our stack usage could get out of hand, and it would be possible to lower a type while attempting to lower a type, and we would need to double check if our type is already present in the TypeIndexMap after all recursive getTypeIndex calls. Instead, defer complete type emission until after all type lowering has completed. This ensures that all referenced complete types are emitted, and that type lowering is not re-entrant. llvm-svn: 273443
* [BFI]: NFC refactoringXinliang David Li2016-06-222-11/+20
| | | | | | | move getBlockProfileCount implementation to the base class so that MBFI can share too. llvm-svn: 273442
* [SystemZ] Recognize RISBG opportunities involving a truncateZhan Jun Liau2016-06-221-3/+22
| | | | | | | | | | | | | | | | | | | Summary: Recognize RISBG opportunities where the end result is narrower than the original input - where a truncate separates the shift/and operations. The motivating case is some code in postgres which looks like: srlg %r2, %r0, 11 nilh %r2, 255 Reviewers: uweigand Author: RolandF Differential Revision: http://reviews.llvm.org/D21452 llvm-svn: 273433
* [Hexagon] Handle expansion of cmpxchgKrzysztof Parzyszek2016-06-222-0/+12
| | | | llvm-svn: 273432
* [codeview] Remove ClassInfoMapReid Kleckner2016-06-222-26/+13
| | | | | | | | | | From a design perspective, complete record type emission should not depend on information from other complete record types. Currently this map is unused, and needlessly accumulates data throughout compilation. llvm-svn: 273431
* [MBFI]: show branch probability in DOT graphXinliang David Li2016-06-221-0/+18
| | | | | | Differential Revision: http://reviews.llvm.org/D21596 llvm-svn: 273430
* NFC. Move Verifier::verifyIntrinsicType to Intrinsics.hArtur Pilipenko2016-06-222-148/+142
| | | | | | | | | | Move Verifier::verifyIntrinsicType to Intrinsics::matchIntrinsicsType. Will be used to accumulate overloaded types of a given intrinsic by the upcoming patch to fix intrinsics names when overloaded types are renamed. Reviewed By: reames Differential Revision: http://reviews.llvm.org/D19372 llvm-svn: 273424
* [SDAG] Remove FixedArgs parameter from CallLoweringInfo::setCalleeKrzysztof Parzyszek2016-06-2219-39/+36
| | | | | | | | | | | The setCallee function will set the number of fixed arguments based on the size of the argument list. The FixedArgs parameter was often explicitly set to 0, leading to a lack of consistent value for non- vararg functions. Differential Revision: http://reviews.llvm.org/D20376 llvm-svn: 273403
* Delete more dead code.Rafael Espindola2016-06-229-229/+0
| | | | | | Found by gcc 6. llvm-svn: 273402
* [LTO] Move UpdateCompilerUsed.h from lib/ to include/Davide Italiano2016-06-224-38/+3
| | | | | | | | I plan to use it in lld soon. Differential Revision: http://reviews.llvm.org/D21575 llvm-svn: 273380
* Add an option to enable MBFI dot viewer for a given functionXinliang David Li2016-06-221-1/+6
| | | | llvm-svn: 273366
* AMDGPU: Fix gcc warningsMatt Arsenault2016-06-224-197/+60
| | | | | | | Mostly removing dead code. Apparently gcc's warning for unused functions is better llvm-svn: 273363
* [codeview] Improve names of types in scopes and member function idsReid Kleckner2016-06-222-60/+126
| | | | | | | | | | | | We now include namespace scope info in LF_FUNC_ID records and we emit LF_MFUNC_ID records for member functions as we should. Class names are now fully qualified, which is what MSVC does. Add a little bit of scaffolding to handle ThisAdjustment when it arrives in DISubprogram. llvm-svn: 273358
* [asan] Do not instrument pointers with address space attributesAnna Zaks2016-06-222-0/+17
| | | | | | | | | Do not instrument pointers with address space attributes since we cannot track them anyway. Instrumenting them results in false positives in ASan and a compiler crash in TSan. (The compiler should not crash in any case, but that's a different problem.) llvm-svn: 273339
* IR: Allow metadata attachments on declarations, and fix lazy loaded metadata ↵Peter Collingbourne2016-06-217-44/+79
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | issue with globals. This change is motivated by an upcoming change to the metadata representation used for CFI. The indirect function call checker needs type information for external function declarations in order to correctly generate jump table entries for such declarations. We currently associate such type information with declarations using a global metadata node, but I plan [1] to move all such metadata to global object attachments. In bitcode, metadata attachments for function declarations appear in the global metadata block. This seems reasonable to me because I expect metadata attachments on declarations to be uncommon. In the long term I'd also expect this to be the case for CFI, because we'd want to use some specialized bitcode format for this metadata that could be read as part of the ThinLTO thin-link phase, which would mean that it would not appear in the global metadata block. To solve the lazy loaded metadata issue I was seeing with D20147, I use the same bitcode representation for metadata attachments for global variables as I do for function declarations. Since there's a use case for metadata attachments in the global metadata block, we might as well use that representation for global variables as well, at least until we have a mechanism for lazy loading global variables. In the assembly format, the metadata attachments appear after the "declare" keyword in order to avoid a parsing ambiguity. [1] http://lists.llvm.org/pipermail/llvm-dev/2016-June/100462.html Differential Revision: http://reviews.llvm.org/D21052 llvm-svn: 273336
* Clang format change /NFCXinliang David Li2016-06-211-35/+27
| | | | llvm-svn: 273335
* Make DeadMachineInstructionElim preserve CFGMatt Arsenault2016-06-211-0/+5
| | | | llvm-svn: 273330
* [Kryo] Enable loop prefetcher.Haicheng Wu2016-06-211-0/+4
| | | | | | Differential Revision: http://reviews.llvm.org/D21535 llvm-svn: 273329
* [Coverage] Clarify ownership of a MemoryBuffer in the reader (NFC)Vedant Kumar2016-06-212-8/+9
| | | | | | | | Pass a `MemoryBuffer &` to BinaryCoverageReader::create() instead of a `std::unique_ptr<MemoryBuffer> &`. This makes it easier to reason about the ownership of the buffer at a glance. llvm-svn: 273326
* Delete more dead code.Rafael Espindola2016-06-219-382/+0
| | | | | | Found by gcc 6. llvm-svn: 273322
* AMDGPU: Add implicitarg.ptr intrinsic.Jan Vesely2016-06-213-11/+24
| | | | | | | | Points to the start of implicit arguments (appended after explicit arguments) Differential Revision: http://reviews.llvm.org/D20297 llvm-svn: 273317
* [NVPTX] Improve lowering of byval args of device functions.Artem Belevich2016-06-213-15/+79
| | | | | | | | | | | | | | | | | | | | | Avoid unnecessary spills of such vars to local space on SASS level and pointer space conversion. Instead, make a local copy with appropriate addrspacecasts and let LLVM optimize them away when possible. This allows loading value of the argument using [symbol+offset] instead of converting argument to general space pointer and using it for indexing (which also implicitly converts param space pointer to local space one on SASS level and triggers copying of argument into local space in the process). This reduces call overhead, uses less registers and reduces overall SASS size by 2-4%. Differential Review: http://reviews.llvm.org/D21421 llvm-svn: 273313
* Add back some dead code.Rafael Espindola2016-06-211-0/+14
| | | | | | | It was there just to avoid warnings. Add a LLVM_ATTRIBUTE_UNUSED attribute so that it doesn't produce warnings with gcc 6. llvm-svn: 273308
* Delete some dead code.Rafael Espindola2016-06-219-88/+0
| | | | | | Found by gcc 6. llvm-svn: 273303
* Fix PR28219: Use profile summary from reader and not compute itEaswaran Raman2016-06-211-4/+1
| | | | | | Differentiaal revision: http://reviews.llvm.org/D21546 llvm-svn: 273301
* Add MemoryAccess creation and PHI creation APIs to MemorySSADaniel Berlin2016-06-211-3/+108
| | | | | | | | | | Reviewers: george.burgess.iv, gberry, hfinkel Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D21463 llvm-svn: 273295
* [codeview] Add support for splitting field list records over 64KBReid Kleckner2016-06-214-10/+96
| | | | | | | | | | | | | | | | | The basic structure is that once a list record goes over 64K, the last subrecord of the list is an LF_INDEX record that refers to the next record. Because the type record graph must be toplogically sorted, this means we have to emit them in reverse order. We build the type record in order of declaration, so this means that if we don't want extra copies, we need to detect when we were about to split a record, and leave space for a continuation subrecord that will point to the eventual split top-level record. Also adds dumping support for these records. Next we should make sure that large method overload lists work properly. llvm-svn: 273294
* [StackProtector] Fix computation of GSCookieOffset and EHCookieOffset with SEH4Etienne Bergeron2016-06-213-12/+93
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Fix the computation of the offsets present in the scopetable when using the SEH (__except_handler4). This patch added an intrinsic to track the position of the allocation on the stack of the EHGuard. This position is needed when producing the ScopeTable. ``` struct _EH4_SCOPETABLE { DWORD GSCookieOffset; DWORD GSCookieXOROffset; DWORD EHCookieOffset; DWORD EHCookieXOROffset; _EH4_SCOPETABLE_RECORD ScopeRecord[1]; }; struct _EH4_SCOPETABLE_RECORD { DWORD EnclosingLevel; long (*FilterFunc)(); union { void (*HandlerAddress)(); void (*FinallyFunc)(); }; }; ``` The code to generate the EHCookie is added in `X86WinEHState.cpp`. Which is adding these instructions when using SEH4. ``` Lfunc_begin0: # BB#0: # %entry pushl %ebp movl %esp, %ebp pushl %ebx pushl %edi pushl %esi subl $28, %esp movl %ebp, %eax <<-- Loading FramePtr movl %esp, -36(%ebp) movl $-2, -16(%ebp) movl $L__ehtable$use_except_handler4_ssp, %ecx xorl ___security_cookie, %ecx movl %ecx, -20(%ebp) xorl ___security_cookie, %eax <<-- XOR FramePtr and Cookie movl %eax, -40(%ebp) <<-- Storing EHGuard leal -28(%ebp), %eax movl $__except_handler4, -24(%ebp) movl %fs:0, %ecx movl %ecx, -28(%ebp) movl %eax, %fs:0 movl $0, -16(%ebp) calll _may_throw_or_crash LBB1_1: # %cont movl -28(%ebp), %eax movl %eax, %fs:0 addl $28, %esp popl %esi popl %edi popl %ebx popl %ebp retl ``` And the corresponding offset is computed: ``` Luse_except_handler4_ssp$parent_frame_offset = -36 .p2align 2 L__ehtable$use_except_handler4_ssp: .long -2 # GSCookieOffset .long 0 # GSCookieXOROffset .long -40 # EHCookieOffset <<---- .long 0 # EHCookieXOROffset .long -2 # ToState .long _catchall_filt # FilterFunction .long LBB1_2 # ExceptionHandler ``` Clang is not yet producing function using SEH4, but it's a work in progress. This patch is a step toward having a valid implementation of SEH4. Unfortunately, it is not yet fully working. The EH registration block is not allocated at the right offset on the stack. Reviewers: rnk, majnemer Subscribers: llvm-commits, chrisha Differential Revision: http://reviews.llvm.org/D21231 llvm-svn: 273281
* [AArch64] Change the preferred alignment for char and short to word alignmentEvandro Menezes2016-06-211-2/+2
| | | | | | Differential Revision: http://reviews.llvm.org/D21414 llvm-svn: 273279
* [AArch64] Restore codegen for AArch64 Cortex-A72/A73 after NFCISilviu Baranga2016-06-213-2/+24
| | | | | | | | | | | | | | | | | | | | | Summary: Code generation for Cortex-A72/Cortex-A73 was accidentally changed by r271555, which was a NFCI. The isCortexA57() predicate was not true for Cortex-A72/Cortex-A73 before r271555 (since it was checking the CPU string). Because Cortex-A72/Cortex-A73 inherit all features from Cortex-A57, all decisions previously guarded by isCortexA57() are now taken. This change restores the behaviour before r271555 by adding separate ProcA72/ProcA73, which have the required features to preserve code generation. Reviewers: kristof.beyls, aadg, mcrosier, rengolin Subscribers: mcrosier, llvm-commits, aemerson, t.p.northover, MatzeB, rengolin Differential Revision: http://reviews.llvm.org/D21182 llvm-svn: 273277
* fix indentationEtienne Bergeron2016-06-211-1/+1
| | | | llvm-svn: 273274
* This is part of the effort for asan to support Windows 64 bit.Etienne Bergeron2016-06-211-0/+4
| | | | | | | | | | The large offset is being tested on Windows 10 (which has larger usable virtual address space than Windows 8 or earlier) Patch by: Wei Wang Differential Revision: http://reviews.llvm.org/D21523 llvm-svn: 273269
* [codeview] Fix DenseMap pointer invalidation bugReid Kleckner2016-06-211-6/+9
| | | | | | | | When you have a map holding a unique_ptr, hold a reference to the raw pointer instead of the unique pointer. The unique_ptr will be moved on rehash. llvm-svn: 273268
* Strip trailing whitespaceSimon Pilgrim2016-06-211-4/+4
| | | | llvm-svn: 273264
OpenPOWER on IntegriCloud