summaryrefslogtreecommitdiffstats
path: root/llvm/lib
Commit message (Collapse)AuthorAgeFilesLines
* AArch64: use __clear_cache under GCCish environmentsTim Northover2013-05-041-1/+1
| | | | | | | | | AArch64 is going to need some kind of cache-invalidation in order to successfully JIT since it has a weak memory-model. This is provided by a __clear_cache builtin in libgcc, which acts very much like the 32-bit ARM equivalent (on platforms where it exists). llvm-svn: 181129
* Fix buildbot failure on 64 bit linux due to std::max() having differentRichard Osborne2013-05-041-1/+1
| | | | | | operand types. llvm-svn: 181128
* [XCore] Remove unused operand type.Richard Osborne2013-05-041-1/+0
| | | | llvm-svn: 181127
* [XCore] Make use of the target independent global address offset folding.Richard Osborne2013-05-046-98/+41
| | | | | | | | This let us to remove some custom code that matched constant offsets from globals at instruction selection time as a special addressing mode. No intended functionality change. llvm-svn: 181126
* [XCore] Simplify code that checks for an aligned base plus a constant.Richard Osborne2013-05-042-81/+56
| | | | | | | | | The code now makes use of ComputeMaskedBits, SelectionDAG::isBaseWithConstantOffset and TargetLowering::isGAPlusOffset where appropriate reducing the amount of logic needed in XCoreISelLowering. No intended functionality change. llvm-svn: 181125
* [XCore] Move lowering of thread local storage to a separate pass.Richard Osborne2013-05-046-55/+158
| | | | | | | | | | | | | Thread local storage is not supported by the XMOS linker so we handle thread local variables by lowering the variable to an array of n elements (where n is the number of hardware threads per core, currently 8 for all XMOS devices) indexed by the the current thread ID. Previously this lowering was spread across the XCoreISelLowering and the XCoreAsmPrinter classes. Moving this to a separate pass should be much cleaner. llvm-svn: 181124
* AArch64: assert code model is small for TLS accessesTim Northover2013-05-041-0/+2
| | | | | | | Supporting TLS in the large memory model is rather difficult at the moment, so make sure no-one gets into difficulties by mistake. llvm-svn: 181121
* AArch64: support literal pool access in large memory model.Tim Northover2013-05-041-20/+48
| | | | llvm-svn: 181120
* AArch64: support large code model for jump-tablesTim Northover2013-05-041-5/+18
| | | | llvm-svn: 181119
* AArch64: implement support for blockaddress in large code modelTim Northover2013-05-041-11/+20
| | | | llvm-svn: 181118
* AArch64: implement large code model access to global variables.Tim Northover2013-05-047-14/+126
| | | | | | | | | | | | | | The MOVZ/MOVK instruction sequence may not be the most efficient (a literal-pool load could be better) but adding that would require reinstating the ConstantIslands pass. For now the sequence is correct, and that's enough. Beware, as of commit GNU ld does not appear to support the relocations needed for this. Its primary purpose (for now) will be to support JITed code, since in that case there is no guarantee of where your code will end up in memory relative to external symbols it references. llvm-svn: 181117
* [XCore] Use static relocation model by default.Richard Osborne2013-05-044-5/+11
| | | | | | | This allows us to get get rid of a hack in XCoreTargetObjectFile where the the DataRel* sections were overridden. llvm-svn: 181116
* Allow host triple to be correctly overridden in CMake buildsTim Northover2013-05-041-1/+1
| | | | | | | | | | | The intended semantics mirror autoconf, where the user is able to specify a host triple, but if it's left to the build system then "config.guess" is invoked for the default. This also renames the LLVM_HOSTTRIPLE define to LLVM_HOST_TRIPLE to fit in with the style of the surrounding defines. llvm-svn: 181112
* Fix a performance bug in the Linker.Rafael Espindola2013-05-041-11/+22
| | | | | | | | | | | | | Now that we hava a convinient place to keep it, remeber the set of identified structs as we merge modules. This speeds up the linking of all the bitcode files in clang with the gold plugin and -plugin-opt=emit-llvm (i.e., link only, no codegen) from 5:25 minutes to 13.6 seconds! Patch by Xiaofei Wan! llvm-svn: 181104
* Implement Linker::LinkModules with Linker::linkInModule.Rafael Espindola2013-05-041-8/+9
| | | | | | Flipping which one is the implementation will let us optimize linkInModule. llvm-svn: 181102
* Now that Linker.cpp is almost empty, merge it into LinkModules.cpp.Rafael Espindola2013-05-043-37/+9
| | | | | | Also remove unused includes. llvm-svn: 181100
* Last batch of cleanups to Linker.h.Rafael Espindola2013-05-041-0/+4
| | | | | | | | Update comments, fix * placement, fix method names that are not used in clang, add a linkInModule that takes a Mode and put it in Linker.cpp. llvm-svn: 181099
* Don't construct or delete a module on the Linker.Rafael Espindola2013-05-041-5/+0
| | | | | | | The linker is now responsible only for actually linking the modules, it is up to the clients to create and destroy them. llvm-svn: 181098
* Don't store the context in the Linker.Rafael Espindola2013-05-041-2/+0
| | | | llvm-svn: 181097
* Remove unused members and constructor arguments.Rafael Espindola2013-05-041-11/+5
| | | | llvm-svn: 181096
* Delete dead code from the linker.Rafael Espindola2013-05-041-31/+0
| | | | llvm-svn: 181094
* Use consistent function names.Krzysztof Parzyszek2013-05-043-3/+3
| | | | llvm-svn: 181090
* Tabs to spaces. No functionality change.Nick Lewycky2013-05-041-3/+3
| | | | llvm-svn: 181082
* Revert r181009.Amara Emerson2013-05-032-8/+139
| | | | llvm-svn: 181079
* Remove some uneeded pseudos in the presence of the naked function attribute.Reed Kotler2013-05-031-2/+8
| | | | llvm-svn: 181072
* [PowerPC] Avoid using '$' in generated assembler codeUlrich Weigand2013-05-031-2/+2
| | | | | | | | | | | | PowerPC assemblers are supposed to support a stand-alone '$' symbol as an alternative of '.' to refer to the current PC. This does not work in the LLVM assembler parser yet. To avoid bootstrap failures when using the LLVM assembler as system assembler, this patch modifies the assembler source code generated by LLVM to avoid using '$' (and simply use '.' instead). llvm-svn: 181054
* [PowerPC] Parse platform-specifc variant kinds in AsmParserUlrich Weigand2013-05-031-0/+34
| | | | | | | | | This patch adds support for PowerPC platform-specific variant kinds in MCSymbolRefExpr::getVariantKindForName, and also adds a test case to verify they are translated to the appropriate fixup type. llvm-svn: 181053
* [PowerPC] Add some Book II instructions to AsmParserUlrich Weigand2013-05-032-0/+17
| | | | | | | | | | | | | This patch adds a couple of Book II instructions (isync, icbi) to the PowerPC assembler parser. These are needed when bootstrapping clang with the integrated assembler forced on, because they are used in inline asm statements in the code base. The test case adds the full list of Book II storage control instructions, including associated extended mnemonics. Again, those that are not yet supported as marked as FIXME. llvm-svn: 181052
* [PowerPC] Support extended mnemonics in AsmParserUlrich Weigand2013-05-032-0/+142
| | | | | | | | | | | | This patch adds infrastructure to support extended mnemonics in the PowerPC assembler parser. It adds support specifically for those extended mnemonics that LLVM will itself generate. The test case lists *all* extended mnemonics according to the PowerPC ISA v2.06 Book I, but marks those not yet supported as FIXME. llvm-svn: 181051
* [PowerPC] Add assembler parserUlrich Weigand2013-05-0310-16/+853
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds assembler parser support to the PowerPC back end. The parser will run for any powerpc-*-* and powerpc64-*-* triples, but was tested only on 64-bit Linux. The supported syntax is intended to be compatible with the GNU assembler. The parser does not yet support all PowerPC instructions, but it does support anything that is generated by LLVM itself. There is no support for testing restricted instruction sets yet, i.e. the parser will always accept any instructions it knows, no matter what feature flags are given. Instruction operands will be checked for validity and errors generated. (Error handling in general could still be improved.) The patch adds a number of test cases to verify instruction and operand encodings. The tests currently cover all instructions from the following PowerPC ISA v2.06 Book I facilities: Branch, Fixed-point, Floating-Point, and Vector. Note that a number of these instructions are not yet supported by the back end; they are marked with FIXME. A number of follow-on check-ins will add extra features. When they are all included, LLVM passes all tests (including bootstrap) when using clang -cc1as as the system assembler. llvm-svn: 181050
* Decompose GVN::processNonLocalLoad() (about 400 LOC) into smaller helper ↵Shuxin Yang2013-05-031-169/+194
| | | | | | | | | | | | | | functions. No function change. This function consists of following steps: 1. Collect dependent memory accesses. 2. Analyze availability. 3. Perform fully redundancy elimination, or 4. Perform PRE, depending on the availability Step 2, 3 and 4 are now moved to three helper routines. llvm-svn: 181047
* [mips] Split the DSP control register and define one register for each field ofAkira Hatanaka2013-05-035-191/+258
| | | | | | | | | | | its fields. This removes false dependencies between DSP instructions which access different fields of the the control register. Implicit register operands are added to instructions RDDSP and WRDSP after instruction selection, depending on the value of the mask operand. llvm-svn: 181041
* LoopVectorizer: Add support for if-conversion of PHINodes with 3+ incoming ↵Nadav Rotem2013-05-031-20/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | values. By supporting the vectorization of PHINodes with more than two incoming values we can increase the complexity of nested if statements. We can now vectorize this loop: int foo(int *A, int *B, int n) { for (int i=0; i < n; i++) { int x = 9; if (A[i] > B[i]) { if (A[i] > 19) { x = 3; } else if (B[i] < 4 ) { x = 4; } else { x = 5; } } A[i] = x; } } llvm-svn: 181037
* R600: Expand vector or, shl, srl, and xor nodesTom Stellard2013-05-031-0/+8
| | | | llvm-svn: 181035
* R600: BFI_INT is a vector-only instructionTom Stellard2013-05-031-1/+1
| | | | llvm-svn: 181034
* R600: Add pattern for SHA-256 Ma functionTom Stellard2013-05-033-0/+17
| | | | | | This can be optimized using the BFI_INT instruction. llvm-svn: 181033
* R600: Clean up comments in Processors.tdTom Stellard2013-05-031-5/+1
| | | | llvm-svn: 181032
* RegionInfo: Do not crash if unreachable block is foundTobias Grosser2013-05-031-1/+2
| | | | llvm-svn: 181025
* [SystemZ] Add MCJIT supportRichard Sandiford2013-05-034-0/+113
| | | | | | | | Another step towards reinstating the SystemZ backend. I'll commit the configure changes separately (TARGET_HAS_JIT etc.), then commit a patch to enable the MCJIT tests on SystemZ. llvm-svn: 181015
* [SystemZ] Support System Z as host architectureUlrich Weigand2013-05-031-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | The llvm::sys::AddSignalHandler function (as well as related routines) in lib/Support/Unix/Signals.inc currently registers a signal handler routine via "sigaction". When this handler is called due to a SIGSEGV, SIGILL or similar signal, it will show a stack backtrace, deactivate the handler, and then simply return to the operating system. The intent is that the OS will now retry execution at the same location as before, which ought to again trigger the same error condition and cause the same signal to be delivered again. Since the hander is now deactivated, the OS will take its default action (usually, terminate the program and possibly create a core dump). However, this method doesn't work reliably on System Z: With certain signals (namely SIGILL, SIGFPE, and SIGTRAP), the program counter stored by the kernel on the signal stack frame (which is the location where execution will resume) is not the instruction that triggered the fault, but then instruction *after it*. When the LLVM signal handler simply returns to the kernel, execution will then resume at *that* address, which will not trigger the problem again, but simply go on and execute potentially unrelated code leading to random errors afterwards. To fix this, the patch simply goes and re-raises the signal in question directly from the handler instead of returning from it. This is done only on System Z and only for those signals that have this particular problem. llvm-svn: 181010
* Add support for reading ARM ELF build attributes.Amara Emerson2013-05-032-139/+8
| | | | | | | | | | | Build attribute sections can now be read if they exist via ELFObjectFile, and the llvm-readobj tool has been extended with an option to dump this information if requested. Regression tests are also included which exercise these features. Also update the docs with a fixed ARM ABI link and a new link to the Addenda which provides the build attributes specification. llvm-svn: 181009
* [SystemZ] Add llvm::Triple::systemzRichard Sandiford2013-05-031-0/+8
| | | | | | | First step towards reinstating the SystemZ backend. Tests will be included in the main backend patch. llvm-svn: 181007
* X86: Add target description for btver2; make autodetection logic aware of AVX.Benjamin Kramer2013-05-032-4/+14
| | | | llvm-svn: 181005
* Unbreaking the non-x86 build bots by protecting the AVX test code properly.Aaron Ballman2013-05-031-0/+4
| | | | llvm-svn: 180992
* Correctly testing for AVX support in x86 based off code from Hosts.cpp.Aaron Ballman2013-05-031-1/+18
| | | | llvm-svn: 180991
* Fix missing include in Hexagon code for Release+AssertsReid Kleckner2013-05-031-0/+1
| | | | llvm-svn: 180983
* In MC asm parsing, account for the possibility of whitespace withinJohn McCall2013-05-031-18/+22
| | | | | | | | | | | | | | the "identifier" parsed by the frontend callback by skipping forward until we've consumed a token that ends at the point dictated by the callback. In addition, inform the callback when it's parsing an unevaluated operand (e.g. mov eax, LENGTH A::x) as opposed to an evaluated one (e.g. mov eax, [A::x]). This commit depends on a clang commit. llvm-svn: 180978
* [mips] Handle reading, writing or copying of ccond field of DSP controlAkira Hatanaka2013-05-023-1/+60
| | | | | | | | | | | | register. - Define pseudo instructions which store or load ccond field of the DSP control register. - Emit the pseudos in MipsSEInstrInfo::storeRegToStack and loadRegFromStack. - Expand the pseudos before callee-scan save. - Emit instructions RDDSP or WRDSP to copy between ccond field and GPRs. llvm-svn: 180969
* reverting r180953Jyotsna Verma2013-05-025-305/+404
| | | | llvm-svn: 180964
* R600: Signed literals are 64bits wideVincent Lejeune2013-05-021-3/+3
| | | | llvm-svn: 180960
OpenPOWER on IntegriCloud