summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Revert "[TableGen] Use cast instead of dyn_cast where result isn't checked ↵Craig Topper2015-04-221-1/+1
| | | | | | | | before being dereferenced." Turns out I misread the parentheses. Though I'm pretty sure its always a RecordRecTy and non of the callers really seem to expect null. But until I'm completely sure I'm going to revert this. llvm-svn: 235469
* Fix stale comment that mentioned 0 instead of nullptr. NFC.Craig Topper2015-04-221-1/+1
| | | | llvm-svn: 235468
* [TableGen] Remove Pool helper class and just use unique_ptr in the maps.Craig Topper2015-04-221-41/+24
| | | | llvm-svn: 235467
* [TableGen] Use StringRecTy::get() instead of allocating (and leaking) a ↵Craig Topper2015-04-221-2/+2
| | | | | | StringRecTy object. llvm-svn: 235466
* [TableGen] Use 'isa' to identify UnsetInits rather than comparing with the ↵Craig Topper2015-04-223-4/+4
| | | | | | singleton object created by UnsetInit::get(). Makes it more consistent with the other types. llvm-svn: 235465
* [modules] Cope with partial module macro information, fix memory leak found ↵Richard Smith2015-04-223-6/+14
| | | | | | by buildbot. llvm-svn: 235464
* [TableGen] Use cast instead of dyn_cast where result isn't checked before ↵Craig Topper2015-04-221-1/+1
| | | | | | being dereferenced. llvm-svn: 235463
* Cleanup formatting for consistency with surrounding code.Craig Topper2015-04-221-9/+9
| | | | llvm-svn: 235462
* [modules] Build a DAG of module macros for each identifier.Richard Smith2015-04-226-31/+167
| | | | | | | | This graph will be used to determine the current set of active macros. This is foundation work for getting macro visibility correct across submodules of the current module. No functionality change for now. llvm-svn: 235461
* [x86] allow 64-bit extracted vector element integer stores on a 32-bit systemSanjay Patel2015-04-222-1/+61
| | | | | | | | | | | | | | | | | | | | | With SSE2, we can generate a 'movq' or other 64-bit store op on a 32-bit system even though 64-bit integers are not legal types. So instead of producing this: pshufd $229, %xmm0, %xmm1 ## xmm1 = xmm0[1,1,2,3] movd %xmm0, (%eax) movd %xmm1, 4(%eax) We can do: movq %xmm0, (%eax) This is a fix for the problem noted in D7296. Differential Revision: http://reviews.llvm.org/D9134 llvm-svn: 235460
* [WinEH] Correctly handle inlined __finally blocks with capturesReid Kleckner2015-04-222-6/+81
| | | | | | | | We should also teach the inliner to collapse framerecover of frameaddress of the current frame down to an alloca, but that can happen later. llvm-svn: 235459
* [opaque pointer type] Avoid using PointerType::getElementType for a few ↵David Blaikie2015-04-218-46/+116
| | | | | | | | | | | | | | | | | | | | | | | | cases of CallInst Calls to llvm::Value::mutateType are becoming extra-sensitive now that instructions have extra type information that will not be derived from operands or result type (alloca, gep, load, call/invoke, etc... ). The special-handling for mutateType will get more complicated as this work continues - it might be worth making mutateType virtual & pushing the complexity down into the classes that need special handling. But with only two significant uses of mutateType (vectorization and linking) this seems OK for now. Totally open to ideas/suggestions/improvements, of course. With this, and a bunch of exceptions, we can roundtrip an indirect call site through bitcode and IR. (a direct call site is actually trickier... I haven't figured out how to deal with the IR deserializer's lazy construction of Function/GlobalVariable decl's based on the type of the entity which means looking through the "pointer to T" type referring to the global) llvm-svn: 235458
* Remove a zero-length file of llvm/test/Transforms/InstCombine/descale-zero.ll.NAKAMURA Takumi2015-04-211-0/+0
| | | | llvm-svn: 235457
* Expose -fdiagnostics-parseable-fixits to clang-clHans Wennborg2015-04-212-1/+2
| | | | | | | | Patch by Daniel Cheng! Differential Revision: http://reviews.llvm.org/D9175 llvm-svn: 235456
* Limiting gep merging to fix the performance problem described inWei Mi2015-04-213-22/+7
| | | | | | | | | | | | | | | | | | https://llvm.org/bugs/show_bug.cgi?id=23163. Gep merging sometimes behaves like a reverse CSE/LICM optimization, which has negative impact on performance. In this patch we restrict gep merging to happen only when the indexes to be merged are both consts, which ensures such merge is always beneficial. The patch makes gep merging only happen in very restrictive cases. It is possible that some analysis/optimization passes rely on the merged geps to get better result, and we havn't notice them yet. We will be ready to further improve it once we see the cases. Differential Revision: http://reviews.llvm.org/D8911 llvm-svn: 235455
* Same issue as in D8685 but for i386.Chaoren Lin2015-04-214-7/+19
| | | | llvm-svn: 235454
* Revert r235451 since it is attached to a wrong Differential Revision. Sorry.Wei Mi2015-04-214-55/+22
| | | | llvm-svn: 235453
* [cuda] Allow using integral non-type template parameters as launch_bounds ↵Artem Belevich2015-04-218-28/+204
| | | | | | | | | | | | | | | | attribute arguments. - Changed CUDALaunchBounds arguments from integers to Expr* so they can be saved in AST for instantiation. - Added support for template instantiation of launch_bounds attrubute. - Moved evaluation of launch_bounds arguments to NVPTXTargetCodeGenInfo:: SetTargetAttributes() where it can be done after template instantiation. - Added a warning on negative launch_bounds arguments. - Amended test cases. Differential Revision: http://reviews.llvm.org/D8985 llvm-svn: 235452
* Limiting gep merging to fix the performance problem described inWei Mi2015-04-214-22/+55
| | | | | | | | | | | | | | | | | | https://llvm.org/bugs/show_bug.cgi?id=23163. Gep merging sometimes behaves like a reverse CSE/LICM optimizations, which has negative impact on performance. In this patch we restrict gep merging to happen only when the indexes to be merged are both consts, which ensures such merge is always beneficial. The patch makes gep merging only happen in very restrictive cases. It is possible that some analysis/optimization passes rely on the merged geps to get better result, and we havn't notice them yet. We will be ready to further improve it once we see the cases. Differential Revision: http://reviews.llvm.org/D9007 llvm-svn: 235451
* Silence MSVC build alignment warningsAndrew Kaylor2015-04-211-1/+9
| | | | llvm-svn: 235450
* [cuda] Added support for CUDA built-in variables.Artem Belevich2015-04-214-0/+196
| | | | | | | | | | | | | | | | | Added cuda_builtin_vars.h which implements built-in CUDA variables using __declattr(property). Fields of built-in variables (except for warpSize) are implemented using __declattr(property) which replaces read/write of a member field with a call to a getter/setter member function, in this case with appropriate NVPTX builtin. Added a test case to check diagnostics on attempt to construct or improperly access a built-in variable. Differential Revision: http://reviews.llvm.org/D9064 llvm-svn: 235448
* Add properties to SBExecutionContext to access the several entities it ↵Enrico Granata2015-04-211-0/+15
| | | | | | stores in a more Pythonic fashion llvm-svn: 235447
* [modules] Move list of exported module macros from IdentifierInfo lookup ↵Richard Smith2015-04-214-441/+227
| | | | | | | | | table to separate storage, adjacent to the macro directive history. This is substantially simpler, provides better space usage accounting in bcanalyzer, and gives a more compact representation. No functionality change intended. llvm-svn: 235420
* [MemCpyOpt] Use the raw i8* dest when optimizing memset+memcpy.Ahmed Bougacha2015-04-212-1/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | MemIntrinsic::getDest() looks through pointer casts, and using it directly when building the new GEP+memset results in stuff like: %0 = getelementptr i64* %p, i32 16 %1 = bitcast i64* %0 to i8* call ..memset(i8* %1, ...) instead of the correct: %0 = bitcast i64* %p to i8* %1 = getelementptr i8* %0, i32 16 call ..memset(i8* %1, ...) Instead, use getRawDest, which just gives you the i8* value. While there, use the memcpy's dest, as it's live anyway. In most cases, when the optimization triggers, the memset and memcpy sizes are the same, so the built memset is 0-sized and eliminated. The problem occurs when they're different. Fixes a regression caused by r235232: PR23300. llvm-svn: 235419
* [Hexagon] Patterns for frame index with offset for iselKrzysztof Parzyszek2015-04-212-0/+30
| | | | llvm-svn: 235418
* Update comment. NFC.Lang Hames2015-04-211-1/+9
| | | | llvm-svn: 235417
* Revamp PredIteratorCache interface to be cleaner.Daniel Berlin2015-04-215-61/+68
| | | | | | | | | | | | | Summary: This lets us use range based for loops. Reviewers: chandlerc Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D9169 llvm-svn: 235416
* [NVPTX] do not run DCE after SLSR and SeparateConstOffsetFromGEPJingyue Wu2015-04-211-10/+4
| | | | | | | | | | | | | | | | Summary: With D9096 and D9101, there's no need to run DCE after SLSR and SeparateConstOffsetFromGEP. Test Plan: no regression Reviewers: jholewinski, meheff Subscribers: jholewinski, llvm-commits Differential Revision: http://reviews.llvm.org/D9172 llvm-svn: 235415
* [LSR][NFC] Remove a stale comment.Sanjoy Das2015-04-211-3/+0
| | | | | | The comment was made stale in r171735. llvm-svn: 235414
* DebugInfo: Remove DIArray and DITypeArray typedefsDuncan P. N. Exon Smith2015-04-219-61/+54
| | | | | | | Remove the `DIArray` and `DITypeArray` typedefs, preferring the underlying types (`DebugNodeArray` and `MDTypeRefArray`, respectively). llvm-svn: 235413
* DebugInfo: Prepare for removal of DIArray and DITypeArray typedefsDuncan P. N. Exon Smith2015-04-212-38/+44
| | | | | | | | An upcoming LLVM commit will remove the `DIArray` and `DITypeArray` typedefs that shadow `DebugNodeArray` and `MDTypeRefArray`, respectively. Use those types directly. llvm-svn: 235412
* [sanitizer] Plug a memory leak in symbolization code.Sergey Matveev2015-04-211-0/+1
| | | | llvm-svn: 235411
* [SLSR] garbage-collect unused instructionsJingyue Wu2015-04-215-7/+17
| | | | | | | | | | | | | | | | | Summary: After we rewrite a candidate, the instructions used by the old form may become unused. This patch cleans up these unused instructions so that we needn't run DCE after SLSR. Test Plan: removed -dce in all the SLSR tests Reviewers: broune, meheff Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D9101 llvm-svn: 235410
* [SeparateConstOffsetFromGEP] garbage-collect intermediate instructionsJingyue Wu2015-04-213-28/+67
| | | | | | | | | | | | | | Summary: so that we needn't run DCE after this pass. Test Plan: removed -dce from the commandline in split-gep.ll and split-gep-and-gvn.ll Reviewers: meheff Subscribers: llvm-commits, HaoLiu, hfinkel, jholewinski Differential Revision: http://reviews.llvm.org/D9096 llvm-svn: 235409
* Remove FilesToRemove->push_back(Filename) from sys::DontRemoveFileOnSignal.Yaron Keren2015-04-211-1/+0
| | | | llvm-svn: 235408
* DebugInfo: Use MDType in DITypeIdentifierMapDuncan P. N. Exon Smith2015-04-211-1/+1
| | | | | | | Use `MDType*` instead of `MDNode*` in `DITypeIdentifierMap`, since all the members should be types. llvm-svn: 235407
* Move IDF Calculation to a separate file, expose an interface to it.Daniel Berlin2015-04-214-130/+224
| | | | | | | | | | | | | | | Summary: MemorySSA uses this algorithm as well, and this enables us to reuse the code in both places. There are no actual algorithm or datastructure changes in here, just code movement. Reviewers: qcolombet, chandlerc Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D9118 llvm-svn: 235406
* DebugInfo: Prune unnecessary forward declarationsDuncan P. N. Exon Smith2015-04-211-13/+0
| | | | | | | Probably these forward declarations were once useful, but they certainly don't belong here now. llvm-svn: 235405
* DebugInfo: Drop rest of DIDescriptor subclassesDuncan P. N. Exon Smith2015-04-2128-287/+124
| | | | | | | Delete the remaining subclasses of (the already deleted) `DIDescriptor`. Part of PR23080. llvm-svn: 235404
* DebugInfo: Prepare for deletion of DIDescriptor subclassesDuncan P. N. Exon Smith2015-04-212-59/+47
| | | | | | | An upcoming LLVM commit will delete all the remaining subclasses of (the already deleted) `DIDescriptor`. Stop using them. llvm-svn: 235403
* Recommend to use CMake on the Clang Getting Started page.Alexey Samsonov2015-04-211-8/+15
| | | | llvm-svn: 235402
* Revert r235398 "[cuda] Added support for CUDA built-in variables."Artem Belevich2015-04-214-196/+0
| | | | | | r235398 was causing buildbot break due to missing Makefile changes. llvm-svn: 235401
* DebugInfo: Assert dbg.declare/value insts are validDuncan P. N. Exon Smith2015-04-214-15/+11
| | | | | | | | | | Remove early returns for when `getVariable()` is null, and just assert that it never happens. The Verifier already confirms that there's a valid variable on these intrinsics, so we should assume the debug info isn't broken. I also updated a check for a `!dbg` attachment, which the Verifier similarly guarantees. llvm-svn: 235400
* Re-land r235154-r235156 under the existing -sehprepare flagReid Kleckner2015-04-2113-48/+420
| | | | | | | | Keep the old SEH fan-in lowering on by default for now, since projects rely on it. This will make it easy to test this change with a simple flag flip. llvm-svn: 235399
* [cuda] Added support for CUDA built-in variables.Artem Belevich2015-04-214-0/+196
| | | | | | | | | | | | | | | | | Added cuda_builtin_vars.h which implements built-in CUDA variables using __declattr(property). Fields of built-in variables (except for warpSize) are implemented using __declattr(property) which replaces read/write of a member field with a call to a getter/setter member function, in this case with appropriate NVPTX builtin. Added a test case to check diagnostics on attempt to construct or improperly access a built-in variable. Differential Revision: http://reviews.llvm.org/D9064 llvm-svn: 235398
* Implement target-specific __attribute__((aligned)) valueUlrich Weigand2015-04-217-7/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The GCC construct __attribute__((aligned)) is defined to set alignment to "the default alignment for the target architecture" according to the GCC documentation: The default alignment is sufficient for all scalar types, but may not be enough for all vector types on a target that supports vector operations. The default alignment is fixed for a particular target ABI. clang currently hard-coded an alignment of 16 bytes for that construct, which is correct on some platforms (including X86), but wrong on others (including SystemZ). Since this value is ABI-relevant, it is important to get correct for compatibility purposes. This patch adds a new TargetInfo member "DefaultAlignForAttributeAligned" that targets can set to the appropriate default __attribute__((aligned)) value. Note that I'm deliberately *not* using the existing "SuitableAlign" value, which is used to set the pre-defined macro __BIGGEST_ALIGNMENT__, since those two values may not be the same on all platforms. In fact, on X86, __attribute__((aligned)) always uses 16-byte alignment, while __BIGGEST_ALIGNMENT__ may be larger if AVX-2 or AVX-512 are supported. (This is actually not yet correctly implemented in clang either.) The patch provides a value for DefaultAlignForAttributeAligned only for SystemZ, and leaves the default for all other targets at 16, which means no visible change in behavior on all other targets. (The value is still wrong for some other targets, but I'd prefer to leave it to the target maintainers for those platforms to fix.) llvm-svn: 235397
* Provide alignment info on LLVM external symbolsUlrich Weigand2015-04-212-0/+15
| | | | | | | | | | | | | | | | | Code in CodeGenModule::GetOrCreateLLVMGlobal that sets up GlobalValue object for LLVM external symbols has this comment: // FIXME: This code is overly simple and should be merged with other global // handling. One part does seems to be "overly simple" currently is that this code never sets any alignment info on the GlobalValue, so that the emitted IR does not have any align attribute on external globals. This can lead to unnecessarily inefficient code generation. This patch adds a GV->setAlignment call to set alignment info. llvm-svn: 235396
* Fix __alignof__ of global variables on SystemZUlrich Weigand2015-04-213-1/+32
| | | | | | | | | | | | | | | | | SystemZ prefers to align all global variables to two bytes, which is implemented by setting the TargetInfo member MinGlobalAlign. However, for compatibility with existing compilers this should *not* change the ABI alignment value as retrieved via __alignof__, which it currently does. This patch fixes the issue by having ASTContext::getDeclAlign ignore the MinGlobalAlign setting in the ForAlignof case. Since SystemZ is the only platform setting MinGlobalAlign, this should cause no change for any other target. llvm-svn: 235395
* X86: Match for X86ISD nodes in LowerBUILD_VECTOR instead of BUILD_VECTORCombineMatthias Braun2015-04-212-24/+38
| | | | | | | | | There doesn't seem to be a reason to perform this target ISD node matching in an DAGCombine, moving it to lowering fixes PR23296. Differential Revision: http://reviews.llvm.org/D9137 llvm-svn: 235394
* [ELF] Change return type of the OutputSection::flags() methodSimon Atanasyan2015-04-212-2/+2
| | | | | | | This method returns _flags field which has `uint64_t` type. Now the field's type and the method's return type are consistent. llvm-svn: 235393
OpenPOWER on IntegriCloud