summaryrefslogtreecommitdiffstats
path: root/llvm/lib
Commit message (Collapse)AuthorAgeFilesLines
* At the beginning of doFinalization set the MachineFunction toEric Christopher2015-03-201-0/+5
| | | | | | | | nullptr so that users get an earlier dereferencing error and so that we can use it to conditionalize access to MachineFunction specific data. llvm-svn: 232820
* Typo.Chad Rosier2015-03-201-1/+1
| | | | llvm-svn: 232819
* R600/SI: Refactor VOP2 instruction defsTom Stellard2015-03-201-6/+13
| | | | llvm-svn: 232817
* R600/SI: Refactor VOP1 instruction defsTom Stellard2015-03-201-7/+12
| | | | llvm-svn: 232816
* Reduce indentation after return. NFC.Rafael Espindola2015-03-201-138/+125
| | | | llvm-svn: 232814
* Use early returns. NFC.Rafael Espindola2015-03-201-104/+50
| | | | llvm-svn: 232813
* Fold a llvm_unreachable into an assert. NFC.Rafael Espindola2015-03-201-3/+3
| | | | llvm-svn: 232811
* clang-format a function. NFC.Rafael Espindola2015-03-201-12/+32
| | | | llvm-svn: 232810
* [MBP] Don't outline short optional branchesDaniel Jasper2015-03-201-2/+25
| | | | | | | | | | | | | | | | | | With the option -outline-optional-branches, LLVM will place optional branches out of line (more details on r231230). With this patch, this is not done for short optional branches. A short optional branch is a branch containing a single block with an instruction count below a certain threshold (defaulting to 3). Still everything is guarded under -outline-optional-branches). Outlining a short branch can't significantly improve code locality. It can however decrease performance because of the additional jmp and in cases where the optional branch is hot. This fixes a compile time regression I have observed in a benchmark. Review: http://reviews.llvm.org/D8108 llvm-svn: 232802
* [Tablegen] Attempt to add support for patterns containing nodes with ↵Craig Topper2015-03-201-6/+6
| | | | | | | | | | multiple results. This is needed for AVX512 masked scatter/gather support. The R600 change is necessary to remove a hack that was working around the lack of multiple results. llvm-svn: 232798
* Fix comment from r232794. NFCNick Lewycky2015-03-201-1/+1
| | | | llvm-svn: 232796
* [bpf] fix buildAlexei Starovoitov2015-03-201-2/+1
| | | | | | fix BPF backend build broken by r232699 llvm-svn: 232795
* When simplifying a SCEV truncate by distributing, consider it a ↵Nick Lewycky2015-03-201-4/+6
| | | | | | simplification to replace a cast, even if we end up with a trunc around the term. Fixes PR22960! llvm-svn: 232794
* SampleProfile: Check for missing debug locationsDuncan P. N. Exon Smith2015-03-201-0/+3
| | | | | | | | | Don't use `DebugLoc` accessors if we're pointing at null, which will be a problem after a WIP patch to make the `DIDescriptor` accessors more strict. Caught by Frontend/profile-sample-use-loc-tracking.c (in clang). llvm-svn: 232792
* Verifier: Remove the separate DebugInfoVerifier classDuncan P. N. Exon Smith2015-03-201-28/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove the separate `DebugInfoVerifier` class, as a partial step toward better integrating debug info verification with the `Verifier`. Right now, verification of debug info is kind of a mess. - There are `DIDescriptor::Verify()` checks live in `DebugInfo.cpp`. These return `bool`, and there's no way to see (except by opening a debugger) why they fail. - We rely on `DebugInfoFinder` to traverse the debug info graph and dig up nodes. However, the regular `Verifier` visits many of these nodes when it calls into debug info intrinsic operands. Visiting twice and running different checks is kind of absurd. - Moreover, `DebugInfoFinder` asserts on failed type resolution -- the verifier should never assert! By integrating the two verifiers, I'm aiming at solving these problems (work to be done, obviously). Verification can be localized to the `Verifier`; we can use a naive `MDNode` operand traversal to find all the nodes; we can verify type references instead of asserting on failure. There are `assert()`s sprinkled throughout the optimizer and dwarf backend on `DIDescriptor::Verify()` checks. This is a hangover from when the debug info verifier was off, so I plan to remove them as I go (once I confirm that the checks are done at verification time). Note: to keep the behaviour of only running the debug info verifier when -verify succeeds, I've added an `EverBroken` flag. Once the `DebugInfoFinder` assertions are gone and the two traversals have been merged, I expect to be able to remove this. llvm-svn: 232790
* Rewrite SelectionDAGBuilder::Clusterify to run in linear time. NFC.Hans Wennborg2015-03-202-46/+37
| | | | | | | It was previously repeatedly erasing elements from the middle of a vector, causing O(n^2) worst-case run-time. llvm-svn: 232789
* Use the cached subtarget on the MachineFunction when the AsmPrinterEric Christopher2015-03-191-1/+1
| | | | | | | will have a MachineFunction, i.e. in places other than the module level doInitialize/doFinalize. llvm-svn: 232783
* Use the cached subtarget off of the machine function.Eric Christopher2015-03-191-8/+7
| | | | llvm-svn: 232782
* move insert, extract, concat helper functions closer to related helper ↵Sanjay Patel2015-03-191-156/+156
| | | | | | functions; NFCI llvm-svn: 232781
* Fix a nasty bug in DAGCombine of STORE nodes.Owen Anderson2015-03-191-3/+8
| | | | | | | | | | | | | | | This is very related to the bug fixed in r174431. The problem is that SelectionDAG does not include alignment in the uniquing of loads and stores. When an otherwise no-op DAGCombine would increase the alignment of a load or store, the original node would be returned (with the alignment increased), which would cause the node not to be processed by any further DAGCombines. I don't have a direct testcase for this that manifests on an in-tree target, but I did see some noise in the tests for other targets and have updated them for it. llvm-svn: 232780
* Remove unused headers.Eric Christopher2015-03-191-4/+0
| | | | llvm-svn: 232777
* Add an MCSubtargetInfo variable to the TargetMachine.Eric Christopher2015-03-192-3/+11
| | | | | | | | | This enables us to remove calls to the subtarget from the TargetMachine and with a small hack for backends that require global subtarget information for module level code generation, e.g. mips abi flags, as mentioned in a fixme in the code. llvm-svn: 232776
* Add a TargetMachine local MCRegisterInfo and MCInstrInfo so thatEric Christopher2015-03-192-15/+19
| | | | | | | they can be used without a subtarget in constructing subtarget independent passes. llvm-svn: 232775
* WinEH: Make llvm.eh.actions emission match the EH docsReid Kleckner2015-03-191-8/+5
| | | | | | | | | This switches the sense of the i32 values and updates the test cases. We can also use CHECK-SAME to clean up some tests, and reduce the visual noise from bitcasts. llvm-svn: 232774
* [X86, AVX] use blends instead of insert128 with index 0Sanjay Patel2015-03-191-1/+44
| | | | | | | | | | | | | | | Another case of x86-specific shuffle strength reduction: avoid generating insert*128 instructions with index 0 because they are slower than their non-lane-changing blend equivalents. Shuffle lowering already catches most of these cases, but the zero vector case and some other paths such as in the modified test in vector-shuffle-256-v32.ll were getting through. Differential Revision: http://reviews.llvm.org/D8366 llvm-svn: 232773
* Verifier: Remove the separate -verify-di passDuncan P. N. Exon Smith2015-03-195-49/+5
| | | | | | | | | | | | | | Remove `DebugInfoVerifierLegacyPass` and the `-verify-di` pass. Instead, call into the `DebugInfoVerifier` from inside `VerifierLegacyPass::finalizeModule()`. This better matches the logic in `verifyModule()` (used by the new PassManager), avoids requiring two separate passes to verify the IR, and makes the API for "add a pass to verify the IR" simple. Note: the `-verify-debug-info` flag still works (for now, at least; eventually it might make sense to just remove it). llvm-svn: 232772
* LowerBitSets: Avoid reusing byte set addresses.Peter Collingbourne2015-03-191-1/+16
| | | | | | | | | | Each use of the byte array uses a different alias. This makes the backend less likely to reuse previously computed byte array addresses, improving the security of the CFI mechanism based on this pass. Differential Revision: http://reviews.llvm.org/D8455 llvm-svn: 232770
* libLTO, llvm-lto, gold: Introduce flag for controlling optimization level.Peter Collingbourne2015-03-192-14/+34
| | | | | | | | | | This change also introduces a link-time optimization level of 1. This optimization level runs only the globaldce pass as well as cleanup passes for passes that run at -O0, specifically simplifycfg which cleans up lowerbitsets. http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20150316/266951.html llvm-svn: 232769
* PassManagerBuilder: Remove effectively dead 'StripDebug' optionDuncan P. N. Exon Smith2015-03-191-7/+2
| | | | | | | | | `StripDebug` was only used by tools/opt/opt.cpp in `AddStandardLinkPasses()`, but opt.cpp adds the same pass based on its command-line flag before it calls `AddStandardLinkPasses()`. Stripping debug info twice isn't very useful. llvm-svn: 232765
* Switch lowering: extract NextBlock function. NFC.Hans Wennborg2015-03-192-54/+24
| | | | llvm-svn: 232759
* GlobalDCE: Improve performance for large modules containing comdats.Peter Collingbourne2015-03-191-10/+16
| | | | | | | | | | | | | | | | When we encounter a global with a comdat, rather than iterating over every global in the module to find globals in the same comdat, store the members in a multimap. This effectively lowers the complexity to O(N log N), improving performance significantly for large modules such as might be encountered during LTO. It looks like we used to do something like this until r219191. No functional change. Differential Revision: http://reviews.llvm.org/D8431 llvm-svn: 232743
* Add support for __nvvm_reflect changes in libdevice in CUDA-7.0Artem Belevich2015-03-191-5/+32
| | | | | | | | | | | | | | | | | | Summary: CUDA 7.0's libdevice uses slightly different IR to call __nvvm_reflect and that triggers an assertion in nvvm_reflect optimization pass. This change allows nvvm_reflect pass to deal with both old and new ways to pass an argument to __nvvm_reflect. Test Plan: ninja check-all Reviewers: eliben, echristo Subscribers: jholewinski, llvm-commits Differential Revision: http://reviews.llvm.org/D8399 llvm-svn: 232732
* Switch lowering: remove unnecessary ConstantInt casts. NFC.Hans Wennborg2015-03-192-34/+29
| | | | llvm-svn: 232729
* [Hexagon] Add support for vector instructionsKrzysztof Parzyszek2015-03-195-40/+1399
| | | | llvm-svn: 232728
* [Hexagon] ENDLOOP is a non-reversible conditional branchKrzysztof Parzyszek2015-03-191-0/+2
| | | | llvm-svn: 232725
* Internalize PEI. NFC.Benjamin Kramer2015-03-192-79/+48
| | | | llvm-svn: 232722
* [sparc] Small fix to r232719 to make 2007-12-17-InvokeAsm.ll pass on the ↵Daniel Sanders2015-03-191-0/+1
| | | | | | buildbot. llvm-svn: 232720
* [sparc] Only support the 'm' inline assembly memory constraint. NFC.Daniel Sanders2015-03-191-6/+0
| | | | | | | | | | | | | | | | Summary: SPARC doesn't seem to support any additional constraints. Therefore remove the target hook. No functional change intended. Reviewers: venkatra Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D8214 llvm-svn: 232719
* [InstCombine] Don't fold a GEP into itself through a PHI nodeDaniel Jasper2015-03-191-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This can only occur (I think) through the back-edge of the loop. However, folding a GEP into itself means that the value of the previous iteration needs to be stored in the meantime, thus requiring an additional register variable to be live, but not actually achieving anything (the gep still needs to be executed once per loop iteration). The attached test case is derived from: typedef unsigned uint32; typedef unsigned char uint8; inline uint8 *f(uint32 value, uint8 *target) { while (value >= 0x80) { value >>= 7; ++target; } ++target; return target; } uint8 *g(uint32 b, uint8 *target) { target = f(b, f(42, target)); return target; } What happens is that the GEP stored in incptr2 is folded into itself through the loop's back-edge and the phi-node stored in loopptr, effectively incrementing the ptr by "2" in each iteration instead of "1". In this case, it is actually increasing the number of GEPs required as the GEP before the loop can't be folded away anymore. For comparison: With this patch: define i8* @test4(i32 %value, i8* %buffer) { entry: %cmp = icmp ugt i32 %value, 127 br i1 %cmp, label %loop.header, label %exit loop.header: ; preds = %entry br label %loop.body loop.body: ; preds = %loop.body, %loop.header %buffer.pn = phi i8* [ %buffer, %loop.header ], [ %loopptr, %loop.body ] %newval = phi i32 [ %value, %loop.header ], [ %shr, %loop.body ] %loopptr = getelementptr inbounds i8, i8* %buffer.pn, i64 1 %shr = lshr i32 %newval, 7 %cmp2 = icmp ugt i32 %newval, 16383 br i1 %cmp2, label %loop.body, label %loop.exit loop.exit: ; preds = %loop.body br label %exit exit: ; preds = %loop.exit, %entry %0 = phi i8* [ %loopptr, %loop.exit ], [ %buffer, %entry ] %incptr3 = getelementptr inbounds i8, i8* %0, i64 2 ret i8* %incptr3 } Without this patch: define i8* @test4(i32 %value, i8* %buffer) { entry: %incptr = getelementptr inbounds i8, i8* %buffer, i64 1 %cmp = icmp ugt i32 %value, 127 br i1 %cmp, label %loop.header, label %exit loop.header: ; preds = %entry br label %loop.body loop.body: ; preds = %loop.body, %loop.header %0 = phi i8* [ %buffer, %loop.header ], [ %loopptr, %loop.body ] %loopptr = phi i8* [ %incptr, %loop.header ], [ %incptr2, %loop.body ] %newval = phi i32 [ %value, %loop.header ], [ %shr, %loop.body ] %shr = lshr i32 %newval, 7 %incptr2 = getelementptr inbounds i8, i8* %0, i64 2 %cmp2 = icmp ugt i32 %newval, 16383 br i1 %cmp2, label %loop.body, label %loop.exit loop.exit: ; preds = %loop.body br label %exit exit: ; preds = %loop.exit, %entry %ptr2 = phi i8* [ %incptr2, %loop.exit ], [ %incptr, %entry ] %incptr3 = getelementptr inbounds i8, i8* %ptr2, i64 1 ret i8* %incptr3 } Review: http://reviews.llvm.org/D8245 llvm-svn: 232718
* Note that we don't support COFF on PPC.Rafael Espindola2015-03-191-0/+7
| | | | | | Should bring back the windows bots. llvm-svn: 232701
* Split the object streamer callback in one per file format.Rafael Espindola2015-03-1920-128/+118
| | | | | | | | | | | | | There are two main advantages to doing this * Targets that only need to handle one of the formats specially don't have to worry about the others. For example, x86 now only registers a constructor for the COFF streamer. * Changes to the arguments passed to one format constructor will not impact the other formats. llvm-svn: 232699
* SelectionDAGBuilder: update comment in HandlePHINodesInSuccessorBlocks.Hans Wennborg2015-03-191-2/+2
| | | | | | | From what I can tell, the code is checking for PHIs that expect any value from this block, not just constants. llvm-svn: 232697
* Do not track subregister liveness when it brings no benefitsMatthias Braun2015-03-196-11/+12
| | | | | | | | | | | Some subregisters are only to indicate different access sizes, while not providing any way to actually divide the register up into multiple disjunct parts. Avoid tracking subregister liveness in these cases as it is not beneficial. Differential Revision: http://reviews.llvm.org/D8429 llvm-svn: 232695
* SelectionDAGIsel: Fix comment about terminators being "handled below".Hans Wennborg2015-03-191-3/+2
| | | | | | That changed in r102128. llvm-svn: 232692
* [CodeGenPrepare] Remove broken, dead, code.Quentin Colombet2015-03-181-26/+6
| | | | | | NFC. llvm-svn: 232690
* two or more, use a for.Rafael Espindola2015-03-188-457/+225
| | | | llvm-svn: 232688
* Teach getDefaultFormat that we only support ELF on some architectures.Rafael Espindola2015-03-181-0/+17
| | | | | | | | | This should bring the windows bots back. It is a bit ugly, but it is better than what we had before: The triple would say that the object format was COFF, but llc/llvm-mc would produce an ELF. llvm-svn: 232683
* [X86][SSE] Avoid scalarization of v2i64 vector shifts (REAPPLIED)Simon Pilgrim2015-03-181-13/+24
| | | | | | | | Fixed broken tests. Differential Revision: http://reviews.llvm.org/D8416 llvm-svn: 232682
* [PowerPC] Correct typo in PPCInstrAltivec.tdBill Schmidt2015-03-181-1/+1
| | | | llvm-svn: 232681
* Revert "[X86][SSE] Avoid scalarization of v2i64 vector shifts" as itEric Christopher2015-03-181-24/+13
| | | | | | | | appears to have broken tests/bots. This reverts commit r232660. llvm-svn: 232670
OpenPOWER on IntegriCloud