summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* [OPENMP] Codegen for 'private' clause in 'task' directive.Alexey Bataev2015-04-304-29/+543
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For tasks codegen for private/firstprivate variables are different rather than for other directives. 1. Build an internal structure of privates for each private variable: struct .kmp_privates_t. { Ty1 var1; ... Tyn varn; }; 2. Add a new field to kmp_task_t type with list of privates. struct kmp_task_t { void * shareds; kmp_routine_entry_t routine; kmp_int32 part_id; kmp_routine_entry_t destructors; .kmp_privates_t. privates; }; 3. Create a function with destructors calls for all privates after end of task region. kmp_int32 .omp_task_destructor.(kmp_int32 gtid, kmp_task_t *tt) { ~Destructor(&tt->privates.var1); ... ~Destructor(&tt->privates.varn); return 0; } 4. Perform default initialization of all private fields (no initialization for POD data, default constructor calls for classes) + provide address of a destructor function after kmpc_omp_task_alloc() and before kmpc_omp_task() calls. kmp_task_t *new_task = __kmpc_omp_task_alloc(ident_t *, kmp_int32 gtid, kmp_int32 flags, size_t sizeof_kmp_task_t, size_t sizeof_shareds, kmp_routine_entry_t *task_entry); DefaultConstructor(new_task->privates.var1); new_task->shareds.var1_ref = &new_task->privates.var1; ... DefaultConstructor(new_task->privates.varn); new_task->shareds.varn_ref = &new_task->privates.varn; new_task->destructors = .omp_task_destructor.; kmp_int32 __kmpc_omp_task(ident_t *, kmp_int32 gtid, kmp_task_t *new_task) Differential Revision: http://reviews.llvm.org/D9322 llvm-svn: 236207
* [TableGen] Cleanup formatting by moving operators from beginning of line to ↵Craig Topper2015-04-302-43/+40
| | | | | | end of previous line. NFC llvm-svn: 236206
* [TableGen] Used range-based for loop. NFC.Craig Topper2015-04-301-6/+2
| | | | llvm-svn: 236205
* [TableGen] Merge a variable assignment and a return to drop curly braces. ↵Craig Topper2015-04-301-13/+7
| | | | | | Fold an assignment into an if. Use auto on the result of a couple dyn_casts. NFC llvm-svn: 236204
* [InstCombine] Add new rule for MIN(MAX(~A, ~B), ~C) et. al.Sanjoy Das2015-04-302-0/+103
| | | | | | | | | | | | | | | | | Summary: Optimizing these well are especially interesting for IRCE since it "clamps" values by generating this sort of pattern through SCEV expressions. Depends on D9352. Reviewers: majnemer Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D9353 llvm-svn: 236203
* [InstCombine] Add a new formula for SMIN.Sanjoy Das2015-04-302-0/+23
| | | | | | | | | | | | | | | | Summary: After this change `MatchSelectPattern` recognizes the following form of SMIN: Y >s C ? ~Y : ~C == ~Y <s ~C ? ~Y : ~C = SMIN(~Y, ~C) Reviewers: majnemer Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D9352 llvm-svn: 236202
* [OPENMP] Allow to use global variables as lcv in loop-based directives.Alexey Bataev2015-04-3010-33/+119
| | | | | | | For proper codegen we need to capture variable in the OpenMP region. In loop-based directives loop control variables are private by default and they must be captured in this region. There was a problem with capturing of globals, used as lcv, as they was not marked as private by default. Differential Revision: http://reviews.llvm.org/D9336 llvm-svn: 236201
* Don't overflow GCTableFilipe Cabecinhas2015-04-303-1/+6
| | | | | | | | | | | | Summary: Bug found with AFL fuzz. Reviewers: rafael, dexonsmith Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D9361 llvm-svn: 236200
* Semantically revert r236031, which is not a good idea for in-order targets.Owen Anderson2015-04-302-73/+0
| | | | | | | | | | | | At the least it should be guarded by some kind of target hook. It also introduced catastrophic compile time and code quality regressions on some out of tree targets (test case still being reduced/sanitized). Sanjay agreed with reverting this patch until these issues can be resolved. llvm-svn: 236199
* [OPENMP] Fixed codegen for 'copyprivate' clause.Alexey Bataev2015-04-303-9/+10
| | | | | | Fixed initialization of 'single' region completion + changed type of the third argument of __kmpc_copyprivate() runtime function to size_t. llvm-svn: 236198
* Remove dead code: a MacroDirective can't be imported or ambiguous any more.Richard Smith2015-04-307-140/+14
| | | | llvm-svn: 236197
* XFAIL test/CodeGen/Generic/MachineBranchProb.ll on Hexagon (PR23377)Hans Wennborg2015-04-301-1/+2
| | | | llvm-svn: 236196
* [UBSan] Make stacktrace-matching CHECK-lines in tests Linux-specific.Alexey Samsonov2015-04-302-16/+12
| | | | | | | Darwin doesn't yet allow to print stack trace, as it lacks the slow unwinder. This is one more attempt to fix vptr.cpp on Mac OS X. llvm-svn: 236195
* Remove XFAIL now that this test passes (fixed by r236184).Richard Smith2015-04-301-1/+0
| | | | llvm-svn: 236194
* Make sure Op->getType() is a PointerType before we cast<> it.Filipe Cabecinhas2015-04-303-0/+7
| | | | | | Bug found with AFL fuzz. llvm-svn: 236193
* Switch lowering: use profile info to build weight-balanced binary search treesHans Wennborg2015-04-303-8/+157
| | | | | | | | | | | | | | This will cause hot nodes to appear closer to the root. The literature says building the tree like this makes it a near-optimal (in terms of search time given key frequencies) binary search tree. In LLVM's case, we can do up to 3 comparisons in each leaf node, so it might be better to opt for lower tree height in some cases; that's something to look into in the future. Differential Revision: http://reviews.llvm.org/D9318 llvm-svn: 236192
* Fix use of uninitialized variable, found by ubsan selfhost.Richard Smith2015-04-301-1/+1
| | | | llvm-svn: 236191
* Make sure we don't resize(0) when we get a fwdref with Idx == UINT_MAXFilipe Cabecinhas2015-04-303-0/+9
| | | | | | | | Make it an error instead. Bug found with AFL fuzz. llvm-svn: 236190
* Store relocations in a map from MCSectionELF.Rafael Espindola2015-04-301-25/+21
| | | | | | Saves finding the MCSectionData just to do a map lookup. llvm-svn: 236189
* Use a more reliable method to determine whetherSean Callanan2015-04-301-2/+1
| | | | | | | | | a FileID corresponds to a real file or to a memory buffer. The old method didn't work when Clang was built Release, which meant it wasn't a very good method at all. llvm-svn: 236188
* Write relocations directly to the output stream. NFC.Rafael Espindola2015-04-301-46/+29
| | | | llvm-svn: 236187
* Flip r236172 testcase RUN option ordering for BSD sed(1). NFC.Ahmed Bougacha2015-04-301-1/+1
| | | | llvm-svn: 236186
* Add CMAKE_EXECUTABLE_SUFFIX to build with Android toolchain on Windows.Chaoren Lin2015-04-291-11/+16
| | | | | | | | | | Reviewers: vharron, zturner, flackr Subscribers: tberghammer, lldb-commits Differential Revision: http://reviews.llvm.org/D9177 llvm-svn: 236185
* Update clang/test/CodeGenCXX/copy-constructor-synthesis-2.cpp to pass for ↵NAKAMURA Takumi2015-04-291-3/+3
| | | | | | | | targeting i686. r236155 missed the suffix in "@llvm.memcpy.p0i8.p0i8.i32". llvm-svn: 236184
* Change x86 CMOVE_F to read it source, not write it.Pete Cooper2015-04-292-8/+23
| | | | | | | | | | This was breaking sqlite with the machine verifier because operand 0 was a def according to tablegen, but didn't have the 'isDef' flag set. Looking at the ISA, its clear that this operand is a source as writing to st(0) is implicit. So move the operand to the correct place in the td file. rdar://problem/20751584 llvm-svn: 236183
* Fix build after Clang API change in r236176.Richard Smith2015-04-291-11/+4
| | | | llvm-svn: 236182
* Add an assert to get information on buildbot failure.Richard Smith2015-04-291-0/+1
| | | | llvm-svn: 236181
* Fix doxygen comment typo. NFCJonathan Roelofs2015-04-291-2/+2
| | | | llvm-svn: 236180
* Propagate a terrible hack to the sparc target feature handling codeEric Christopher2015-04-292-3/+9
| | | | | | | | | by erasing the soft-float target feature if the rest of the front end added it because of defaults or the soft float option. Add some testing for some of the targets that implement this hack. llvm-svn: 236179
* Fix unused variable warning.Richard Smith2015-04-291-1/+1
| | | | llvm-svn: 236178
* Fix build broken by r236174.Zachary Turner2015-04-291-4/+4
| | | | | | Apparently va_list is literally a char* on Windows. llvm-svn: 236177
* [modules] Stop trying to fake up a linear MacroDirective history.Richard Smith2015-04-2931-493/+309
| | | | | | | | | | | | | | Modules builds fundamentally have a non-linear macro history. In the interest of better source fidelity, represent the macro definition information faithfully: we have a linear macro directive history within each module, and at any point we have a unique "latest" local macro directive and a collection of visible imported directives. This also removes the attendent complexity of attempting to create a correct MacroDirective history (which we got wrong in the general case). No functionality change intended. llvm-svn: 236176
* [opaque pointer type] Store the value type of an allocaDavid Blaikie2015-04-293-11/+17
| | | | llvm-svn: 236175
* Introduce a NullLog class, which ignores all messages.Zachary Turner2015-04-295-197/+279
| | | | | | | | | | | | | | | | The purpose of this class is so that GetLogIfAllCategoriesSet can always return an instance of some class, whether it be a real logging class or a "null" class, which ignores messages. Code that is littered with if statements that only log if the pointer is non-null can get very unwieldy very quickly, so this should help code readability in such circumstances. Since I'm in this code anyway, I'm also deleting the PrintfWithFlags methods, as well as all the flags, since they appear to be dead code that have been superceded by newer mechanisms and all the flags are simply ignored. llvm-svn: 236174
* XFAIL Hexagon until more codegen in place.Rick Foos2015-04-292-0/+2
| | | | | | | | | | | | | | | | | | Summary: Hexagon is being updated, but there is not enough to pass these tests. These sections are now on top of Colin's list. Test Plan: Ran changes on hexagon-build-03. Reviewers: colinl, rfoos Reviewed By: rfoos Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D9356 llvm-svn: 236173
* [WinEH] Start EH preparation for 32-bit x86, it uses no argumentsReid Kleckner2015-04-295-55/+108
| | | | | | | | | | | | | | | | | | 32-bit x86 MSVC-style exceptions are functionaly similar to 64-bit, but they take no arguments. Instead, they implicitly use the value of EBP passed in by the caller as a pointer to the parent's frame. In LLVM, we can represent this as llvm.frameaddress(1), and feed that into all of our calls to llvm.framerecover. The next steps are: - Add an alloca to the fs:00 linked list of handlers - Add something like llvm.sjlj.lsda or generalize it to store in the alloca - Move state number calculation to WinEHPrepare, arrange for FunctionLoweringInfo to call it - Use the state numbers to insert explicit loads and stores in the IR llvm-svn: 236172
* generalize binop reassociation; NFCSanjay Patel2015-04-291-17/+30
| | | | | | | | | | | | | Move the fold introduced in r236031: http://reviews.llvm.org/rL236031 to its own helper function, so we can use it for other binops. This is a preliminary step before partially solving: https://llvm.org/bugs/show_bug.cgi?id=21768 https://llvm.org/bugs/show_bug.cgi?id=23116 llvm-svn: 236171
* Don't force a vendor check in ProcessMachCore::CanDebug() -- if thisJason Molenda2015-04-291-7/+3
| | | | | | | | is a Mach-O file and it is a Mach-O core file, activate the ProcessMachCore plugin. <rdar://problem/20739989> llvm-svn: 236170
* Update to build sysv-arm/sysv-arm64/sblanguageinfo/registercontextlinux_arm64.Jason Molenda2015-04-291-0/+44
| | | | llvm-svn: 236169
* profile: Use unique directory for tests that write default profile fileJustin Bogner2015-04-292-0/+37
| | | | | | | | | | | Fix a couple of new tests that were reverted because they were causing intermittent test failures since they were writing the same default "default.profraw" file. Fixed by creating a unique directory and running tests in that directory. Patch by Teresa Johnson. Thanks! llvm-svn: 236168
* Revert r236128, LLVM isn't falling back in the right wayReid Kleckner2015-04-298-278/+153
| | | | llvm-svn: 236167
* Run StatepointLowering.{cpp,h} through clang-format.Pat Gavlin2015-04-292-39/+28
| | | | llvm-svn: 236166
* [UBSan] Disable vptr.cpp on Darwin again.Alexey Samsonov2015-04-291-0/+3
| | | | llvm-svn: 236165
* [NFC] Updating FileCheck to reduce the std::vector interface used via cl::list.Chris Bieneman2015-04-291-6/+8
| | | | llvm-svn: 236164
* [NFC] Converting to range-based for.Chris Bieneman2015-04-291-2/+1
| | | | llvm-svn: 236163
* [opaque pointer type] update for LLVM API changeDavid Blaikie2015-04-295-11/+10
| | | | llvm-svn: 236161
* [opaque pointer type] Pass GlobalAlias the actual pointer type rather than ↵David Blaikie2015-04-2912-59/+41
| | | | | | | | | | | | | decomposing it into pointee type + address space Many of the callers already have the pointer type anyway, and for the couple of callers that don't it's pretty easy to call PointerType::get on the pointee type and address space. This avoids LLParser from using PointerType::getElementType when parsing GlobalAliases from IR. llvm-svn: 236160
* Revert r236060, it caused PR23375.Nico Weber2015-04-291-1/+23
| | | | llvm-svn: 236159
* Inline FragmentWriter into the only user.Rafael Espindola2015-04-291-18/+4
| | | | llvm-svn: 236158
* Write the symbol table directly to the output file.Rafael Espindola2015-04-291-79/+85
| | | | | | There is no need to first accumulate it in fragments. llvm-svn: 236157
OpenPOWER on IntegriCloud