summaryrefslogtreecommitdiff
path: root/lib/Target/PowerPC
Commit message (Collapse)AuthorAge
* Replace PPC instruction-size code with MCInstrDesc getSizeHal Finkel2014-02-02
| | | | | | | | | | As part of the cleanup done to enable the disassembler, the PPC instructions now have a valid Size description field. This can now be used to replace some custom logic in a few places to compute instruction sizes. Patch by David Wiberg! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200623 91177308-0d34-0410-b5e6-96231b3b80d8
* Delete MCSubtargetInfo data members from target MCCodeEmitter classesDavid Woodhouse2014-01-28
| | | | | | | | The subtarget info is explicitly passed to the EncodeInstruction method and we should use that subtarget info to influence any encoding decisions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200350 91177308-0d34-0410-b5e6-96231b3b80d8
* Propagate MCSubtargetInfo through TableGen's getBinaryCodeForInstr()David Woodhouse2014-01-28
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200349 91177308-0d34-0410-b5e6-96231b3b80d8
* Explictly pass MCSubtargetInfo to MCCodeEmitter::EncodeInstruction()David Woodhouse2014-01-28
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200348 91177308-0d34-0410-b5e6-96231b3b80d8
* Change MCStreamer EmitInstruction interface to take subtarget infoDavid Woodhouse2014-01-28
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200345 91177308-0d34-0410-b5e6-96231b3b80d8
* Provide a stub Target Streamer implementation for PPC MachOIain Sandoe2014-01-28
| | | | | | | | At present, this handles .tc (error) and needs to be expanded to deal properly with .machine git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200309 91177308-0d34-0410-b5e6-96231b3b80d8
* Handle spilling the PPC GPRC_NOR0 register classHal Finkel2014-01-28
| | | | | | | GPRC_NOR0 is not a subclass of GPRC (because it also contains the ZERO pseudo register). As a result, we also need to check for it in the spilling code. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200288 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r199871 and replace it with a simple check in the debug infoEric Christopher2014-01-28
| | | | | | | | | code to see if we're emitting a function into a non-default text section. This is still a less-than-ideal solution, but more contained than r199871 to determine whether or not we're emitting code into an array of comdat sections. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200269 91177308-0d34-0410-b5e6-96231b3b80d8
* Pass a MCSubtargetInfo down to the TargetStreamer creation.Rafael Espindola2014-01-26
| | | | | | | With this the target streamers will be able to know the target features that are in use. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200135 91177308-0d34-0410-b5e6-96231b3b80d8
* Construct the MCStreamer before constructing the MCTargetStreamer.Rafael Espindola2014-01-26
| | | | | | | | | | This has a few advantages: * Only targets that use a MCTargetStreamer have to worry about it. * There is never a MCTargetStreamer without a MCStreamer, so we can use a reference. * A MCTargetStreamer can talk to the MCStreamer in its constructor. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200129 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove an easy use of EmitRawText from PPC.Rafael Espindola2014-01-25
| | | | | | This makes lib/Target/PowerPC EmitRawText free. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200065 91177308-0d34-0410-b5e6-96231b3b80d8
* Add final and owerride keywords to TargetTransformInfo's subclasses.Juergen Ributzka2014-01-24
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200021 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix known typosAlp Toker2014-01-24
| | | | | | | Sweep the codebase for common typos. Includes some changes to visible function names that were misspelt. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200018 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a variable to track whether or not we've used a unique section,Eric Christopher2014-01-23
| | | | | | | | | | | | e.g. linkonce, to TargetMachine and set it when we've done so for ELF targets currently. This involved making TargetMachine non-const in a TLOF use and propagating that change around - I'm open to other ideas. This will be used in a future commit to handle emitting debug information with ranges. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199871 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix pr18515.Rafael Espindola2014-01-22
| | | | | | | | | | | | | My understanding (from reading just the llvm code) is that * most ppc cpus have a "sync n" instruction and an msync alias that is "sync 0". * "book e" cpus instead have a msync instruction and not the more general "sync n" This patch reflects that in the .td files, allowing a single codepath for asm ond obj streamer and incidentelly fixes a crash when EmitRawText was called on a obj streamer. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199832 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix pointer info on PPC byval storesHal Finkel2014-01-21
| | | | | | | | | | | For PPC64 SVR (and Darwin), the stores that take byval aggregate parameters from registers into the stack frame had MachinePointerInfo objects with incorrect offsets. These offsets are relative to the object itself, not to the stack frame base. This fixes self hosting on PPC64 when compiling with -enable-aa-sched-mi. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199763 91177308-0d34-0410-b5e6-96231b3b80d8
* Make getTargetStreamer return a possibly null pointer.Rafael Espindola2014-01-14
| | | | | | | | | This will allow it to be called from target independent parts of the main streamer that don't know if there is a registered target streamer or not. This in turn will allow targets to perform extra actions at specified points in the interface: add extra flags for some labels, extra work during finalization, etc. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199174 91177308-0d34-0410-b5e6-96231b3b80d8
* [PM] Split DominatorTree into a concrete analysis result object whichChandler Carruth2014-01-13
| | | | | | | | | | | | | | | | | | | | | | | can be used by both the new pass manager and the old. This removes it from any of the virtual mess of the pass interfaces and lets it derive cleanly from the DominatorTreeBase<> template. In turn, tons of boilerplate interface can be nuked and it turns into a very straightforward extension of the base DominatorTree interface. The old analysis pass is now a simple wrapper. The names and style of this split should match the split between CallGraph and CallGraphWrapperPass. All of the users of DominatorTree have been updated to match using many of the same tricks as with CallGraph. The goal is that the common type remains the resulting DominatorTree rather than the pass. This will make subsequent work toward the new pass manager significantly easier. Also in numerous places things became cleaner because I switched from re-running the pass (!!! mid way through some other passes run!!!) to directly recomputing the domtree. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199104 91177308-0d34-0410-b5e6-96231b3b80d8
* [cleanup] Move the Dominators.h and Verifier.h headers into the IRChandler Carruth2014-01-13
| | | | | | | | | | | | | | | | | | directory. These passes are already defined in the IR library, and it doesn't make any sense to have the headers in Analysis. Long term, I think there is going to be a much better way to divide these matters. The dominators code should be fully separated into the abstract graph algorithm and have that put in Support where it becomes obvious that evn Clang's CFGBlock's can use it. Then the verifier can manually construct dominance information from the Support-driven interface while the Analysis library can provide a pass which both caches, reconstructs, and supports a nice update API. But those are very long term, and so I don't want to leave the really confusing structure until that day arrives. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199082 91177308-0d34-0410-b5e6-96231b3b80d8
* correct target directive handling error handlingSaleem Abdulrasool2014-01-13
| | | | | | | | | | | | | | The target specific parser should return `false' if the target AsmParser handles the directive, and `true' if the generic parser should handle the directive. Many of the target specific directive handlers would `return Error' which does not follow these semantics. This change simply changes the target specific routines to conform to the semantis of the ParseDirective correctly. Conformance to the semantics improves diagnostics emitted for the invalid directives. X86 is taken as a sample to ensure that multiple diagnostics are not presented for a single error. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199068 91177308-0d34-0410-b5e6-96231b3b80d8
* Put the functionality for printing a value to a raw_ostream as anChandler Carruth2014-01-09
| | | | | | | | | | | | operand into the Value interface just like the core print method is. That gives a more conistent organization to the IR printing interfaces -- they are all attached to the IR objects themselves. Also, update all the users. This removes the 'Writer.h' header which contained only a single function declaration. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198836 91177308-0d34-0410-b5e6-96231b3b80d8
* Move the llvm mangler to lib/IR.Rafael Espindola2014-01-07
| | | | | | This makes it available to tools that don't link with target (like llvm-ar). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198708 91177308-0d34-0410-b5e6-96231b3b80d8
* Move the LLVM IR asm writer header files into the IR directory, as theyChandler Carruth2014-01-07
| | | | | | | | | | | | | | | | | are part of the core IR library in order to support dumping and other basic functionality. Rename the 'Assembly' include directory to 'AsmParser' to match the library name and the only functionality left their -- printing has been in the core IR library for quite some time. Update all of the #includes to match. All of this started because I wanted to have the layering in good shape before I started adding support for printing LLVM IR using the new pass infrastructure, and commandline support for the new pass infrastructure. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198688 91177308-0d34-0410-b5e6-96231b3b80d8
* Re-sort all of the includes with ./utils/sort_includes.py so thatChandler Carruth2014-01-07
| | | | | | | | | | subsequent changes are easier to review. About to fix some layering issues, and wanted to separate out the necessary churn. Also comment and sink the include of "Windows.h" in three .inc files to match the usage in Memory.inc. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198685 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove unnecessary #includes.Bill Wendling2014-01-06
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198585 91177308-0d34-0410-b5e6-96231b3b80d8
* Refactor function that checks that __builtin_returnaddress's argument is ↵Bill Wendling2014-01-06
| | | | | | | | | constant. This moves the check up into the parent class so that all targets can use it without having to copy (and keep in sync) the same error message. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198579 91177308-0d34-0410-b5e6-96231b3b80d8
* Emit an error message if the value passed to __builtin_returnaddress isn't a ↵Bill Wendling2014-01-05
| | | | | | | | | | constant __builtin_returnaddress requires that the value passed into is be a constant. However, at -O0 even a constant expression may not be converted to a constant. Emit an error message intead of crashing. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198531 91177308-0d34-0410-b5e6-96231b3b80d8
* Make the llvm mangler depend only on DataLayout.Rafael Espindola2014-01-03
| | | | | | | | | | | | | | Before this patch any program that wanted to know the final symbol name of a GlobalValue had to link with Target. This patch implements a compromise solution where the mangler uses DataLayout. This way, any tool that already links with Target (llc, clang) gets the exact behavior as before and new IR files can be mangled without linking with Target. With this patch the mangler is constructed with just a DataLayout and DataLayout is extended to include the information the Mangler needs. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198438 91177308-0d34-0410-b5e6-96231b3b80d8
* [PPC] Fix comment to match function nameHal Finkel2014-01-02
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198362 91177308-0d34-0410-b5e6-96231b3b80d8
* [PPC] Fix the scheduling of CR logicals on the P7Hal Finkel2014-01-02
| | | | | | | | | | | CR logicals (crand, crxor, etc.) on the P7 need to be in the first slot of each dispatch group. The old itinerary entry was just wrong (but has not mattered because we don't generate these instructions). This will matter when, in an upcoming commit, we start generating these instructions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198359 91177308-0d34-0410-b5e6-96231b3b80d8
* [PPC] Use the correct immediate operands on 64-bit instructionsHal Finkel2014-01-02
| | | | | | | | | | | Several of the 64-bit fixed-point instructions with immediate operands were using the 32-bit (i32) operand nodes instead of the corresponding 64-bit (i64) operand definitions (u16imm instead of u16imm64, for example). This error has had no effect so far, but would have caused type-checking violations with an upcoming change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198356 91177308-0d34-0410-b5e6-96231b3b80d8
* Use r2 when encoding tls on ppc32. Fixes PR18305.Roman Divacky2013-12-22
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197878 91177308-0d34-0410-b5e6-96231b3b80d8
* Add some comments.Roman Divacky2013-12-22
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197875 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement initial-exec TLS for PPC32.Roman Divacky2013-12-20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197824 91177308-0d34-0410-b5e6-96231b3b80d8
* Long doubles are required to be aligned to 128 bits and svr4 32 bits.Rafael Espindola2013-12-19
| | | | | | Clang was already getting this right. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197694 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a disassembler to the PowerPC backendHal Finkel2013-12-19
| | | | | | | | | | | | | | | | | | | | | The tests for the disassembler were adapted from the encoder tests, and for the most part, the output from the disassembler matches that encoder-test inputs. There are some places where more-informative mnemonics could be produced (notably for the branch instructions), and those cases are noted in the tests with FIXMEs. Future work includes: - Generating more-informative mnemonics when possible (this may also be done in the printer). - Remove the dependence on positional "numbered" operand-to-variable mapping (for both encoding and decoding). - Internally using 64-bit instruction variants in 64-bit mode (if this turns out to matter). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197693 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix f64 and f128 for ppc-darwin.Rafael Espindola2013-12-18
| | | | | | | | | | This patch adds -f64:32:64 to 32 bit ppc darwin since a f64 inside a structure are only 32 bit aligned. The patch also drop -f128:64:128 from all ppc darwin, since f128 is 128 bit aligned. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197574 91177308-0d34-0410-b5e6-96231b3b80d8
* One ppc32-darwin, a i64 inside a structure can have 32 bit alignment.Rafael Espindola2013-12-18
| | | | | | | | Thanks for Iain Sandoe for testing this with the original gcc. Clang was already getting this right. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197572 91177308-0d34-0410-b5e6-96231b3b80d8
* Eliminate PPC instruction decoding ambiguitiesHal Finkel2013-12-17
| | | | | | | | | | | | The instruction definitions in the PPC backend have a number of variants defined for the same instruction to represent differences between 64-bit and 32-bit semantics. In order to generate a disassembler for the PPC backend, we need to mark all but one of these as CodeGen only. No functionality change intended; this is prep work for PPC disassembly support. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197535 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix the pointer size for the PS3 datalayout.Rafael Espindola2013-12-17
| | | | | | This will be tested from clang. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197501 91177308-0d34-0410-b5e6-96231b3b80d8
* Allow MachineCSE to coalesce trivial subregister copies the same way that it ↵Andrew Trick2013-12-17
| | | | | | | | | | | | | | | | | | | | coalesces normal copies. Without this, MachineCSE is powerless to handle redundant operations with truncated source operands. This required fixing the 2-addr pass to handle tied subregisters. It isn't clear what combinations of subregisters can legally be tied, but the simple case of truncated source operands is now safely handled: %vreg11<def> = COPY %vreg1:sub_32bit; GR32:%vreg11 GR64:%vreg1 %vreg12<def> = COPY %vreg2:sub_32bit; GR32:%vreg12 GR64:%vreg2 %vreg13<def,tied1> = ADD32rr %vreg11<tied0>, %vreg12<kill>, %EFLAGS<imp-def> Test case: cse-add-with-overflow.ll. This exposed an existing bug in PPCInstrInfo::commuteInstruction. Thanks to Rafael for the test case: PowerPC/crash.ll. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197465 91177308-0d34-0410-b5e6-96231b3b80d8
* whitespaceAndrew Trick2013-12-17
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197464 91177308-0d34-0410-b5e6-96231b3b80d8
* The preferred alignment defaults to the abi alignment. Omit if it is the same.Rafael Espindola2013-12-16
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197400 91177308-0d34-0410-b5e6-96231b3b80d8
* On DataLayout, omit the default of p:64:64:64.Rafael Espindola2013-12-16
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197397 91177308-0d34-0410-b5e6-96231b3b80d8
* Set has_asmparser in PowerPC/LLVMBuild.txtHal Finkel2013-12-16
| | | | | | | PowerPC now has an asm parser (and has for many months now); indicate this in PowerPC/LLVMBuild.txt. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197393 91177308-0d34-0410-b5e6-96231b3b80d8
* [Powerpc darwin] AsmParser Base implementation.Iain Sandoe2013-12-14
| | | | | | | | | | | | | | This is a base implementation of the powerpc-apple-darwin asm parser dialect. * Enables infrastructure (essentially isDarwin()) and fixes up the parsing of asm directives to separate out ELF and MachO/Darwin additions. * Enables parsing of {r,f,v}XX as register identifiers. * Enables parsing of lo16() hi16() and ha16() as modifiers. The changes to the test case are from David Fang (fangism). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197324 91177308-0d34-0410-b5e6-96231b3b80d8
* Assume defaults to produce smaller datalayout strings.Rafael Espindola2013-12-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197249 91177308-0d34-0410-b5e6-96231b3b80d8
* test commit.Iain Sandoe2013-12-13
| | | | | | | | Amend a comment. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197237 91177308-0d34-0410-b5e6-96231b3b80d8
* typo in commentGabor Greif2013-12-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197136 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove unused multiclass from PPCInstrInfo.tdHal Finkel2013-12-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197100 91177308-0d34-0410-b5e6-96231b3b80d8