summaryrefslogtreecommitdiffstats
path: root/llvm/lib
Commit message (Collapse)AuthorAgeFilesLines
* Silence variable set but not used warning, NFC.Yaron Keren2015-02-281-2/+3
| | | | llvm-svn: 230848
* ArrayRefize memory operand folding. NFC.Benjamin Kramer2015-02-2811-108/+84
| | | | llvm-svn: 230846
* Replace std::copy with a back inserter with vector append where feasibleBenjamin Kramer2015-02-286-18/+11
| | | | | | | | | All of the cases were just appending from random access iterators to a vector. Using insert/append can grow the vector to the perfect size directly and moves the growing out of the loop. No intended functionalty change. llvm-svn: 230845
* [RewriteStatepointsForGC] Reduce indentation via early continue [NFC]Philip Reames2015-02-281-81/+82
| | | | llvm-svn: 230836
* [RewriteStatepointsForGC] Fix another order of iteration bugPhilip Reames2015-02-281-4/+20
| | | | | | | | | | | | It turns out the naming of inserted phis and selects is sensative to the order in which two sets are iterated. We need to nail this down to avoid non-deterministic output and possible test failures. The modified test is the one I first noticed something odd in. The change is making it more strict to report the error. With the test change, but without the code change, the test fails roughly 1 in 5. With the code change, I've run ~30 runs without error. Long term, the right fix here is to adjust the naming scheme. I'm checking in this hack to avoid any possible non-determinism in the tests over the weekend. HJust because I only noticed one case doesn't mean it's actually the only case. I hope to get to the right change Monday. std->llvm data structure changes bugfix change #3 llvm-svn: 230835
* [RewriteStatepointsForGC] Reduce indentation via early continue [NFC]Philip Reames2015-02-281-35/+36
| | | | llvm-svn: 230829
* [RewriteStatepointsForGC] Fix iterator invalidation bugPhilip Reames2015-02-281-2/+11
| | | | | | | | Inserting into a DenseMap you're iterating over is not well defined. This is unfortunate since this is well defined on a std::map. "cleanup per llvm code style standards" bug #2 llvm-svn: 230827
* [RewriteStatepointsForGC] Add tests for the base pointer identification ↵Philip Reames2015-02-281-2/+11
| | | | | | | | | | | | algorithm These tests cover the 'base object' identification and rewritting portion of RewriteStatepointsForGC. These aren't completely exhaustive, but they've proven to be reasonable effective over time at finding regressions. In the process of porting these tests over, I found my first "cleanup per llvm code style standards" bug. We were relying on the order of iteration when testing the base pointers found for a derived pointer. When we switched from std::set to DenseSet, this stopped being a safe assumption. I'm suspecting I'm going to find more of those. In particular, I'm now really wondering about the main iteration loop for this algorithm. I need to go take a closer look at the assumptions there. I'm not really happy with the fact these are testing what is essentially debug output (i.e. enabled via command line flags). Suggestions for how to structure this better are very welcome. llvm-svn: 230818
* MachineDominators: Move applySplitCriticalEdges into the cpp file.Benjamin Kramer2015-02-271-0/+66
| | | | | | | It's too big for inlining anyways. Also clean it up slightly. No functionality change intended. llvm-svn: 230806
* [PowerPC] Fix PR22711 - Misaligned .toc sectionBill Schmidt2015-02-271-0/+1
| | | | | | | | | | | | Straightforward patch to emit an alignment directive when emitting a TOC entry. The test case was generated from the test in PR22711 that demonstrated a misaligned .toc section. The object code is run through llvm-readobj to verify that the correct alignment has been applied to the .toc section. Thanks to Ulrich Weigand for running down where the fix was needed. llvm-svn: 230801
* Reduce double set lookups.Benjamin Kramer2015-02-272-4/+2
| | | | llvm-svn: 230798
* [opaque pointer type] Add textual IR support for explicit type parameter to ↵David Blaikie2015-02-272-2/+14
| | | | | | | | | | | | | | | | | | | | | | | | load instruction Essentially the same as the GEP change in r230786. A similar migration script can be used to update test cases, though a few more test case improvements/changes were required this time around: (r229269-r229278) import fileinput import sys import re pat = re.compile(r"((?:=|:|^)\s*load (?:atomic )?(?:volatile )?(.*?))(| addrspace\(\d+\) *)\*($| *(?:%|@|null|undef|blockaddress|getelementptr|addrspacecast|bitcast|inttoptr|\[\[[a-zA-Z]|\{\{).*$)") for line in sys.stdin: sys.stdout.write(re.sub(pat, r"\1, \2\3*\4", line)) Reviewers: rafael, dexonsmith, grosser Differential Revision: http://reviews.llvm.org/D7649 llvm-svn: 230794
* Target/X86: Never use the redzone for Win64 ABI functions.Charles Davis2015-02-271-1/+1
| | | | | | | | | | | | | | | | | Summary: Until now, we did this (among other things) based on whether or not the target was Windows. This is clearly wrong, not just for Win64 ABI functions on non-Windows, but for System V ABI functions on Windows, too. In this change, we make this decision based on the ABI the calling convention specifies instead. Reviewers: rnk Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D7953 llvm-svn: 230793
* [PowerPC] Use vector types for memcpy and friends (sometimes)Hal Finkel2015-02-271-2/+25
| | | | | | | | | | When using Altivec, we can use vector loads and stores for aligned memcpy and friends. Starting with the P7 and VXS, we have reasonable unaligned vector stores. Starting with the P8, we have fast unaligned loads too. For QPX, we use vector loads are stores, but only for aligned memory accesses. llvm-svn: 230788
* [opaque pointer type] Add textual IR support for explicit type parameter to ↵David Blaikie2015-02-272-1/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | getelementptr instruction One of several parallel first steps to remove the target type of pointers, replacing them with a single opaque pointer type. This adds an explicit type parameter to the gep instruction so that when the first parameter becomes an opaque pointer type, the type to gep through is still available to the instructions. * This doesn't modify gep operators, only instructions (operators will be handled separately) * Textual IR changes only. Bitcode (including upgrade) and changing the in-memory representation will be in separate changes. * geps of vectors are transformed as: getelementptr <4 x float*> %x, ... ->getelementptr float, <4 x float*> %x, ... Then, once the opaque pointer type is introduced, this will ultimately look like: getelementptr float, <4 x ptr> %x with the unambiguous interpretation that it is a vector of pointers to float. * address spaces remain on the pointer, not the type: getelementptr float addrspace(1)* %x ->getelementptr float, float addrspace(1)* %x Then, eventually: getelementptr float, ptr addrspace(1) %x Importantly, the massive amount of test case churn has been automated by same crappy python code. I had to manually update a few test cases that wouldn't fit the script's model (r228970,r229196,r229197,r229198). The python script just massages stdin and writes the result to stdout, I then wrapped that in a shell script to handle replacing files, then using the usual find+xargs to migrate all the files. update.py: import fileinput import sys import re ibrep = re.compile(r"(^.*?[^%\w]getelementptr inbounds )(((?:<\d* x )?)(.*?)(| addrspace\(\d\)) *\*(|>)(?:$| *(?:%|@|null|undef|blockaddress|getelementptr|addrspacecast|bitcast|inttoptr|\[\[[a-zA-Z]|\{\{).*$))") normrep = re.compile( r"(^.*?[^%\w]getelementptr )(((?:<\d* x )?)(.*?)(| addrspace\(\d\)) *\*(|>)(?:$| *(?:%|@|null|undef|blockaddress|getelementptr|addrspacecast|bitcast|inttoptr|\[\[[a-zA-Z]|\{\{).*$))") def conv(match, line): if not match: return line line = match.groups()[0] if len(match.groups()[5]) == 0: line += match.groups()[2] line += match.groups()[3] line += ", " line += match.groups()[1] line += "\n" return line for line in sys.stdin: if line.find("getelementptr ") == line.find("getelementptr inbounds"): if line.find("getelementptr inbounds") != line.find("getelementptr inbounds ("): line = conv(re.match(ibrep, line), line) elif line.find("getelementptr ") != line.find("getelementptr ("): line = conv(re.match(normrep, line), line) sys.stdout.write(line) apply.sh: for name in "$@" do python3 `dirname "$0"`/update.py < "$name" > "$name.tmp" && mv "$name.tmp" "$name" rm -f "$name.tmp" done The actual commands: From llvm/src: find test/ -name *.ll | xargs ./apply.sh From llvm/src/tools/clang: find test/ -name *.mm -o -name *.m -o -name *.cpp -o -name *.c | xargs -I '{}' ../../apply.sh "{}" From llvm/src/tools/polly: find test/ -name *.ll | xargs ./apply.sh After that, check-all (with llvm, clang, clang-tools-extra, lld, compiler-rt, and polly all checked out). The extra 'rm' in the apply.sh script is due to a few files in clang's test suite using interesting unicode stuff that my python script was throwing exceptions on. None of those files needed to be migrated, so it seemed sufficient to ignore those cases. Reviewers: rafael, dexonsmith, grosser Differential Revision: http://reviews.llvm.org/D7636 llvm-svn: 230786
* Remove the Forward Control Flow Integrity pass and its dependencies.Eric Christopher2015-02-278-795/+0
| | | | | | | | | This work is currently being rethought along different lines and if this work is needed it can be resurrected out of svn. Remove it for now as no current work in ongoing on it and it's unused. Verified with the authors before removal. llvm-svn: 230780
* Change the fast-isel-abort option from bool to int to enable "levels"Mehdi Amini2015-02-271-24/+24
| | | | | | | | | | | | | | | | | | | | | | | Summary: Currently fast-isel-abort will only abort for regular instructions, and just warn for function calls, terminators, function arguments. There is already fast-isel-abort-args but nothing for calls and terminators. This change turns the fast-isel-abort options into an integer option, so that multiple levels of strictness can be defined. This will help no being surprised when the "abort" option indeed does not abort, and enables the possibility to write test that verifies that no intrinsics are forgotten by fast-isel. Reviewers: resistor, echristo Subscribers: jfb, llvm-commits Differential Revision: http://reviews.llvm.org/D7941 From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 230775
* Centralize handling of the eh_begin and eh_end labels.Rafael Espindola2015-02-276-33/+34
| | | | | | | | | | This removes a bit of duplicated code and more importantly, remembers the labels so that they don't need to be looked up by name. This in turn allows for any name to be used and avoids a crash if the name we wanted was already taken. llvm-svn: 230772
* remove function names from comments; NFCSanjay Patel2015-02-271-9/+8
| | | | llvm-svn: 230771
* remove function names from comments; NFCSanjay Patel2015-02-271-20/+15
| | | | llvm-svn: 230766
* Equally to NetBSD, Bitrig/ARM uses the Itanium-ABI.Renato Golin2015-02-271-0/+1
| | | | | | Patch by Patrick Wildt. llvm-svn: 230762
* [mips][microMIPS] Change register class for GP registerZoran Jovanovic2015-02-271-6/+11
| | | | | | Differential Revision: http://reviews.llvm.org/D7934 llvm-svn: 230760
* R600/SI: Add missing mubuf instructionsTom Stellard2015-02-272-9/+25
| | | | llvm-svn: 230759
* R600/SI: Consistently put soffset before the offset operand for mubuf ↵Tom Stellard2015-02-273-20/+20
| | | | | | | | instructions This matches the assembly syntax. llvm-svn: 230758
* R600/SI: Add slc, glc, and tfe to non-atomic _ADDR64 instructionsTom Stellard2015-02-274-17/+33
| | | | llvm-svn: 230757
* [x86] Run most of the rest of the shuffle combining over non-128-bitChandler Carruth2015-02-271-16/+11
| | | | | | | | | | | | vectors. This lets us fix the rest of the v16 lowering problems when pshufb is clearly better. We might still be able to improve some of the lowerings by enabling the other combine-based rewriting to fire for non-128-bit vectors, but this at least should remove any regressions from using the fancy v16i16 lowering strategy. llvm-svn: 230753
* [x86] Teach a bunch of the x86-specific shuffle combining to work withChandler Carruth2015-02-271-13/+28
| | | | | | | 256-bit vectors as well as 128-bit vectors. Fixes some of the redundant shuffles for v16i16. llvm-svn: 230752
* [x86] Make the v8i16 clever single-input shuffle lowering usable forChandler Carruth2015-02-271-15/+32
| | | | | | | | | | | | | | | | | repeated 128-bit lane shuffles of wider vector types and use it to lower 256-bit v16i16 vector shuffles where applicable. This should let us perfectly lowering the pattern of pshuflw and pshufhw even for AVX2 256-bit patterns. I've not added AVX-512 support, but it should be trivial for someone working on that to wire up. Note that currently this generates bad, long shuffle chains because we don't combine 256-bit target shuffles. The subsequent patches will fix that. llvm-svn: 230751
* [mips] Remove redundant periods from -mattr=help descriptions for MIPS.Toma Tabacu2015-02-271-6/+6
| | | | | | | | | | | | | | Summary: Also fixes an infringement of the 80-column limit rule. Reviewers: dsanders Reviewed By: dsanders Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D7910 llvm-svn: 230748
* [x86] Make the single-input v8i16 lowering directly recurse rather thanChandler Carruth2015-02-271-2/+2
| | | | | | | | going back through the entire vector shuffle lowering. This is an important step to being able to re-use this logic. llvm-svn: 230743
* [mips] Account for constant-zero operands in ADDE nodes.Vasileios Kalintiris2015-02-271-2/+6
| | | | | | | | | | | | | | | Summary: We identify the cases where the operand to an ADDE node is a constant zero. In such cases, we can avoid generating an extra ADDu instruction disguised as an identity move alias (ie. addu $r, $r, 0 --> move $r, $r). Reviewers: dsanders Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D7906 llvm-svn: 230742
* [asan] Skip promotable allocas to improve performance at -O0Anna Zaks2015-02-271-31/+51
| | | | | | | | | | | | Currently, the ASan executables built with -O0 are unnecessarily slow. The main reason is that ASan instrumentation pass inserts redundant checks around promotable allocas. These allocas do not get instrumented under -O1 because they get converted to virtual registered by mem2reg. With this patch, ASan instrumentation pass will only instrument non promotable allocas, giving us a speedup of 39% on a collection of benchmarks with -O0. (There is no measurable speedup at -O1.) llvm-svn: 230724
* Don't modify the DenseMap being iterated over from within the loopSanjoy Das2015-02-271-3/+6
| | | | | | | | | | | that is iterating over it Inserting elements into a `DenseMap` invalidated iterators pointing into the `DenseMap` instance. Differential Revision: http://reviews.llvm.org/D7924 llvm-svn: 230719
* Target/X86: Save Win64 non-volatile registers in a Win64 ABI function.Charles Davis2015-02-271-1/+11
| | | | | | | | | | | | | | Summary: This change causes us to actually save non-volatile registers in a Win64 ABI function that calls a System V ABI function, and vice-versa. Reviewers: rnk Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D7919 llvm-svn: 230714
* Rewrite MachineOperand::print and MachineInstr::print to avoidEric Christopher2015-02-277-47/+34
| | | | | | | | | | | | uses of TM->getSubtargetImpl and propagate to all calls. This could be a debugging regression in places where we had a TargetMachine and/or MachineFunction but don't have it as part of the MachineInstr. Fixing this would require passing a MachineFunction/Function down through the print operator, but none of the existing uses in tree seem to do this. llvm-svn: 230710
* Put jump tables in distinct sections if -ffunction-sections is used.Rafael Espindola2015-02-261-20/+28
| | | | | | | A small regression in r230411 was that we were basing the decision on -fdata-sections. llvm-svn: 230707
* [llvm-pdbdump] Fix dumping of function pointers and basic types.Zachary Turner2015-02-261-25/+0
| | | | | | | | | | | | Function pointers were not correctly handled by the dumper, and they would print as "* name". They now print as "int (__cdecl *name)(int arg1, int arg2)" as they should. Also, doubles were being printed as floats. This fixes that bug as well, and adds tests for all builtin types. as well as a test for function pointers. llvm-svn: 230703
* Remove DebugLoc::print(LLVMContext, raw_ostream), it was justEric Christopher2015-02-262-9/+3
| | | | | | forwarding to the one that didn't take a context. llvm-svn: 230700
* getRegForInlineAsmConstraint wants to use TargetRegisterInfo forEric Christopher2015-02-2626-104/+132
| | | | | | | | | a lookup, pass that in rather than use a naked call to getSubtargetImpl. This involved passing down and around either a TargetMachine or TargetRegisterInfo. Update all callers/definitions around the targets and SelectionDAG. llvm-svn: 230699
* Add a TargetMachine argument to the AddressingModeMatcher, we'llEric Christopher2015-02-261-10/+14
| | | | | | | need this shortly to get a TargetRegisterInfo from the subtarget for TargetLowering routines. llvm-svn: 230698
* [x86] Fix PR22706 where we would incorrectly try lower a v32i8 dynamicChandler Carruth2015-02-261-13/+30
| | | | | | | | | | | | | blend as legal. We made the same mistake in two different places. Whenever we are custom lowering a v32i8 blend we need to check whether we are custom lowering it only for constant conditions that can be shuffled, or whether we actually have AVX2 and full dynamic blending support on bytes. Both are fixed, with comments added to make it clear what is going on and a new test case. llvm-svn: 230695
* Simplify arange output.Rafael Espindola2015-02-262-68/+43
| | | | | | | Move SectionMap to its only user (emitDebugARanges) and reorder to save a call to sort. llvm-svn: 230693
* [x86] Restructure the comments and the conditions for handlingChandler Carruth2015-02-261-13/+19
| | | | | | | | | | | | | | dynamic blends. This makes it much more clear what is going on. The case we're handling is that of dynamic conditions, and we're bailing when the nature of the vector types and subtarget preclude lowering the dynamic condition vselect as an actual blend. No functionality changed here, but this will make a subsequent bug-fix to this code much more clear. llvm-svn: 230690
* [x86] Re-order the combines of select in the X86 backend. This doesn'tChandler Carruth2015-02-261-19/+19
| | | | | | | change functionality, but makes it more clear that the dynamic case and the shuffle case don't overlap in any interesting way. llvm-svn: 230689
* [x86] Add an assert to catch if we ever try to blend a v32i8 withoutChandler Carruth2015-02-261-0/+3
| | | | | | AVX2. llvm-svn: 230688
* Silence some Win64 clang-cl warnings about unused stuff due to ifdefsReid Kleckner2015-02-261-1/+2
| | | | llvm-svn: 230685
* Use wider type for overflow check on LLP64 platforms like Win64, found by ↵Reid Kleckner2015-02-261-2/+2
| | | | | | clang-cl -Wtautological llvm-svn: 230684
* InstrProf: Simplify the construction of BinaryCoverageReaderJustin Bogner2015-02-262-64/+61
| | | | | | | | | | | | | Creating BinaryCoverageReader is a strange and complicated dance where the constructor sets error codes that member functions will later read, and the object is in an invalid state if readHeader isn't immediately called after construction. Instead, make the constructor private and add a static create method to do the construction properly. This also has the benefit of removing readHeader completely and simplifying the interface of the object. llvm-svn: 230676
* InstrProf: Rename ObjectFileCoverageMappingReader to BinaryCoverageReaderJustin Bogner2015-02-262-6/+6
| | | | | | | The current name is long and confusing. A shorter one is both easier to understand and easier to work with. llvm-svn: 230675
* SCEVExpander incorrectly marks generated subtractions as nuw/nswSanjoy Das2015-02-261-3/+6
| | | | | | | | | | | | | | | It is not sound to mark the increment operation as `nuw` or `nsw` based on a proof off of the add recurrence if the increment operation we emit happens to be a `sub` instruction. I could not come up with a test case for this -- the cases where SCEVExpander decides to emit a `sub` instruction is quite small, and I cannot think of a way I'd be able to get SCEV to prove that the increment does not overflow in those cases. Differential Revision: http://reviews.llvm.org/D7899 llvm-svn: 230673
OpenPOWER on IntegriCloud