summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen
Commit message (Collapse)AuthorAgeFilesLines
...
* Revert r245257 "Generating assumption loads of vptr after ctor call"Hans Wennborg2015-08-185-216/+109
| | | | | | It caused PR24479 llvm-svn: 245260
* Generating assumption loads of vptr after ctor callPiotr Padlewski2015-08-175-109/+216
| | | | | | | | | | | | Generating call assume(icmp %vtable, %global_vtable) after constructor call for devirtualization purposes. For more info go to: http://lists.llvm.org/pipermail/cfe-dev/2015-July/044227.html http://reviews.llvm.org/D11859 llvm-svn: 245257
* [MS ABI] Switch catchpad/cleanuppad to use tokensDavid Majnemer2015-08-153-19/+22
| | | | llvm-svn: 245153
* [OPENMP] Fix for http://llvm.org/PR24371: Assert failure compiling blender 2.75.Alexey Bataev2015-08-141-19/+1
| | | | | | | blender uses statements expression in condition of the loop under control of the '#pragma omp parallel for'. This condition is used several times in different expressions required for codegen of the loop directive. If there are some variables defined in statement expression, it fires an assert during codegen because of redefinition of the same variables. We have to rebuild several expression to be sure that all variables are unique. llvm-svn: 245041
* Wdeprecated: ByrefHelpers are copy constructed by the ::buildByrefHelpers ↵David Blaikie2015-08-132-22/+23
| | | | | | | | | | | | | helper, make sure they're safely copyable Make the copy/move ctors protected and defaulted in the base, make the derived classes final to avoid exposing any slicing-prone APIs. Also, while I'm here, simplify the use of buildByrefHelpers by taking the parameter by value instead of non-const ref. None of the callers care aobut observing the state after the call. llvm-svn: 244990
* Avoid iteration invalidation issues around MaterializedTemporaryExprDavid Majnemer2015-08-131-3/+2
| | | | | | | | | | | | | | | | We risk iterator invalidation issues if we use a DenseMap to hold the backing storage for an APValue. Instead, BumpPtrAllocate them and use APValue * as our DenseMap value. Also, don't assume that MaterializedGlobalTemporaryMap won't regrow between when we initially perform a lookup and later on when we actually try to insert into it. This fixes PR24289. Differential Revision: http://reviews.llvm.org/D11629 llvm-svn: 244989
* Fix previous commit: poison only class members, simpler testsNaomi Musgrave2015-08-131-7/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Poisoning applied to only class members, and before dtors for base class invoked Implement poisoning of only class members in dtor, as opposed to also poisoning fields inherited from base classes. Members are poisoned only once, by the last dtor for a class. Skip poisoning if class has no fields. Verify emitted code for derived class with virtual destructor sanitizes its members only once. Removed patch file containing extraneous changes. Reviewers: eugenis, kcc Differential Revision: http://reviews.llvm.org/D11951 Simplified test cases for use-after-dtor Summary: Simplified test cases to focus on one feature at time. Tests updated to align with new emission order for sanitizing callback. Reviewers: eugenis, kcc Differential Revision: http://reviews.llvm.org/D12003 llvm-svn: 244933
* Remove and forbid raw_svector_ostream::flush() calls.Yaron Keren2015-08-138-21/+0
| | | | | | | | | | After r244870 flush() will only compare two null pointers and return, doing nothing but wasting run time. The call is not required any more as the stream and its SmallString are always in sync. Thanks to David Blaikie for reviewing. llvm-svn: 244928
* Remove raw_svector_ostream::resync and users. It's no-op after r244870.Yaron Keren2015-08-131-2/+0
| | | | llvm-svn: 244888
* Remove superfluous private:, TypeCache is private by default.Yaron Keren2015-08-131-1/+0
| | | | llvm-svn: 244871
* Wdeprecated: ApplyDebugLocation is returned by value yet if it is ever ↵David Blaikie2015-08-122-24/+36
| | | | | | copied (rather than RVO'd) that would be broken, make it movable instead llvm-svn: 244838
* Wdeprecated: CGBuilderInserter is copy constructed in some contexts - remove ↵David Blaikie2015-08-121-5/+3
| | | | | | | | | the unnecessarily disabling copy assignment to enable this The object has very simple state, there seems no reason to disallow all the usual value semantic operations. llvm-svn: 244831
* Revert "Implement poisoning of only class members in dtor, as opposed to ↵Naomi Musgrave2015-08-121-32/+7
| | | | | | | | | also poisoning fields inherited from base classes." This reverts commit 8dbbf3578a9a5d063232b59e558e5fe46e2cd42c. Rolled back due to buildbot failures on 'ninja check-clang'. llvm-svn: 244820
* Implement poisoning of only class members in dtor, as opposed to also ↵Naomi Musgrave2015-08-121-7/+32
| | | | | | | | | | | | | | | | | poisoning fields inherited from base classes. Verify emitted code for derived class with virtual destructor sanitizes its members only once. Changed emission order for dtor callback, so only the last dtor for a class emits the sanitizing callback, while ensuring that class members are poisoned before base class destructors are invoked. Skip poisoning of members, if class has no fields. Removed patch file containing extraneous changes. Summary: Poisoning applied to only class members, and before dtors for base class invoked Reviewers: eugenis, kcc Differential Revision: http://reviews.llvm.org/D11951 llvm-svn: 244819
* Untabify.Eric Christopher2015-08-111-12/+12
| | | | llvm-svn: 244695
* This patch fixes the assert in emitting captured code in the target data ↵Michael Wong2015-08-111-1/+3
| | | | | | | | | construct. This is on behalf of Kelvin Li. http://reviews.llvm.org/D11475 llvm-svn: 244569
* Propagate SourceLocations through to get a Loc on float_cast_overflowFilipe Cabecinhas2015-08-116-103/+127
| | | | | | | | | | | | | | | Summary: float_cast_overflow is the only UBSan check without a source location attached. This patch propagates SourceLocations where necessary to get them to the EmitCheck() call. Reviewers: rsmith, ABataev, rjmccall Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D11757 llvm-svn: 244568
* Print vectorization analysis when loop hint is specified.Tyler Nowicki2015-08-111-15/+21
| | | | | | This patche and a related llvm patch solve the problem of having to explicitly enable analysis when specifying a loop hint pragma to get the diagnostics. Passing AlwasyPrint as the pass name (see below) causes the front-end to print the diagnostic if the user has specified '-Rpass-analysis' without an '=<target-pass>’. Users of loop hints can pass that compiler option without having to specify the pass and they will get diagnostics for only those loops with loop hints. llvm-svn: 244556
* Append options for vectorization when pointer checking threshold is exceeded.Tyler Nowicki2015-08-101-0/+19
| | | | | | Following one of the appended options will allow the loop to be vectorized. We do not include a command line option for modifying the pointer checking threshold because there is no clang-level interface for this currently. llvm-svn: 244526
* Append options for floating-point commutivity when related diagnostics are ↵Tyler Nowicki2015-08-101-0/+19
| | | | | | | | produced. With this patch clang appends the command line options that would allow vectorization when floating-point commutativity is required. Specifically those are enabling fast-math or specifying a loop hint. llvm-svn: 244492
* Correct x86_64 fp128 calling conventionChih-Hung Hsieh2015-08-101-12/+27
| | | | | | | | | | | | | | | | These changes are for Android x86_64 targets to be compatible with current Android g++ and conform to AMD64 ABI. https://llvm.org/bugs/show_bug.cgi?id=23897 * Return type of long double (fp128) should be fp128, not x86_fp80. * Vararg of long double (fp128) could be in register and overflowed to memory. https://llvm.org/bugs/show_bug.cgi?id=24111 * Return value of long double (fp128) _Complex should be in memory like a structure of {fp128,fp128}. Differential Revision: http://reviews.llvm.org/D11437 llvm-svn: 244468
* Add new llvm.loop.unroll.enable metadata for use with "#pragma unroll".Mark Heffernan2015-08-102-17/+30
| | | | | | | | | | | | | | | | | | | | | | This change adds the new unroll metadata "llvm.loop.unroll.enable" which directs the optimizer to unroll a loop fully if the trip count is known at compile time, and unroll partially if the trip count is not known at compile time. This differs from "llvm.loop.unroll.full" which explicitly does not unroll a loop if the trip count is not known at compile time With this change "#pragma unroll" generates "llvm.loop.unroll.enable" rather than "llvm.loop.unroll.full" metadata. This changes the semantics of "#pragma unroll" slightly to mean "unroll aggressively (fully or partially)" rather than "unroll fully or not at all". The motivating example for this change was some internal code with a loop marked with "#pragma unroll" which only sometimes had a compile-time trip count depending on template magic. When the trip count was a compile-time constant, everything works as expected and the loop is fully unrolled. However, when the trip count was not a compile-time constant the "#pragma unroll" explicitly disabled unrolling of the loop(!). Removing "#pragma unroll" caused the loop to be unrolled partially which was desirable from a performance perspective. llvm-svn: 244467
* [modules] PR22534: Load files specified by -fmodule-file= eagerly. In ↵Richard Smith2015-08-091-1/+6
| | | | | | particular, this avoids the need to re-parse module map files when using such a module. llvm-svn: 244416
* This patch commits OpenMP 4 target device clausesMichael Wong2015-08-071-0/+1
| | | | | | | This is committed on behalf of Kelvin Li http://reviews.llvm.org/D11469?id=31227 llvm-svn: 244325
* [ItaniumCXXABI] Don't import RTTI data for classes with key functionsDavid Majnemer2015-08-061-4/+14
| | | | | | | | | MinGW has some pretty strange behvaior around RTTI and dllimport/dllexport: - RTTI data is never imported - RTTI data is only exported if the class has no key function. llvm-svn: 244266
* [OPENMP 4.1] Allow references in init expression for loop-based constructs.Alexey Bataev2015-08-061-8/+18
| | | | | | OpenMP 4.1 allows to use variables with reference types in private clauses and, therefore, in init expressions of the cannonical loop forms. llvm-svn: 244209
* Mark calls in thunk functions as tail-call optimization candidatesMichael Kuperstein2015-08-061-0/+2
| | | | | | | | | | | | | When a thunk is generated with a call to the original adjusted function, the thunk appears in the debugger call stack. We want the backend to perform tail-call optimization on the call, to make it invisible to the debugger. This fixes PR24235 Patch by: amjad.aboud@intel.com Differential Revision: http://reviews.llvm.org/D11476 llvm-svn: 244207
* Rename the non-coding style conformant functions in namespace BuiltinsEric Christopher2015-08-062-3/+3
| | | | | | to match the rest of their brethren and reformat the bits that need it. llvm-svn: 244186
* Rename DescriptionString -> DataLayoutString as it matches the actualEric Christopher2015-08-053-7/+7
| | | | | | use of the string. llvm-svn: 244178
* Add -gcodeview and -gdwarf to control which type Clang emitsReid Kleckner2015-08-051-1/+6
| | | | | | | | | | | | | | | Summary: By default, 'clang' emits dwarf and 'clang-cl' emits codeview. You can force emission of one or both by passing -gcodeview and -gdwarf to either driver. Reviewers: dblaikie, hans Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D11742 llvm-svn: 244097
* Add missing atomic libcall support.James Y Knight2015-08-051-3/+71
| | | | | | | | | | Support for emitting libcalls for __atomic_fetch_nand and __atomic_{add,sub,and,or,xor,nand}_fetch was missing; add it, and some test cases. Differential Revision: http://reviews.llvm.org/D10847 llvm-svn: 244063
* Don't repeat function names in comments. NFC.Filipe Cabecinhas2015-08-053-27/+23
| | | | llvm-svn: 244018
* [CodeGen] Fold memcpy into SmallVector initializer. No functionality change.Benjamin Kramer2015-08-041-3/+2
| | | | llvm-svn: 243992
* [CodeGen] Don't write into a SmallVector's uninitialized memory.Benjamin Kramer2015-08-041-7/+4
| | | | | | That's just ugly and not needed in this case. No functionality change. llvm-svn: 243973
* [UB] Another place where we were trying to put string data intoChandler Carruth2015-08-041-2/+4
| | | | | | | | | | | | | a BumpPtrAllocator. This at least now handles the case where there is no concatentation without calling memcpy on a null pointer. It might be interesting to handle the case where everything is empty without round-tripping through the allocator, but it wasn't clear to me if the pointer returned is significant in any way, so I've left it in a conservatively more-correct state. Again, found with UBSan. llvm-svn: 243948
* Dtor callback emitted when msan attribute not repressed for this function.Naomi Musgrave2015-08-031-1/+2
| | | | | | | | | | | | | | | | | | Summary: In addition to checking compiler flags, the front-end also examines the attributes of the destructor definition to ensure that the SanitizeMemory attribute is attached. Reviewers: eugenis, kcc Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D11727 refactored test into new file, revised how function attribute examined modified test to examine default dtor with and without attribute removed attribute check llvm-svn: 243912
* Fix invalid shufflevector operandsSimon Pilgrim2015-08-021-1/+12
| | | | | | | | | | This patch fixes bug 23800 ( https://llvm.org/bugs/show_bug.cgi?id=23800#c2 ). There existed a case where the index operand from extractelement was directly used to create a shufflevector mask. Since the index can be of any integral type but the mask must only contain 32 bit integers a 64 bit index operand led to an assertion error later on. Committed on behalf of mpflanzer (Moritz Pflanzer) Differential Revision: http://reviews.llvm.org/D10838 llvm-svn: 243851
* Rangify for loops, NFC.Yaron Keren2015-08-014-9/+8
| | | | llvm-svn: 243841
* [MS ABI] Hook clang up to the new EH instructionsDavid Majnemer2015-07-317-44/+238
| | | | | | | | | | The new EH instructions make it possible for LLVM to generate .xdata tables that the MSVC personality routines will be happy about. Because this is experimental, hide it behind a -cc1 flag (-fnew-ms-eh). Differential Revision: http://reviews.llvm.org/D11405 llvm-svn: 243767
* DI: Update for LLVM API change for local variablesDuncan P. N. Exon Smith2015-07-312-22/+26
| | | | | | | | Adjust to LLVM DIBuilder API changes in r243764, using `createAutoVariable()` and `createParameterVariable()` in place of `createLocalVariable()`. No real functionality change here. llvm-svn: 243765
* Updated test regex and flagsNaomi Musgrave2015-07-301-2/+2
| | | | llvm-svn: 243669
* repress tail call optimization when performing use-after-dtor sanitizationNaomi Musgrave2015-07-301-0/+4
| | | | | | | | | | Reviewers: eugenis, kcc Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D11613 llvm-svn: 243668
* Use llvm::reverse to make a bunch of loops use foreach. NFC.Pete Cooper2015-07-302-10/+9
| | | | | | | | | | | | | | | | In llvm commit r243581, a reverse range adapter was added which allows us to change code such as for (auto I = Fields.rbegin(), E = Fields.rend(); I != E; ++I) { in to for (const FieldDecl *I : llvm::reverse(Fields)) This commit changes a few of the places in clang which are eligible to use this new adapter. llvm-svn: 243663
* In case of an existing GlobalVariable, the comdat is created using the name ↵Yaron Keren2015-07-291-3/+3
| | | | | | | | | | | | | of the new GV (usually NAME.1) instead of the correct NAME of the old GV. Moving comdat creation after GV replacement solves this. Patch + testcase. Reviewed by Reid Kleckner. http://reviews.llvm.org/D11594 llvm-svn: 243525
* Remove unnecessary variable.Yaron Keren2015-07-291-12/+8
| | | | llvm-svn: 243517
* Add -femulated-tls flag to select the emulated TLS model.Chih-Hung Hsieh2015-07-281-0/+1
| | | | | | | | | This will be used for old targets like Android that do not support ELF TLS models. Differential Revision: http://reviews.llvm.org/D10524 llvm-svn: 243441
* [CodeGen] Simplify creation of shuffle masks.Benjamin Kramer2015-07-282-39/+10
| | | | | | No functional change intended. llvm-svn: 243439
* Getting rid of old iterator loopsPiotr Padlewski2015-07-282-15/+11
| | | | llvm-svn: 243431
* [CodeGen] Clean up CGBuiltin a bit.Benjamin Kramer2015-07-281-272/+176
| | | | | | | | | | - Use cached LLVM types - Turn SmallVectors into Arrays/ArrayRef if the size is static - Use ConstantInt::get's implicit splatting for vector types No functionality change intended. llvm-svn: 243425
* [AArch64] Implement __builtin_thread_pointerAdhemerval Zanella2015-07-281-0/+5
| | | | | | | This path add the aarch64 __builtin_thread_pointer support. It will be lowered to llvm.aarch64.thread.pointer. llvm-svn: 243413
OpenPOWER on IntegriCloud