summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen
Commit message (Collapse)AuthorAgeFilesLines
...
* Use more ArrayRefsDavid Majnemer2016-06-248-11/+11
| | | | | | No functional change is intended, just a small refactoring. llvm-svn: 273647
* Invoke simplifycfg and sroa before instcombine.Dehao Chen2016-06-231-3/+9
| | | | | | | | | | | | Summary: InstCombine needs to be performed after simplifycfg and sroa, otherwise it may make bad optimization decisions. Reviewers: davidxl, wmi, dnovillo Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D21568 llvm-svn: 273606
* Implement p0292r2 (constexpr if), a likely C++1z feature.Richard Smith2016-06-233-10/+15
| | | | llvm-svn: 273602
* Restructure the propagation of -fPIC/-fPIE.Rafael Espindola2016-06-232-6/+3
| | | | | | | | | | | | | The PIC and PIE levels are not independent. In fact, if PIE is defined it is always the same as PIC. This is clear in the driver where ParsePICArgs returns a PIC level and a IsPIE boolean. Unfortunately that is currently lost and we pass two redundant levels down the pipeline. This patch keeps a bool and a PIC level all the way down to codegen. llvm-svn: 273566
* CodeGen: support linker options on Windows ARMSaleem Abdulrasool2016-06-231-0/+10
| | | | | | | | We would incorrectly emit the directive sections due to the missing overridden methods. We now emit the expected "/DEFAULTLIB" rather than "-l" options for requested linkage llvm-svn: 273558
* [Coverage] Push a new region when handling CXXTryStmtsVedant Kumar2016-06-221-1/+6
| | | | | | | | Push a new region for the try block and propagate execution counts through it. This ensures that catch statements get a region counter distinct from the try block's counter. llvm-svn: 273463
* [codeview] Set the new IntroducedVirtual debug info flagReid Kleckner2016-06-221-0/+9
| | | | llvm-svn: 273454
* Add support for /Ob1 and -finline-hint-functions flagsHans Wennborg2016-06-222-3/+10
| | | | | | | | | | | | | | | | Add support for /Ob1 (and equivalent -finline-hint-functions), which enable inlining only for functions marked inline, either explicitly (via inline keyword, for example), or implicitly (function definition in class body, for example). This works by enabling inlining pass, and adding noinline attribute to every function not marked inline. Patch by Rudy Pons <rudy.pons@ilod.org>! Differential Revision: http://reviews.llvm.org/D20647 llvm-svn: 273440
* Widen EHScope::ClenupBitFields::FixupDepth to avoid overflowing it (PR23490)Hans Wennborg2016-06-221-9/+11
| | | | | | | | | | | | | | It currently only takes 2048 gotos to overflow the FixupDepth bitfield, causing silent miscompilation. Apparently some parser generators run into this (see PR). I don't know that that data structure is terribly size sensitive anyway, and since there's no room to widen the bitfield, let's just use a separate word in EHCatchScope for it. Differential Revision: http://reviews.llvm.org/D21566 llvm-svn: 273434
* [OpenCL] Use function metadata to represent kernel attributesYaxun Liu2016-06-221-30/+16
| | | | | | | | This patch uses function metadata to represent reqd_work_group_size, work_group_size_hint and vector_type_hint kernel attributes and kernel argument info. Differential Revision: http://reviews.llvm.org/D20979 llvm-svn: 273425
* [AVX512] Replace masked integer cmp and ucmp builtins with native IR.Craig Topper2016-06-221-7/+57
| | | | llvm-svn: 273378
* Emit the DWARF tag for the RenderScript languagePirama Arumuga Nainar2016-06-211-0/+2
| | | | | | | | | | | | | | Summary: If the RenderScript LangOpt is set, either via '-x renderscript' or the '.rs' file extension, set the DWARF language tag to be that of RenderScript. Reviewers: rsmith Subscribers: cfe-commits, srhines Differential Revision: http://reviews.llvm.org/D21451 llvm-svn: 273321
* Re-commit "[Temporary] Add an ExprWithCleanups for each C++ ↵Tim Shen2016-06-211-0/+6
| | | | | | | | | | MaterializeTemporaryExpr." Since D21243 fixes relative clang-tidy tests. This reverts commit a71d9fbd41e99def9159af2b01ef6509394eaeed. llvm-svn: 273312
* Revert "[MS] Don't expect vftables to be provided for extern template ↵Reid Kleckner2016-06-211-7/+3
| | | | | | | | instantiations" This reverts commit r273296, it broke the Windows self-host. llvm-svn: 273305
* Invoke PruneEH pass before Sample Profile pass.Dehao Chen2016-06-211-0/+1
| | | | | | | | | | | | Summary: We need to call PruneEH pass before AutoFDO pass so that some EH-related calls can get inlined in Sample Profile pass. Reviewers: davidxl, dnovillo Subscribers: junbuml, llvm-commits Differential Revision: http://reviews.llvm.org/D21197 llvm-svn: 273298
* [MS] Don't expect vftables to be provided for extern template instantiationsReid Kleckner2016-06-211-3/+7
| | | | | | | | | | | | | MSVC doesn't provide them. PR28223 I left behind the machinery in case we want to resurrect available_externally vftable emission to support devirtualization. Reviewers: majnemer Differential Revision: http://reviews.llvm.org/D21544 llvm-svn: 273296
* [CodeGen] Do not run initializers for imported variablesDavid Majnemer2016-06-211-0/+4
| | | | | | | | | | The export side is responsible for running any initializers, they are run when the module is first loaded. Attempting to run an initializer for the import side is not possible. This fixes PR28216. llvm-svn: 273237
* Remove MaxFunctionCount module flag annotation.Easwaran Raman2016-06-201-1/+0
| | | | | | Differential revision: http://reviews.llvm.org/D19184 llvm-svn: 273198
* Update for DiagnosticInfoStackSize changesMatt Arsenault2016-06-201-1/+2
| | | | llvm-svn: 273178
* [MS] Put member pointer representation flags in our debug infoReid Kleckner2016-06-171-5/+28
| | | | llvm-svn: 273063
* [Coverage] Adopt llvm::coverage::encodeFilenamesAndRawMappings (NFC)Vedant Kumar2016-06-171-18/+10
| | | | | | Use an llvm helper function to encode filenames and raw mappings. llvm-svn: 273056
* [CodeGen] Use pointer-sized integers for ptrtoint sourcesDavid Majnemer2016-06-171-1/+7
| | | | | | | | | | | | | | | | | Given something like: void *v = (void *)100; We need to synthesize a ptrtoint operation from 100. During constant emission, we choose i64 as the type for our constant because it guaranteed not to drop any bits from our CharUnits representation of the value. However, this is suboptimal for 32-bit targets: LLVM passes like GlobalOpt will get confused by these sorts of casts resulting in pessimization. Instead, make sure the ptrtoint operand has a pointer-sized integer type. llvm-svn: 273020
* [codeview] Stop emitting fully qualified subprogram display namesReid Kleckner2016-06-171-18/+12
| | | | | | | | This effectively reverts r255744, and leaves the printing option tweaks. We can add the name qualifiers easily in the backend. llvm-svn: 273008
* [X86][SSE4A] Use native IR for mask movntsd/movntss intrinsics.Simon Pilgrim2016-06-171-0/+20
| | | | | | Depends on llvm side commit r273002. llvm-svn: 273003
* [ARM] Add mrrc/mrrc2 intrinsics and update existing mcrr/mcrr2 intrinsics.Ranjeet Singh2016-06-171-0/+68
| | | | | | | | | | Reapplying patch in r272777 which was reverted because the llvm patch which added support for generating the mcrr/mcrr2 instructions from the intrinsic was causing an assertion failure. This has now been fixed in llvm. llvm-svn: 272983
* [CodeGen] Fix a segfault caused by pass_object_size.George Burgess IV2016-06-163-14/+16
| | | | | | | | | This patch fixes a bug where we'd segfault (in some cases) if we saw a variadic function with one or more pass_object_size arguments. Differential Revision: http://reviews.llvm.org/D17462 llvm-svn: 272971
* [DebugInfo] Put the vftable index in the debug infoReid Kleckner2016-06-161-8/+17
| | | | | | | This won't always be enough info to call a virtual method from the debugger, but it's a start. llvm-svn: 272944
* [x86] generate IR for AVX2 integer min/max builtinsSanjay Patel2016-06-161-5/+17
| | | | | | | Sibling patch to r272932: http://reviews.llvm.org/rL272932 llvm-svn: 272933
* Re-apply r272900 - [OpenMP] Cast captures by copy when passed to fork call ↵Samuel Antao2016-06-163-55/+43
| | | | | | | | so that they are compatible to what the runtime library expects. An issue in one of the regression tests was fixed for 32-bit hosts. llvm-svn: 272931
* Revert r272900 - [OpenMP] Cast captures by copy when passed to fork call so ↵Samuel Antao2016-06-163-43/+55
| | | | | | | | that they are compatible to what the runtime library expects. Was causing trouble in one of the regression tests for a 32-bit address space. llvm-svn: 272908
* [OpenMP] Cast captures by copy when passed to fork call so that they are ↵Samuel Antao2016-06-163-55/+43
| | | | | | | | | | | | | | | | | compatible to what the runtime library expects. Summary: This patch fixes an issue detected when firstprivate variables are passed to an OpenMP outlined function vararg list. Currently they are not compatible with what the runtime library expects causing malfunction in some targets. This patch fixes the issue by moving the casting logic already in place for offloading to the common code that creates the outline function and arguments and updates the regression tests accordingly. Reviewers: hfinkel, arpith-jacob, carlo.bertolli, kkwli0, ABataev Subscribers: cfe-commits, caomhin Differential Revision: http://reviews.llvm.org/D21150 llvm-svn: 272900
* [Builtin] Make __builtin_thread_pointer target-independent.Marcin Koscielnicki2016-06-161-0/+7
| | | | | | | | This is now supported for ARM, AArch64, PowerPC, SystemZ, SPARC, Mips. Differential Revision: http://reviews.llvm.org/D19589 llvm-svn: 272893
* [DebugInfo] Enable generation of unique identifiers for externally visible ↵Reid Kleckner2016-06-161-4/+0
| | | | | | | | MS ABI types We implemented the mangling for this a long time ago. llvm-svn: 272862
* Allow 'nodebug' on local variables.Paul Robinson2016-06-161-0/+4
| | | | | | | | | Parameters and non-static members of aggregates are still excluded, and probably should remain that way. Differential Revision: http://reviews.llvm.org/D19754 llvm-svn: 272859
* [x86] translate SSE packed FP comparison builtins to IRSanjay Patel2016-06-151-124/+74
| | | | | | | | | | | | | As noted in the code comment, a potential follow-on would be to remove the builtins themselves. Other than ord/unord, this already works as expected. Eg: typedef float v4sf __attribute__((__vector_size__(16))); v4sf fcmpgt(v4sf a, v4sf b) { return a > b; } Differential Revision: http://reviews.llvm.org/D21268 llvm-svn: 272840
* [x86] generate IR for SSE integer min/max builtinsSanjay Patel2016-06-151-0/+27
| | | | | | | Sibling patch to r272806: http://reviews.llvm.org/rL272806 llvm-svn: 272807
* Reverting r272777 because one of the testsRanjeet Singh2016-06-151-68/+0
| | | | | | | added in the llvm patch is causing an assertion to fail. llvm-svn: 272790
* [AVX512] Use native IR for mask pcmpeq/pcmpgt intrinsics.Craig Topper2016-06-151-0/+49
| | | | llvm-svn: 272787
* [ARM] Add mrrc/mrrc2 intrinsics and update existing mcrr/mcrr2 intrinsics.Ranjeet Singh2016-06-151-0/+68
| | | | | | | | | | | | | | Patch adds intrinsics for mrrc/mrrc2. The intrinsics for mrrc/mrrc2 return a single uint64_t to represent two 32 bit values. The mcrr/mcrr2 intrinsic was changed to accept a single uint64_t instead of two 32 bit values as the input for consistency. Differential Revision: http://reviews.llvm.org/D21179 llvm-svn: 272777
* Revert accidential "[MSVC] Late parsing of in-class defined member functions ↵Alexey Bataev2016-06-151-1/+0
| | | | | | | | in template" This reverts commit 0253605771b8bd9d414aba74fe2742c730d6fd1a. llvm-svn: 272776
* [MSVC] Late parsing of in-class defined member functions in templateAlexey Bataev2016-06-151-0/+1
| | | | | | | | | | | | | | | | | | | classes. MSVC actively uses unqualified lookup in dependent bases, lookup at the instantiation point (non-dependent names may be resolved on things declared later) etc. and all this stuff is the main cause of incompatibility between clang and MSVC. Clang tries to emulate MSVC behavior but it may fail in many cases. clang could store lexed tokens for member functions definitions within ClassTemplateDecl for later parsing during template instantiation. It will allow resolving many possible issues with lookup in dependent base classes and removing many already existing MSVC-specific hacks/workarounds from the clang code. llvm-svn: 272774
* Update clang for D20348Peter Collingbourne2016-06-148-27/+27
| | | | | | Differential Revision: http://reviews.llvm.org/D20339 llvm-svn: 272710
* Add loop pragma for Loop DistributionAdam Nemet2016-06-142-1/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This is similar to other loop pragmas like 'vectorize'. Currently it only has state values: distribute(enable) and distribute(disable). When one of these is specified the corresponding loop metadata is generated: !{!"llvm.loop.distribute.enable", i1 true/false} As a result, loop distribution will be attempted on the loop even if Loop Distribution in not enabled globally. Analogously, with 'disable' distribution can be turned off for an individual loop even when the pass is otherwise enabled. There are some slight differences compared to the existing loop pragmas. 1. There is no 'assume_safety' variant which makes its handling slightly different from 'vectorize'/'interleave'. 2. Unlike the existing loop pragmas, it does not have a corresponding numeric pragma like 'vectorize' -> 'vectorize_width'. So for the consistency checks in CheckForIncompatibleAttributes we don't need to check it against other pragmas. We just need to check for duplicates of the same pragma. Reviewers: rsmith, dexonsmith, aaron.ballman Subscribers: bob.wilson, cfe-commits, hfinkel Differential Revision: http://reviews.llvm.org/D19403 llvm-svn: 272656
* Remove nonsense and simplify. To forward a reference, we always just load theRichard Smith2016-06-141-14/+6
| | | | | | | | | | | pointer-to-pointer representing the parameter. An aggregate rvalue representing a pointer does not make sense. We got away with this weirdness because CGCall happens to blindly load an RValue in aggregate form in this case, without checking whether an RValue for the type should be in scalar or aggregate form. llvm-svn: 272609
* Fix unused variable warningSimon Pilgrim2016-06-131-51/+50
| | | | llvm-svn: 272541
* [Clang][X86] Convert non-temporal store builtins to generic ↵Simon Pilgrim2016-06-131-63/+51
| | | | | | | | | | | | | | __builtin_nontemporal_store in headers We can now use __builtin_nontemporal_store instead of target specific builtins for naturally aligned nontemporal stores which avoids the need for handling in CGBuiltin.cpp The scalar integer nontemporal (unaligned) store builtins will have to wait as __builtin_nontemporal_store currently assumes natural alignment and doesn't accept the 'packed struct' trick that we use for normal unaligned load/stores. The nontemporal loads require further backend support before we can safely convert them to __builtin_nontemporal_load Differential Revision: http://reviews.llvm.org/D21272 llvm-svn: 272540
* [CodeGen] Update to use an ArrayRef of uint32_t instead of int in calls to ↵Craig Topper2016-06-121-10/+10
| | | | | | CreateShuffleVector to match llvm interface change. llvm-svn: 272492
* Remove a few gendered pronouns.Nico Weber2016-06-101-1/+1
| | | | llvm-svn: 272415
* Remove CXXConstructExpr::getFoundDecl(); it turned out to not be useful.Richard Smith2016-06-101-1/+0
| | | | llvm-svn: 272357
* Revert "[Temporary] Add an ExprWithCleanups for each C++ ↵Tim Shen2016-06-091-6/+0
| | | | | | | | | MaterializeTemporaryExpr." This reverts r272296, since there are clang-tidy failures that appear to be caused by this change. llvm-svn: 272310
OpenPOWER on IntegriCloud