summaryrefslogtreecommitdiffstats
path: root/llvm/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* [PowerPC] Use mtocrf when availableUlrich Weigand2013-07-037-11/+38
| | | | | | | | | | | | | | | | | | | | Just as with mfocrf, it is also preferable to use mtocrf instead of mtcrf when only a single CR register is to be written. Current code however always emits mtcrf. This probably does not matter when using an external assembler, since the GNU assembler will in fact automatically replace mtcrf with mtocrf when possible. It does create inefficient code with the integrated assembler, however. To fix this, this patch adds MTOCRF/MTOCRF8 instruction patterns and uses those instead of MTCRF/MTCRF8 everything. Just as done in the MFOCRF patch committed as 185556, these patterns will be converted back to MTCRF if MTOCRF is not available on the machine. As a side effect, this allows to modify the MTCRF pattern to accept the full range of mask operands for the benefit of the asm parser. llvm-svn: 185561
* [PowerPC] Always use mfocrf if availableUlrich Weigand2013-07-039-65/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | When accessing just a single CR register, it is always preferable to use mfocrf instead of mfcr, if the former is available on the CPU. Current code makes that distinction in many, but not all places where a single CR register value is retrieved. One missing location is PPCRegisterInfo::lowerCRSpilling. To fix this and make this simpler in the future, this patch changes the bulk of the back-end to always assume mfocrf is available and simply generate it when needed. On machines that actually do not support mfocrf, the instruction is replaced by mfcr at the very end, in EmitInstruction. This has the additional benefit that we no longer need the MFCRpseud hack, since before EmitInstruction we always have a MFOCRF instruction pattern, which already models data flow as required. The patch also adds the MFOCRF8 version of the instruction, which was missing so far. Except for the PPCRegisterInfo::lowerCRSpilling case, no change in generated code intended. llvm-svn: 185556
* Add support for gnu archives with a string table and no symtab.Rafael Espindola2013-07-031-27/+52
| | | | | | While there, use early returns to reduce nesting. llvm-svn: 185547
* [PowerPC] Remove dead code from PPCDAGToDAGISel::SelectSETCCUlrich Weigand2013-07-031-23/+5
| | | | | | | | | | | | | | | | The subroutine getCRIdxForSetCC has a parameter "Other" and comment: If this returns with Other != -1, then the returned comparison is an or of two simpler comparisons. However for at least the last five years this routine has never returned a value of Other != -1; these cases are now handled differently to begin with. This patch removes the parameter and the code in SelectSETCC that attempted to handle the Other != -1 case. llvm-svn: 185541
* Use SmallVectorImpl::iterator/const_iterator instead of SmallVector to avoid ↵Craig Topper2013-07-0310-34/+34
| | | | | | specifying the vector size. llvm-svn: 185540
* [msan] Unpoison stack allocations and undef values in blacklisted functions.Evgeniy Stepanov2013-07-031-10/+14
| | | | | | | This changes behavior of -msan-poison-stack=0 flag from not poisoning stack allocations to actively unpoisoning them. llvm-svn: 185538
* [PowerPC] Make specialized AltiVec patterns isCodeGenOnlyUlrich Weigand2013-07-031-2/+3
| | | | | | | | | | | A couple of AltiVec patterns are just specialized forms of the generic instruction pattern, and should therefore be marked isCodeGenOnly to avoid confusing the asm parser: VCFSX_0, VCTUXS_0, VCFUX_0, VCTSXS_0, and V_SETALLONES. Noticed by inspection of the generated PPCGenAsmMatcher.inc. llvm-svn: 185533
* [PowerPC] Support mtspr/mfspr in the asm parserUlrich Weigand2013-07-032-11/+20
| | | | | | | | | This adds support for the generic forms of mtspr/mfspr for the asm parser. The compiler will continue to use the specialized patters for mtlr etc. since those are needed to correctly describe data flow. llvm-svn: 185532
* [SystemZ] Fold more spillsRichard Sandiford2013-07-035-251/+369
| | | | | | | | | | | | | | | Add a mapping from register-based <INSN>R instructions to the corresponding memory-based <INSN>. Use it to cut down on the number of spill loads. Some instructions extend their operands from smaller fields, so this required a new TSFlags field to say how big the unextended operand is. This optimisation doesn't trigger for C(G)R and CL(G)R because in practice we always combine those instructions with a branch. Adding a test for every other case probably seems excessive, but it did catch a missed optimisation for DSGF (fixed in r185435). llvm-svn: 185529
* This corrects the implementation of Thumb ADR instruction. There are three ↵Mihai Popa2013-07-036-8/+46
| | | | | | | | | | issues: 1. it should accept only 4-byte aligned addresses 2. the maximum offset should be 1020 3. it should be encoded with the offset scaled by two bits llvm-svn: 185528
* ARM: relax the atomic release barrier to "dmb ishst" on SwiftTim Northover2013-07-031-1/+11
| | | | | | | | | | | Swift cores implement store barriers that are stronger than the ARM specification but weaker than general barriers. They are, in fact, just about enough to provide the ordering needed for atomic operations with release semantics. This patch makes use of that quirk. llvm-svn: 185527
* [SystemZ] Rename mapping table fieldsRichard Sandiford2013-07-032-37/+37
| | | | | | | | | | | | | Rename Function->DispKey and PairType->DispSize. I'd originally used "Function" because I thought it might be useful for other InstMappings. However, it turns out that having two very similar instructions with the same Function makes it pretty useless for anything other than the displacement size key. Other InstMappings will want the key to be defined for only one instruction in the pair. No behavioural change intended. llvm-svn: 185526
* [SystemZ] Fix caller-allocated save slot FIXMERichard Sandiford2013-07-033-46/+21
| | | | | | | Get rid of some old code (and associated FIXME) for handling the caller-allocated register save area. No behavioural change intended. llvm-svn: 185525
* Remove unused field.Eric Christopher2013-07-031-12/+19
| | | | llvm-svn: 185523
* Constify a few functions.Eric Christopher2013-07-031-3/+3
| | | | llvm-svn: 185520
* [XCore] Whitespace fixes, no functionality change.Richard Osborne2013-07-031-3/+3
| | | | llvm-svn: 185519
* [XCore] Add ISel pattern for LDWCPRichard Osborne2013-07-031-8/+7
| | | | | | Patch by Robert Lytton. llvm-svn: 185518
* Use SmallVectorImpl::const_iterator instead of SmallVector to avoid ↵Craig Topper2013-07-031-4/+4
| | | | | | specifying the vector size. llvm-svn: 185514
* Use SmallVectorImpl instead of SmallVector as method argument to avoid ↵Craig Topper2013-07-032-2/+2
| | | | | | specifying vector size. llvm-svn: 185513
* Use SmallVectorImpl instead of SmallVector for iterators and references to ↵Craig Topper2013-07-0313-37/+37
| | | | | | avoid specifying the vector size unnecessarily. llvm-svn: 185512
* Use SmallVectorImpl::iterator/const_iterator instead of SmallVector to avoid ↵Craig Topper2013-07-031-2/+2
| | | | | | specifying the vector size. llvm-svn: 185509
* Introduce some typedefs for DenseMaps containing SmallVectors so the vector ↵Craig Topper2013-07-032-7/+9
| | | | | | size doesn't have to repeated when creating iterators for the DenseMap. llvm-svn: 185508
* Return SmallVectorImpl& instead of SmallVector& in a couple places to avoid ↵Craig Topper2013-07-031-2/+2
| | | | | | having to specify the vector size in multiple places. llvm-svn: 185507
* Use SmallVectorImpl& instead of SmallVector& to avoid needlessly ↵Craig Topper2013-07-031-6/+6
| | | | | | respecifying the small vector size. llvm-svn: 185505
* Use SmallVectorImpl::iterator/const_iterator instead of SmallVector to avoid ↵Craig Topper2013-07-031-8/+8
| | | | | | specifying the vector size. llvm-svn: 185504
* Added support in FunctionAttrs for adding relevant function/argument ↵Michael Gottesman2013-07-031-0/+10
| | | | | | | | | | attributes for the posix call gettimeofday. This implies annotating it as nounwind and its arguments as nocapture. To be conservative, we do not annotate the arguments with noalias since some platforms do not have restrict on the declaration for gettimeofday. llvm-svn: 185502
* Added posix function gettimeofday to LibFunc::Func for all platforms but ↵Michael Gottesman2013-07-031-0/+2
| | | | | | | | | | | Windows. *NOTE* In a recent version of posix, they added the restrict keyword to the arguments for this function. From some spelunking it seems that on some platforms, the call has restrict on its arguments and others it does not. Thus I left off the restrict keyword from the function prototype in the comment. llvm-svn: 185501
* Avoid doing a lot of computation when we have multiple ranges andEric Christopher2013-07-031-26/+29
| | | | | | | avoid adding information for the debug_inlined section when it isn't going to be emitted anyhow. llvm-svn: 185500
* SystemZInstrInfo.cpp: Tweak an assertion. [-Wunused-variable]NAKAMURA Takumi2013-07-031-2/+2
| | | | llvm-svn: 185499
* Move iterator to where it's used and update comments.Eric Christopher2013-07-031-1/+3
| | | | llvm-svn: 185498
* Move instance variable before experimental section.Eric Christopher2013-07-031-4/+5
| | | | llvm-svn: 185497
* Fix typo to make grep for DW_AT_comp_dir work without case-insensitiveEric Christopher2013-07-031-1/+1
| | | | | | grep. llvm-svn: 185496
* Remove unnecessary forward declare.Eric Christopher2013-07-031-1/+0
| | | | llvm-svn: 185495
* Add a helpful comment.Eric Christopher2013-07-031-0/+2
| | | | llvm-svn: 185492
* addConstantValue, addConstantFPValue never returned anything butEric Christopher2013-07-032-30/+18
| | | | | | true, so remove the return value and propagate accordingly. llvm-svn: 185490
* Debug Info: use module flag to set up Dwarf version.Manman Ren2013-07-024-6/+44
| | | | | | | | Correctly handles ref_addr depending on the Dwarf version. Emit Dwarf with version from module flag. TODO: turn on/off features depending on the Dwarf version. llvm-svn: 185484
* Fix comment.Eric Christopher2013-07-021-1/+1
| | | | llvm-svn: 185480
* [PowerPC] PR16512 - Support TLS call sequences in the asm parserUlrich Weigand2013-07-022-2/+26
| | | | | | | | | This patch now adds support for recognizing TLS call sequences in the asm parser. This needs a new pattern BL8_TLS, which is like BL8_NOP_TLS except without nop. That pattern is used for the asm parser only. llvm-svn: 185478
* [PowerPC] Rework TLS call operand processingUlrich Weigand2013-07-026-23/+40
| | | | | | | | | | | | | | | | | | | | | | | | | As part of the global-dynamic and local-dynamic TLS sequences, we need to use a special form of the call instruction: bl __tls_get_addr(sym@tlsld) bl __tls_get_addr(sym@tlsgd) which generates two fixups. The current implementation of this causes problems with recognizing this form in the asm parser. To fix this, this patch reworks operand processing for this special form by using a single operand to hold both __tls_get_addr and sym@tlsld and defining a print method to output the above form, and an encoding method to generate the two fixups. As a side simplification, the patch replaces the two instruction patterns BL8_NOP_TLSGD and BL8_NOP_TLSLD by a single BL8_NOP_TLS, since the patterns already operate in an identical fashion (whether we have a local-dynamic or global-dynamic symbol is already encoded in the symbol modifier). No change in code generation intended. llvm-svn: 185477
* [PowerPC] Remove VK_PPC_TLSGD and VK_PPC_TLSLDUlrich Weigand2013-07-024-10/+4
| | | | | | | | | | | | | | | The PowerPC-specific modifiers VK_PPC_TLSGD and VK_PPC_TLSLD correspond exactly to the generic modifiers VK_TLSGD and VK_TLSLD. This causes some confusion with the asm parser, since VK_PPC_TLSGD is output as @tlsgd, which is then read back in as VK_TLSGD. To avoid this confusion, this patch removes the PowerPC-specific modifiers and uses the generic modifiers throughout. (The only drawback is that the generic modifiers are printed in upper case while the usual convention on PowerPC is to use lower-case modifiers. But this is just a cosmetic issue.) llvm-svn: 185476
* SystemZ: Fold variable into assertion.Benjamin Kramer2013-07-021-2/+2
| | | | llvm-svn: 185475
* [PowerPC] Support TLS variables in debug infoUlrich Weigand2013-07-022-0/+13
| | | | | | | | | This adds an implementation of getDebugThreadLocalSymbol for (64-bit) PowerPC. This needs to return a generic MCExpr since on ppc64, we need to add a bias of 0x8000 to the value returned by the R_PPC64_DTPREL64 relocation. llvm-svn: 185461
* [DebugInfo] Allow getDebugThreadLocalSymbol to return MCExprUlrich Weigand2013-07-024-6/+6
| | | | | | | | | | | This allows getDebugThreadLocalSymbol to return a generic MCExpr instead of just a MCSymbolRefExpr. This is in preparation for supporting debug info for TLS variables on PowerPC, where we need to describe the variable location using a more complex expression than just MCSymbolRefExpr. llvm-svn: 185460
* [DebugInfo] Hold generic MCExpr in AddrPoolUlrich Weigand2013-07-022-9/+9
| | | | | | | | | | | This changes the AddrPool infrastructure to enable it to hold generic MCExpr expressions, not just MCSymbolRefExpr. This is in preparation for supporting debug info for TLS variables on PowerPC, where we need to describe the variable location using a more complex expression than just MCSymbolRefExpr. llvm-svn: 185459
* [DebugInfo] Introduce DIEExpr variant of DIEValue to hold MCExpr valuesUlrich Weigand2013-07-025-21/+80
| | | | | | | | | | | | This partially reverts r185202 and restores DIELabel to hold plain MCSymbol references. Instead, we add a new subclass DIEExpr of DIEValue that can hold generic MCExpr references. This is in preparation for supporting debug info for TLS variables on PowerPC, where we need to describe the variable location using a more complex expression than just MCSymbolRefExpr. llvm-svn: 185458
* Debug Info: cleanupManman Ren2013-07-022-6/+8
| | | | llvm-svn: 185456
* Revert (most of) r185393 and r185395.Jakob Stoklund Olesen2013-07-022-80/+82
| | | | | | | | | | | "Remove floating point computations form SpillPlacement.cpp." These commits caused test failures in lencod on clang-native-arm-lnt. I suspect these changes are only exposing an existing issue, but reverting anyway to keep the bots passing while we investigate. llvm-svn: 185447
* Hexagon: Avoid unused variable warnings in Release builds.Benjamin Kramer2013-07-021-6/+2
| | | | llvm-svn: 185445
* [APFloat] Swap an early out check so we do not dereference str.end().Michael Gottesman2013-07-021-1/+1
| | | | | | | Originally if D.firstSigDigit == str.end(), we will have already dereferenced D.firstSigDigit in the first predicate. llvm-svn: 185437
* Remove address spaces from MC.Rafael Espindola2013-07-0218-164/+125
| | | | | | | | This is dead code since PIC16 was removed in 2010. The result was an odd mix, where some parts would carefully pass it along and others would assert it was zero (most of the object streamer for example). llvm-svn: 185436
OpenPOWER on IntegriCloud