summaryrefslogtreecommitdiffstats
path: root/llvm
Commit message (Collapse)AuthorAgeFilesLines
...
* [ConstantFolding] Fold masked loadsDavid Majnemer2016-07-142-1/+47
| | | | | | | | | We can constant fold a masked load if the operands are appropriately constant. Differential Revision: http://reviews.llvm.org/D22324 llvm-svn: 275352
* Force a semicolon at the end of the LLVM_ENABLE_BITMASK_ENUMS_IN_NAMESPACE() ↵Justin Lebar2016-07-131-1/+2
| | | | | | | | macro. This silences a warning about an extra semicolon on gcc. llvm-svn: 275349
* Add EnableIPRA to TargetOptions, and move the cl::opt -enable-ipra to ↵Mehdi Amini2016-07-135-13/+17
| | | | | | | | | | | | TargetMachine.cpp Avoid exposing a cl::opt in a public header and instead promote this option in the API. Alternatively, we could land the cl::opt in CommandFlags.h so that it is available to every tool, but we would still have to find an option for clang. llvm-svn: 275348
* [IPRA] Set callee saved registers to none for local function when IPRA is ↵Mehdi Amini2016-07-135-10/+46
| | | | | | | | | | | | | | | | | | | | enabled. IPRA try to optimize caller saved register by propagating register usage information from callee to caller so it is beneficial to have caller saved registers compare to callee saved registers when IPRA is enabled. Please find more detailed explanation here https://groups.google.com/d/msg/llvm-dev/XRzGhJ9wtZg/tjAJqb0eEgAJ. This change makes local function do not have any callee preserved register when IPRA is enabled. A simple test case is also added to verify this change. Patch by Vivek Pandya <vivekvpandya@gmail.com> Differential Revision: http://reviews.llvm.org/D21561 llvm-svn: 275347
* [JumpThreading] Delete commented out debug code; NFCSanjoy Das2016-07-131-3/+0
| | | | llvm-svn: 275346
* [ConstantFolding] Extend FoldReinterpretLoadFromConstPtr to handle negative ↵David Majnemer2016-07-132-10/+28
| | | | | | | | | offsets Treat loads which clip before the start of a global initializer the same way we treat clipping beyond the end of the initializer: use zeros. llvm-svn: 275345
* Move a transform from InstCombine to InstSimplify.David Majnemer2016-07-132-4/+9
| | | | | | | This transform doesn't require any new instructions, it can safely live in InstSimplify. llvm-svn: 275344
* Fix copy/paste bug in r275340.Michael Kuperstein2016-07-131-1/+1
| | | | llvm-svn: 275343
* MIRParser: Move SlotMapping and SourceMgr refs to PFS; NFCMatthias Braun2016-07-133-88/+69
| | | | | | | | Code cleanup: Move references to SlotMapping and SourceMgr into the PerFunctionMIParsingState to avoid unnecessary passing around in parameters. llvm-svn: 275342
* [DAG] Correctly chain masked loadsMichael Kuperstein2016-07-132-9/+24
| | | | | | | | | If a masked loads is not added to the chain, it should not reset the chain's root. This fixes the remaining part of PR28515. llvm-svn: 275340
* [SCCP] Have the logic for replacing insts with constant in a single place.Davide Italiano2016-07-131-53/+50
| | | | | | | | | The code was pretty much copy-pasted between SCCP and IPSCCP. The situation became clearly worse after I introduced the support for folding structs in SCCP. This commit is NFC as we currently (still) skip the replacement step in IPSCCP, but I'll change this soon. llvm-svn: 275339
* [Coverage] Return an ArrayRef to avoid copies (NFC)Vedant Kumar2016-07-131-1/+1
| | | | llvm-svn: 275338
* [Coverage] Mark a few methods const (NFC)Vedant Kumar2016-07-132-3/+3
| | | | llvm-svn: 275337
* [LAA] Don't hold on to DominatorTree in the analysis resultAdam Nemet2016-07-132-8/+7
| | | | llvm-svn: 275335
* [LAA] Don't hold on to TargetLibraryInfo in the analysis resultAdam Nemet2016-07-132-10/+9
| | | | llvm-svn: 275334
* [MIR] Fix one GlobalISel test case that I missed in r275314.Quentin Colombet2016-07-131-3/+2
| | | | llvm-svn: 275333
* [MI] Clean up some loops over MachineInstr::memoperands(). NFCJustin Lebar2016-07-131-14/+11
| | | | | | | Use range-based for loops and llvm::any_of instead of explicit iterators. llvm-svn: 275332
* [MI] Fix MachineInstr::isInvariantLoad.Justin Lebar2016-07-131-2/+1
| | | | | | | | | | | | | | | | | | | | Summary: Previously it would say we had an invariant load if any of the memory operands were invariant. But the load should be invariant only if *all* the memory operands are invariant. No testcase because this has proven to be very difficult to tickle in practice. As just one example, ARM's ldrd instruction, which loads 64 bits into two 32-bit regs, is theoretically affected by this. But when it's produced, it loses its memoperands' invariance bits! Reviewers: jfb Subscribers: llvm-commits, aemerson Differential Revision: http://reviews.llvm.org/D22318 llvm-svn: 275331
* MIRParser: Move MachineFunction reference into PFS; NFCMatthias Braun2016-07-133-141/+132
| | | | | | | | | | Code cleanup: The PerFunctionMIParsingState is per function, moving a reference into PFS we can avoid passing around the MachineFunction in an extra parameter most of the time. Also change most signatures to consistently pass PFS reference first. llvm-svn: 275329
* MIRYamlMapping: Update stale commentMatthias Braun2016-07-131-3/+0
| | | | llvm-svn: 275328
* Add a triple to fix test on bots after 275320.Nico Weber2016-07-131-1/+1
| | | | llvm-svn: 275327
* [LAA] Don't hold on to DataLayout in the analysis resultAdam Nemet2016-07-132-17/+11
| | | | | | | In fact, don't even pass this to the ctor since we can get it from the module. llvm-svn: 275326
* [LAA] Don't hold on to LoopInfo in the analysis resultAdam Nemet2016-07-132-7/+5
| | | | llvm-svn: 275325
* [LAA] Don't hold on to AliasAnalysis in the analysis resultAdam Nemet2016-07-132-9/+7
| | | | llvm-svn: 275322
* [llvm-cov] Use a thread pool to speed up report generation (NFC)Vedant Kumar2016-07-131-24/+75
| | | | | | | | | | | | | | It's safe to print out source coverage views using multiple threads when using the -output-dir mode of the `llvm-cov show` sub-command. While testing this on my development machine, I observed that the speed up is roughly linear with the number of available cores. Avg. time for `llvm-cov show ./llvm-as -show-line-counts-or-regions`: 1 thread: 7.79s user 0.33s system 98% cpu 8.228 total 4 threads: 7.82s user 0.34s system 283% cpu 2.880 total llvm-svn: 275321
* Fix a TODO in X86CallFrameOptimization to not rely on a codegen artifact.Nico Weber2016-07-132-16/+16
| | | | | | | | | This happens to make X86CallFrameOptimization in -O0 / FastISel builds as well, but it's not clear if the pass should run in that setup. http://reviews.llvm.org/D22314 llvm-svn: 275320
* Mark the textual headers in the module map for ProfileDataTeresa Johnson2016-07-131-0/+2
| | | | | | Follow on to r275312. llvm-svn: 275319
* Extended LoadStoreVectorizer to vectorize subchains.Alina Sbirlea2016-07-132-71/+121
| | | | | | | | | | | | | | Summary: LSV used to abort vectorizing a chain for interleaved load/store accesses that alias. Allow a valid prefix of the chain to be vectorized, mark just the prefix and retry vectorizing the remaining chain. Reviewers: llvm-commits, jlebar, arsenm Subscribers: mzolotukhin Differential Revision: http://reviews.llvm.org/D22119 llvm-svn: 275317
* [Object] Change Archive::child_iterator for better interop with Error/Expected.Lang Hames2016-07-1315-197/+236
| | | | | | | | | | | | | | | | | | | | | | | See http://reviews.llvm.org/D22079 Changes the Archive::child_begin and Archive::children to require a reference to an Error. If iterator increment fails (because the archive header is damaged) the iterator will be set to 'end()', and the error stored in the given Error&. The Error value should be checked by the user immediately after the loop. E.g.: Error Err; for (auto &C : A->children(Err)) { // Do something with archive child C. } // Check the error immediately after the loop. if (Err) return Err; Failure to check the Error will result in an abort() when the Error goes out of scope (as guaranteed by the Error class). llvm-svn: 275316
* [MIR] Print on the given output instead of stderr.Quentin Colombet2016-07-13100-107/+107
| | | | | | | | | | | | Currently the MIR framework prints all its outputs (errors and actual representation) on stderr. This patch fixes that by printing the regular output in the output specified with -o. Differential Revision: http://reviews.llvm.org/D22251 llvm-svn: 275314
* Define a module map entry for ProfileData.Teresa Johnson2016-07-131-0/+8
| | | | | | | | As per Richard Smith, this should help avoid a modules bug exposed by my r275216 commit: http://lab.llvm.org:8011/builders/clang-x86_64-linux-selfhost-modules/builds/17560 llvm-svn: 275312
* AMDGPU: Remove last AMDIL intrinsicsMatt Arsenault2016-07-133-23/+2
| | | | llvm-svn: 275309
* [SCCP] Factor out common code.Davide Italiano2016-07-131-8/+9
| | | | llvm-svn: 275308
* [SCCP] Use early return. NFCI.Davide Italiano2016-07-131-5/+5
| | | | llvm-svn: 275307
* Reverting r275284 due to platform-specific test failuresAndrew Kaylor2016-07-1310-103/+1
| | | | llvm-svn: 275304
* add more tests for zexty xor sandwichesSanjay Patel2016-07-132-0/+39
| | | | | | ...mmm sandwiches llvm-svn: 275302
* [X86][SSE] Regenerate truncated shift testSimon Pilgrim2016-07-131-6/+20
| | | | | | Check SSE2 and AVX2 implementations llvm-svn: 275300
* Regenerate testSimon Pilgrim2016-07-131-2/+2
| | | | llvm-svn: 275299
* add test for zexty xor sandwichSanjay Patel2016-07-131-0/+14
| | | | llvm-svn: 275297
* Fix header comment in unittests/CodeGen/DIEHashTest.cpp.Justin Lebar2016-07-131-1/+1
| | | | llvm-svn: 275296
* Move mempcpy_call.ll to X86 subdirectoryKrzysztof Parzyszek2016-07-131-0/+0
| | | | llvm-svn: 275294
* Fix warning in ObjectTransformLayerTest.Justin Lebar2016-07-131-1/+2
| | | | | | | | | | | | | | Doing "I++" inside of an EXPECT_* triggers warning: expression with side effects has no effect in an unevaluated context because EXPECT_* partially expands to EqHelper<(sizeof(::testing::internal::IsNullLiteralHelper(MockObjects[I++] + 1)) == 1)> which is an unevaluated context. llvm-svn: 275293
* [ADT] Add LLVM_MARK_AS_BITMASK_ENUM, used to enable bitwise operations on ↵Justin Lebar2016-07-133-0/+287
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | enums without static_cast. Summary: Normally when you do a bitwise operation on an enum value, you get back an instance of the underlying type (e.g. int). But using this macro, bitwise ops on your enum will return you back instances of the enum. This is particularly useful for enums which represent a combination of flags. Suppose you have a function which takes an int and a set of flags. One way to do this would be to take two numeric params: enum SomeFlags { F1 = 1, F2 = 2, F3 = 4, ... }; void Fn(int Num, int Flags); void foo() { Fn(42, F2 | F3); } But now if you get the order of arguments wrong, you won't get an error. You might try to fix this by changing the signature of Fn so it accepts a SomeFlags arg: enum SomeFlags { F1 = 1, F2 = 2, F3 = 4, ... }; void Fn(int Num, SomeFlags Flags); void foo() { Fn(42, static_cast<SomeFlags>(F2 | F3)); } But now we need a static cast after doing "F2 | F3" because the result of that computation is the enum's underlying type. This patch adds a mechanism which gives us the safety of the second approach with the brevity of the first. enum SomeFlags { F1 = 1, F2 = 2, F3 = 4, ..., F_MAX = 128, LLVM_MARK_AS_BITMASK_ENUM(F_MAX) }; void Fn(int Num, SomeFlags Flags); void foo() { Fn(42, F2 | F3); // No static_cast. } The LLVM_MARK_AS_BITMASK_ENUM macro enables overloads for bitwise operators on SomeFlags. Critically, these operators return the enum type, not its underlying type, so you don't need any static_casts. An advantage of this solution over the previously-proposed BitMask class [0, 1] is that we don't need any wrapper classes -- we can operate directly on the enum itself. The approach here is somewhat similar to OpenOffice's typed_flags_set [2]. But we skirt the need for a wrapper class (and a good deal of complexity) by judicious use of enable_if. We SFINAE on the presence of a particular enumerator (added by the LLVM_MARK_AS_BITMASK_ENUM macro) instead of using a traits class so that it's impossible to use the enum before the overloads are present. The solution here also seamlessly works across multiple namespaces. [0] http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20150622/283369.html [1] http://lists.llvm.org/pipermail/llvm-commits/attachments/20150623/073434b6/attachment.obj [2] https://cgit.freedesktop.org/libreoffice/core/tree/include/o3tl/typed_flags_set.hxx Reviewers: chandlerc, rsmith Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D22279 llvm-svn: 275292
* Fix warnings in FunctionTest.cpp.Justin Lebar2016-07-131-6/+12
| | | | | | | | | | | | | Because of the goop involved in the EXPECT_EQ macro, we were getting the following warning expression with side effects has no effect in an unevaluated context because the "I++" was being used inside of a template type: switch (0) case 0: default: if (const ::testing::AssertionResult gtest_ar = (::testing::internal:: EqHelper<(sizeof(::testing::internal::IsNullLiteralHelper(Args[I++])) == 1)>::Compare("Args[I++]", "&A", Args[I++], &A))) ; else ::testing::internal::AssertHelper(::testing::TestPartResult::kNonFatalFailure, "../src/unittests/IR/FunctionTest.cpp", 94, gtest_ar.failure_message()) = ::testing::Message(); llvm-svn: 275291
* [InstCombine] extend vector select matching for non-splat constantsSanjay Patel2016-07-132-18/+68
| | | | | | | | | | | | | | | In D21740, we discussed trying to make this a more general matcher. However, I didn't see a clean way to handle the regular m_Not cases and these non-splat vector patterns, so I've opted for the direct approach here. If there are other potential uses of areInverseVectorBitmasks(), we could move that helper function to a higher level. There is an open question as to which is of these forms should be considered the canonical IR: %sel = select <4 x i1> <i1 true, i1 false, i1 false, i1 true>, <4 x i32> %a, <4 x i32> %b %shuf = shufflevector <4 x i32> %a, <4 x i32> %b, <4 x i32> <i32 0, i32 5, i32 6, i32 3> Differential Revision: http://reviews.llvm.org/D22114 llvm-svn: 275289
* AMDGPU/SI: Emit the number of SGPR and VGPR spillsMarek Olsak2016-07-135-0/+30
| | | | | | | | | | | | | | | | | | | | | Summary: v2: don't count SGPRs spilled to scratch twice I think this is sufficient. It doesn't count private memory usage, which happens often and uses scratch but isn't technically a spill. The private memory usage can be computed by: [scratch_per_thread - vgpr_spills - a random multiple of SGPR spills]. The fact SGPR spills add very high numbers to the scratch size make that computation a guessing game, but I don't have a solution to that. Reviewers: tstellarAMD Subscribers: arsenm, kzhuravl Differential Revision: http://reviews.llvm.org/D22197 llvm-svn: 275288
* Fix for Bug 26903, adds support to inline __builtin_mempcpyAndrew Kaylor2016-07-1310-1/+103
| | | | | | | | Patch by Sunita Marathe Differential Revision: http://reviews.llvm.org/D21920 llvm-svn: 275284
* PR28516: Fix LangRef description of call and invoke to match IR changes for ↵David Blaikie2016-07-131-14/+16
| | | | | | typeless pointers llvm-svn: 275283
* PatchableFunction: Skip pseudos that do not create codeMatthias Braun2016-07-132-5/+47
| | | | | | This fixes http://llvm.org/PR28524 llvm-svn: 275278
* [ThinLTO/gold] Enable symbol resolution in distributed backend caseTeresa Johnson2016-07-132-7/+0
| | | | | | | | | | | | | | | | While testing a follow-on change to enable index-based symbol resolution and internalization in the distributed backends, I realized that a test case change I made in r275247 was only required because we were not analyzing symbols in the claimed files in thinlto-index-only mode. In the fixed test case there should be no internalization because we are linking in -shared mode, so f() is in fact exported, which is detected properly when we analyze symbols in thinlto-index-only mode. Note that this is not (yet) a correctness issue (because we are not yet performing the index-based linkage optimizations in the distributed backends - that's coming in a follow-on patch). llvm-svn: 275277
OpenPOWER on IntegriCloud