summaryrefslogtreecommitdiffstats
path: root/llvm/lib
Commit message (Collapse)AuthorAgeFilesLines
* [CompactUnwind] Fix register encoding logicBruno Cardoso Lopes2014-12-081-1/+1
| | | | | | | | | | | | Fix a compact unwind encoding logic bug which would try to encode more callee saved registers than it should, leading to early bail out in the encoding logic and abusive use of DWARF frame mode unnecessarily. Also remove no-compact-unwind.ll which was testing the wrong thing based on this bug and move it to valid 'compact unwind' tests. Added other few more tests too. llvm-svn: 223676
* Don't crash when the key of a comdat is lazily linked.Rafael Espindola2014-12-081-0/+9
| | | | llvm-svn: 223673
* InstrProf: An intrinsic and lowering for instrumentation based profilingJustin Bogner2014-12-084-0/+313
| | | | | | | | | | | | | | | | | | | | | Introduce the ``llvm.instrprof_increment`` intrinsic and the ``-instrprof`` pass. These provide the infrastructure for writing counters for profiling, as in clang's ``-fprofile-instr-generate``. The implementation of the instrprof pass is ported directly out of the CodeGenPGO classes in clang, and with the followup in clang that rips that code out to use these new intrinsics this ends up being NFC. Doing the instrumentation this way opens some doors in terms of improving the counter performance. For example, this will make it simple to experiment with alternate lowering strategies, and allows us to try handling profiling specially in some optimizations if we want to. Finally, this drastically simplifies the frontend and puts all of the lowering logic in one place. llvm-svn: 223672
* AArch64: treat HFAs containing "half" types as blocks too.Tim Northover2014-12-081-0/+5
| | | | llvm-svn: 223669
* [X86] Improved tablegen patters for matching TZCNT/LZCNT.Andrea Di Biagio2014-12-081-24/+29
| | | | | | | | | | | Teach ISel how to match a TZCNT/LZCNT from a conditional move if the condition code is X86_COND_NE. Existing tablegen patterns only allowed to match TZCNT/LZCNT from a X86cond with condition code equal to X86_COND_E. To avoid introducing extra rules, I added an 'ImmLeaf' definition that checks if the condition code is COND_E or COND_NE. llvm-svn: 223668
* [Hexagon] Adding combine reg, reg with predicated forms.Colin LeMahieu2014-12-081-0/+7
| | | | llvm-svn: 223667
* [Hexagon] Adding packhl instruction.Colin LeMahieu2014-12-081-0/+6
| | | | llvm-svn: 223664
* [mips] Add Mips-specific CCIf's for accessing the MipsCCState. NFC.Daniel Sanders2014-12-081-13/+28
| | | | | | | | | | | | Reviewers: vmedic Reviewed By: vmedic Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D6213 llvm-svn: 223662
* [X86] Improved lowering of packed v8i16 vector shifts by non-constant count.Andrea Di Biagio2014-12-081-10/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before this patch, the backend sub-optimally expanded the non-constant shift count of a v8i16 shift into a sequence of two 'movd' plus 'movzwl'. With this patch the backend checks if the target features sse4.1. If so, then it lets the shuffle legalizer deal with the expansion of the shift amount. Example: ;; define <8 x i16> @test(<8 x i16> %A, <8 x i16> %B) { %shamt = shufflevector <8 x i16> %B, <8 x i16> undef, <8 x i32> zeroinitializer %shl = shl <8 x i16> %A, %shamt ret <8 x i16> %shl } ;; Before (with -mattr=+avx): vmovd %xmm1, %eax movzwl %ax, %eax vmovd %eax, %xmm1 vpsllw %xmm1, %xmm0, %xmm0 retq Now: vpxor %xmm2, %xmm2, %xmm2 vpblendw $1, %xmm1, %xmm2, %xmm1 vpsllw %xmm1, %xmm0, %xmm0 retq llvm-svn: 223660
* Move the ValueMap lookup inside linkFunctionBody. NFC.Rafael Espindola2014-12-081-16/+15
| | | | llvm-svn: 223659
* Use range loops. NFC.Rafael Espindola2014-12-081-10/+9
| | | | llvm-svn: 223658
* Use range loops. NFC.Rafael Espindola2014-12-081-12/+10
| | | | llvm-svn: 223657
* Fix linking of prologue data.Rafael Espindola2014-12-081-18/+11
| | | | | | It would crash when the function was lazy linked. llvm-svn: 223656
* Simple style fixes.Rafael Espindola2014-12-081-14/+15
| | | | | | | | * Use a range loop. * Move simple continue checks earlier. * clang-format. llvm-svn: 223654
* Move materialize/Dematerialize calls to linkFunctionBody. NFC.Rafael Espindola2014-12-081-15/+12
| | | | | | Just less code duplication. llvm-svn: 223653
* X86 intrinsics moved form X86ISelLowering.cpp to X86IntrinsicsInfo.hElena Demikhovsky2014-12-082-133/+48
| | | | | | | | X86ISelLowering.cpp has a long switch for intrinsics. I moved a part of this long switch to the new intrinsics table in X86IntrinsicsInfo.h. No functional changes, just code and compile time optimization. llvm-svn: 223641
* Revert a part of r223583, for now. It seems causing different emission ↵NAKAMURA Takumi2014-12-081-5/+0
| | | | | | between stage2(gcc-clang) and stage3 clang. Investigating. llvm-svn: 223624
* IR: Revert r223618 behaviour of MDNode::concatenate()Duncan P. N. Exon Smith2014-12-071-12/+23
| | | | | | | | | | | | | r223618 including special handling of `MDNode::intersect()`: if the first operand is a self-reference with the same operands you're trying to return, return it instead. Reuse that handling in `MDNode::concatenate()` in the hopes that it fixes a polly test that seems to rely on the old behaviour [1]. [1]: http://lab.llvm.org:8011/builders/polly-amd64-linux/builds/25167 llvm-svn: 223619
* IR: Drop uniquing for self-referencing MDNodesDuncan P. N. Exon Smith2014-12-071-1/+15
| | | | | | | | | | | | | | | It doesn't make sense to unique self-referencing nodes. Drop uniquing for them. Note that `MDNode::intersect()` occasionally returns self-referencing nodes. Previously these would be returned by `MDNode::get()`. I'm not convinced this was intended behaviour -- to me it seems it should return a node whose only operand is the self-reference -- but I don't know much about alias scopes so I'm preserving it for now. This is part of PR21532. llvm-svn: 223618
* IR: Add missing tests for function-local metadataDuncan P. N. Exon Smith2014-12-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | Add assembly and bitcode tests that I neglected to add in r223564 (IR: Disallow complicated function-local metadata) and r223574 (IR: Disallow function-local metadata attachments). Found a couple of bugs: - The error message for function-local attachments gave the wrong line number -- it indicated the next token (typically on the next line) instead of the token that started the attachment. Fixed. - Metadata arguments of the form `!{i32 0, i32 %v}` (or with the arguments reversed) fired an assertion in `ValueEnumerator` in LLVM v3.5, so I suppose this never really worked. I suppose this was "fixed" by r223564. (Thanks to dblaikie for pointing out my omission.) Part of PR21532. llvm-svn: 223616
* R600/SI: Disable VMEM and SMEM clauses by breaking them with S_NOPMarek Olsak2014-12-071-8/+46
| | | | | | This is only a workaround. llvm-svn: 223615
* R600/SI: Set 20-bit immediate byte offset for SMRD on VIMarek Olsak2014-12-076-20/+85
| | | | llvm-svn: 223614
* R600/SI: Update instruction conversions for VIMarek Olsak2014-12-073-1/+48
| | | | | | | | | There are 3 changes: - Convert 32-bit S_LSHL/LSHR/ASHR to their V_*REV variants for VI - Lower RSQ_CLAMP for VI - Don't generate MIN/MAX_LEGACY on VI llvm-svn: 223604
* R600/SI: Add VI instructionsMarek Olsak2014-12-0712-651/+1439
| | | | llvm-svn: 223603
* R600/SI: Add SCC Defs/Uses to SOP1 and SOP2 opcodesMarek Olsak2014-12-071-28/+49
| | | | llvm-svn: 223602
* Turn some DenseMaps that are only used for set operations into DenseSets.Benjamin Kramer2014-12-063-17/+14
| | | | | | DenseSet has better memory efficiency now. llvm-svn: 223589
* Make the DenseMap bucket type configurable and use a smaller bucket for ↵Benjamin Kramer2014-12-061-1/+1
| | | | | | | | | | | | | | DenseSet. DenseSet used to be implemented as DenseMap<Key, char>, which usually doubled the memory footprint of the map. Now we use a compressed set so the second element uses no memory at all. This required some surgery on DenseMap as all accesses to the bucket now have to go through methods; this should have no impact on the behavior of DenseMap though. The new default bucket type for DenseMap is a slightly extended std::pair as we expose it through DenseMap's iterator and don't want to break any existing users. llvm-svn: 223588
* Reapply "LLVMContext: Store APInt/APFloat directly into the ConstantInt/FP ↵Benjamin Kramer2014-12-062-49/+30
| | | | | | | | DenseMaps." This reapplies r223478 with a fix for 32 bit targets. llvm-svn: 223586
* ConstantFold: Don't optimize comparisons with weak linkage objectsDavid Majnemer2014-12-061-1/+4
| | | | | | | | | | | | Consider: void f() {} void __attribute__((weak)) g() {} bool b = &f != &g; It's possble for g to resolve to f if --defsym=g=f is passed on to the linker. llvm-svn: 223585
* I didn't intend to commit this change.David Majnemer2014-12-061-1/+1
| | | | llvm-svn: 223584
* InstSimplify: Optimize away useless unsigned comparisonsDavid Majnemer2014-12-062-1/+50
| | | | | | Code like X < Y && Y == 0 should always be folded away to false. llvm-svn: 223583
* Reformat.NAKAMURA Takumi2014-12-062-29/+21
| | | | llvm-svn: 223580
* R600/SI: Restore PrivateGlobalPrefix to the default ELF value of ".L"Tom Stellard2014-12-061-1/+0
| | | | | | This was changed in r223323. llvm-svn: 223579
* IR: Disallow function-local metadata attachmentsDuncan P. N. Exon Smith2014-12-063-2/+12
| | | | | | | | Metadata attachments to instructions cannot be function-local. This is part of PR21532. llvm-svn: 223574
* LLVMInstrumentation requires MC since r223532.NAKAMURA Takumi2014-12-061-1/+1
| | | | llvm-svn: 223573
* [X86] Refactor PMOV[SZ]Xrm to add missing AVX2 patterns.Ahmed Bougacha2014-12-062-531/+226
| | | | | | | | Most patterns will go away once the extload legalization changes land. Differential Revision: http://reviews.llvm.org/D6125 llvm-svn: 223567
* SelectionDAG switch lowering: Replace unreachable default with most popular ↵Hans Wennborg2014-12-061-17/+40
| | | | | | | | | | | | | | | | | | case. This can significantly reduce the size of the switch, allowing for more efficient lowering. I also worked with the idea of exploiting unreachable defaults by omitting the range check for jump tables, but always ended up with a non-neglible binary size increase. It might be worth looking into some more. SimplifyCFG currently does this transformation, but I'm working towards changing that so we can optimize harder based on unreachable defaults. Differential Revision: http://reviews.llvm.org/D6510 llvm-svn: 223566
* IR: Disallow complicated function-local metadataDuncan P. N. Exon Smith2014-12-063-54/+70
| | | | | | | | | | Disallow complex types of function-local metadata. The only valid function-local metadata is an `MDNode` whose sole argument is a non-metadata function-local value. Part of PR21532. llvm-svn: 223564
* Utils: Style cleanups, NFCDuncan P. N. Exon Smith2014-12-061-7/+7
| | | | llvm-svn: 223556
* Utils: Avoid RAUW on metadata in CloneFunction()Duncan P. N. Exon Smith2014-12-061-4/+4
| | | | llvm-svn: 223555
* Canonicalize multiplies by looking at whether the operands have any ↵Nick Lewycky2014-12-061-5/+26
| | | | | | constants themselves. Patch by Tim Murray! llvm-svn: 223554
* AArch64: use explicit MVT::i64 when creating EXTRACT_SUBVECTOR nodes.Tim Northover2014-12-061-10/+12
| | | | | | | | | All our patterns use MVT::i64, but the ISelLowering nodes were inconsistent in their choice. No functional change. llvm-svn: 223551
* Revert "LLVMContext: Store APInt/APFloat directly into the ConstantInt/FP ↵Benjamin Kramer2014-12-062-24/+56
| | | | | | | | | DenseMaps." Somehow made DenseMap probe on forever on 32 bit machines. This reverts commit r223478. llvm-svn: 223546
* [X86] Cleanup FCOPYSIGN lowering. NFC intended.Ahmed Bougacha2014-12-051-29/+15
| | | | llvm-svn: 223542
* Recommit of r223513 and r223514.Kuba Brecka2014-12-051-34/+48
| | | | | | Reviewed at http://reviews.llvm.org/D6488 llvm-svn: 223532
* [Hexagon] Relocating logical instructions and templates later in the td file.Colin LeMahieu2014-12-051-116/+115
| | | | llvm-svn: 223523
* [Hexagon] Adding sub/and/or reg, imm formsColin LeMahieu2014-12-051-29/+56
| | | | llvm-svn: 223522
* Remove dead code. We are only lazy about functions with bodies.Rafael Espindola2014-12-051-7/+1
| | | | llvm-svn: 223521
* Reverting r223513 and r223514.Kuba Brecka2014-12-051-48/+34
| | | | llvm-svn: 223520
* Optimize merging of scalar loads for 32-byte vectors [X86, AVX]Sanjay Patel2014-12-051-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix the poor codegen seen in PR21710 ( http://llvm.org/bugs/show_bug.cgi?id=21710 ). Before we crack 32-byte build vectors into smaller chunks (and then subsequently glue them back together), we should look for the easy case where we can just load all elements in a single op. An example of the codegen change is: From: vmovss 16(%rdi), %xmm1 vmovups (%rdi), %xmm0 vinsertps $16, 20(%rdi), %xmm1, %xmm1 vinsertps $32, 24(%rdi), %xmm1, %xmm1 vinsertps $48, 28(%rdi), %xmm1, %xmm1 vinsertf128 $1, %xmm1, %ymm0, %ymm0 retq To: vmovups (%rdi), %ymm0 retq Differential Revision: http://reviews.llvm.org/D6536 llvm-svn: 223518
OpenPOWER on IntegriCloud