summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
Commit message (Collapse)AuthorAgeFilesLines
* MIR Parser: Use source locations for MBB naming errors.Alex Lorenz2015-07-082-6/+20
| | | | | | | | | This commit changes the type of the field 'Name' in the struct 'yaml::MachineBasicBlock' from 'std::string' to 'yaml::StringValue'. This change allows the MIR parser to report errors related to the MBB name with the proper source locations. llvm-svn: 241718
* early exits -> less indenting; NFCISanjay Patel2015-07-081-23/+22
| | | | llvm-svn: 241716
* [SEH] Ensure that empty __except blocks have their own BBReid Kleckner2015-07-081-3/+3
| | | | | | | | | The 32-bit lowering assumed that WinEHPrepare had this invariant. WinEHPrepare did it for C++, but not SEH. The result was that we would insert calls to llvm.x86.seh.restoreframe in normal basic blocks, which corrupted the frame pointer. llvm-svn: 241699
* Remove IsLittleEndian from TargetLowering and redirect to DataLayoutMehdi Amini2015-07-084-13/+14
| | | | | | | | | | | | | | | | Summary: This change is part of a series of commits dedicated to have a single DataLayout during compilation by using always the one owned by the module. Reviewers: echristo Subscribers: llvm-commits, rafael, yaron.keren Differential Revision: http://reviews.llvm.org/D11017 From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 241655
* Redirect DataLayout from TargetMachine to Module in SjLjEHPrepareMehdi Amini2015-07-082-9/+5
| | | | | | | | | | | | | | | | Summary: This change is part of a series of commits dedicated to have a single DataLayout during compilation by using always the one owned by the module. Reviewers: echristo Subscribers: yaron.keren, rafael, llvm-commits Differential Revision: http://reviews.llvm.org/D11009 From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 241654
* [WinEH] Make llvm.x86.seh.restoreframe work for stack realignment prologuesReid Kleckner2015-07-072-2/+2
| | | | | | | | | | The incoming EBP value points to the end of a local stack allocation, so we can use that to restore ESI, the base pointer. Once we do that, we can use local stack allocations. If we know we need stack realignment, spill the original frame pointer in the prologue and reload it after restoring ESI. llvm-svn: 241648
* Redirect DataLayout from TargetMachine to Module in StackProtectorMehdi Amini2015-07-071-1/+1
| | | | | | | | | | | | | | | | Summary: This change is part of a series of commits dedicated to have a single DataLayout during compilation by using always the one owned by the module. Reviewers: echristo Subscribers: llvm-commits, rafael, yaron.keren Differential Revision: http://reviews.llvm.org/D11010 From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 241646
* MIR Printer: Use a module slot tracker to print global address operands. NFC.Alex Lorenz2015-07-071-13/+12
| | | | | | | | | This commit adopts the 'ModuleSlotTracker' class, which was surfaced in r240842, to print the global address operands. This change ensures that the slot tracker won't have to be recreated every time a global address operand is printed, making the MIR printing more efficient. llvm-svn: 241645
* [WinEH] Add localaddress intrinsic instead of using frameaddressReid Kleckner2015-07-071-9/+8
| | | | | | | Clang uses this for SEH finally. The new intrinsic will produce the right value when stack realignment is required. llvm-svn: 241643
* Rename llvm.frameescape and llvm.framerecover to localescape and localrecoverReid Kleckner2015-07-076-19/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Initially, these intrinsics seemed like part of a family of "frame" related intrinsics, but now I think that's more confusing than helpful. Initially, the LangRef specified that this would create a new kind of allocation that would be allocated at a fixed offset from the frame pointer (EBP/RBP). We ended up dropping that design, and leaving the stack frame layout alone. These intrinsics are really about sharing local stack allocations, not frame pointers. I intend to go further and add an `llvm.localaddress()` intrinsic that returns whatever register (EBP, ESI, ESP, RBX) is being used to address locals, which should not be confused with the frame pointer. Naming suggestions at this point are welcome, I'm happy to re-run sed. Reviewers: majnemer, nicholas Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D11011 llvm-svn: 241633
* MIR Serialization: Serialize the 'dead' register machine operand flag.Alex Lorenz2015-07-074-2/+11
| | | | llvm-svn: 241624
* Redirect DataLayout from TargetMachine to Module in SelectionDAGMehdi Amini2015-07-0712-142/+145
| | | | | | | | | | | | | | | | | | | | Summary: SelectionDAG itself is not invoking directly the DataLayout in the TargetMachine, but the "TargetLowering" class is still using it. I'll address it in a following commit. This change is part of a series of commits dedicated to have a single DataLayout during compilation by using always the one owned by the module. Reviewers: echristo Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D11000 From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 241618
* Redirect DataLayout from TargetMachine to Module in GlobalMergeMehdi Amini2015-07-071-13/+16
| | | | | | | | | | | | | | | | Summary: This change is part of a series of commits dedicated to have a single DataLayout during compilation by using always the one owned by the module. Reviewers: echristo Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D10987 From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 241615
* Redirect DataLayout from TargetMachine to Module in CodeGen PrepareMehdi Amini2015-07-071-27/+28
| | | | | | | | | | | | | | | | Summary: This change is part of a series of commits dedicated to have a single DataLayout during compilation by using always the one owned by the module. Reviewers: echristo Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D10986 From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 241614
* Redirect DataLayout from TargetMachine to Module in FastISelMehdi Amini2015-07-071-1/+1
| | | | | | | | | | | | | | | | Summary: This change is part of a series of commits dedicated to have a single DataLayout during compilation by using always the one owned by the module. Reviewers: echristo Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D10985 From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 241613
* Redirect DataLayout from TargetMachine to Module in MachineFunctionMehdi Amini2015-07-071-20/+20
| | | | | | | | | | | | | | | | Summary: This change is part of a series of commits dedicated to have a single DataLayout during compilation by using always the one owned by the module. Reviewers: echristo Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D10984 From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 241610
* MIR Parser: wrap 'MBBSlots' from the MI parsing functions in a struct. NFC.Alex Lorenz2015-07-073-33/+32
| | | | | | | | | | | This commit modifies the interface for the machine instruction parsing functions by wrapping the parameter 'MBBSlots' in a new structure called 'PerFunctionMIParsingState'. This change is useful as in the future I will be able to pass new parameters to the machine instruction parser just by modifying the 'PerFunctionMIParsingState' structure instead of adding a new parameter to each function. llvm-svn: 241607
* MIR Parser: Verify the implicit machine register operands.Alex Lorenz2015-07-071-5/+88
| | | | | | | | | | | | This commit verifies that the parsed machine instructions contain the implicit register operands as specified by the MCInstrDesc. Variadic and call instructions aren't verified. Reviewers: Duncan P. N. Exon Smith Differential Revision: http://reviews.llvm.org/D10781 llvm-svn: 241537
* [StackMap Liveness] Calling the base class' getAnalysisUsage method. NFCI.Juergen Ributzka2015-07-071-2/+1
| | | | | | | | Calling into the base class' getAnalysisUsage method after we did our pass specific modifications. This shouldn't really matter since this is the last pass in the pipeline anyways. llvm-svn: 241536
* [StackMap Liveness] No need to cache the MachineFunction. NFC.Juergen Ributzka2015-07-071-22/+20
| | | | | | Don't cache the MachineFunction in the pass and range'ify some loops. llvm-svn: 241535
* [FaultMaps] Add statistic to count the # of implicit null checks.Sanjoy Das2015-07-061-0/+8
| | | | llvm-svn: 241521
* MIR Serialization: Serialize the implicit register flag.Alex Lorenz2015-07-064-21/+54
| | | | | | | | | | | | | | This commit serializes the implicit flag for the register machine operands. It introduces two new keywords into the machine instruction syntax: 'implicit' and 'implicit-def'. The 'implicit' keyword is used for the implicit register operands, and the 'implicit-def' keyword is used for the register operands that have both the implicit and the define flags set. Reviewers: Duncan P. N. Exon Smith Differential Revision: http://reviews.llvm.org/D10709 llvm-svn: 241519
* Remove JumpInstrTableInfo.h as it is no longer used.Eric Christopher2015-07-061-1/+0
| | | | llvm-svn: 241517
* [WinEH] Insert the EH code load before the block terminatorReid Kleckner2015-07-061-1/+1
| | | | | | | The previous code put the load after the terminator, leading to invalid IR and downstream crashes. This caused http://crbug.com/506446. llvm-svn: 241509
* [TwoAddressInstructionPass] Rename a variable to match the coding style.Quentin Colombet2015-07-061-4/+4
| | | | | | Spot by Bruno. llvm-svn: 241505
* llc: Add a 'run-pass' option.Alex Lorenz2015-07-062-12/+16
| | | | | | | | | | | | | | | This commit adds a 'run-pass' option to llc, which instructs the compiler to run one specific code generation pass only. Llc already has the 'start-after' and the 'stop-after' options, and this new option complements the other two by making it easier to write tests that want to invoke a single pass only. Reviewers: Duncan P. N. Exon Smith Differential Revision: http://reviews.llvm.org/D10776 llvm-svn: 241476
* use range-based for loops; NFCISanjay Patel2015-07-061-10/+8
| | | | llvm-svn: 241468
* use range-based for loops; NFCISanjay Patel2015-07-061-8/+6
| | | | llvm-svn: 241463
* IR: Do not consider available_externally linkage to be linker-weak.Peter Collingbourne2015-07-051-3/+1
| | | | | | | | | | | | | | | From the linker's perspective, an available_externally global is equivalent to an external declaration (per isDeclarationForLinker()), so it is incorrect to consider it to be a weak definition. Also clean up some logic in the dead argument elimination pass and clarify its comments to better explain how its behavior depends on linkage, introduce GlobalValue::isStrongDefinitionForLinker() and start using it throughout the optimizers and backend. Differential Revision: http://reviews.llvm.org/D10941 llvm-svn: 241413
* [TargetLowering] StringRefize asm constraint getters.Benjamin Kramer2015-07-051-4/+3
| | | | | | | | There is some functional change here because it changes target code from atoi(3) to StringRef::getAsInteger which has error checking. For valid constraints there should be no difference. llvm-svn: 241411
* use valid bits to avoid unnecessary machine trace metric recomputationsSanjay Patel2015-07-041-5/+10
| | | | | | | | | Although this does cut the number of traces recomputed by ~10% for the test case mentioned in http://reviews.llvm.org/D10460, it doesn't make a dent in the overall performance. That example needs to be more selective when invalidating traces. llvm-svn: 241393
* Initialize booleans CallsUnwindInit and CallsEHReturn with false instead of 0.Yaron Keren2015-07-031-4/+4
| | | | llvm-svn: 241324
* Fix an overly aggressive assertion in getCopyFromPartsVector.Nadav Rotem2015-07-021-2/+3
| | | | | | | | | | | The assertion in getCopyFromPartsVector assumed that the vector 'part' must match the type of argument (arguments are potentially split into multiple parts). However, in some cases the targets return a 'part' of the right size but with a different type. We already handle this case correctly later on and generate a bitcast. This commit just makes sure that we are actually checking the property that we care about. llvm-svn: 241312
* Use function attribute "trap-func-name" and remove TargetOptions::TrapFuncName.Akira Hatanaka2015-07-023-9/+5
| | | | | | | | | | | | | | | | | | This commit changes normal isel and fast isel to read the user-defined trap function name from function attribute "trap-func-name" attached to llvm.trap or llvm.debugtrap instead of from TargetOptions::TrapFuncName. This is needed to use clang's command line option "-ftrap-function" for LTO and enable changing the trap function name on a per-call-site basis. Out-of-tree projects currently using TargetOptions::TrapFuncName to specify the trap function name should attach attribute "trap-func-name" to the call sites of llvm.trap and llvm.debugtrap instead. rdar://problem/21225723 Differential Revision: http://reviews.llvm.org/D10832 llvm-svn: 241305
* Reapply r240291: Fix shl folding in DAG combiner.Pawel Bylica2015-07-021-1/+1
| | | | | | | | The code responsible for shl folding in the DAGCombiner was assuming incorrectly that all constants are less than 64 bits. This patch simply changes the way values are compared. It has been reverted previously because of some problems with comparing APInt with raw uint64_t. That has been fixed/changed with r241204. llvm-svn: 241254
* [NFC] Make the Statepoint class more like CallSiteSanjoy Das2015-07-021-3/+3
| | | | | | | | | | Summary: Rename some methods to make Statepoint look more like CallSite. Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D10756 llvm-svn: 241235
* [TwoAddressInstructionPass] Try 3 Addr Conversion After Commuting.Quentin Colombet2015-07-011-2/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | TwoAddressInstructionPass stops after a successful commuting but 3 Addr conversion might be good for some cases. Consider: int foo(int a, int b) { return a + b; } Before this commit, we emit: addl %esi, %edi movl %edi, %eax ret After this commit, we try 3 Addr conversion: leal (%rsi,%rdi), %eax ret Patch by Volkan Keles <vkeles@apple.com>! Differential Revision: http://reviews.llvm.org/D10851 llvm-svn: 241206
* [WinEH] Use llvm.x86.seh.recoverfp in WinEHPrepareReid Kleckner2015-07-011-40/+48
| | | | | | | | | | | Don't pattern match for frontend outlined finally calls on non-x64 platforms. The 32-bit runtime uses a different funclet prototype. Now, the frontend is pre-outlining the finally bodies so that it ends up doing most of the heavy lifting for variable capturing. We're just outlining the callsite, and adapting the frameaddress(0) call to line up the frame pointer recovery. llvm-svn: 241186
* add a cl::opt override for TargetLoweringBase's JumpIsExpensiveSanjay Patel2015-07-011-1/+12
| | | | | | | | | | | | | This patch is not intended to change existing codegen behavior for any target. It just exposes the JumpIsExpensive setting on the command-line to allow for easier testing and emergency overrides. Also, change the existing regression test to use FileCheck, explicitly specify the jump-is-expensive option, and use more precise checks. Differential Revision: http://reviews.llvm.org/D10846 llvm-svn: 241179
* Revert "[DWARF] Fix debug info generation for function static variables, ↵David Blaikie2015-07-016-62/+35
| | | | | | | | | | typedefs, and records" Caused PR24008 This reverts commit 37cb5f1c2db9f42d29f26b215585f56bb64ae4f5. llvm-svn: 241176
* LivePhysRegs: Add support to add pristine registers when populating with ↵Matthias Braun2015-07-011-0/+41
| | | | | | | | live-in/live-out registers. Differential Revision: http://reviews.llvm.org/D10139 llvm-svn: 241172
* [AsmPrinter] Hide implementation detailsBenjamin Kramer2015-07-014-6/+6
| | | | | | NFC. llvm-svn: 241169
* [SDAG] Give InstrEmitter hidden visibilityBenjamin Kramer2015-07-011-1/+1
| | | | | | NFC. llvm-svn: 241165
* [CodeGen] Reduce visibility of implementation detailsBenjamin Kramer2015-07-018-11/+11
| | | | | | NFC. llvm-svn: 241164
* [DWARF] Fix debug info generation for function static variables, typedefs, ↵Michael Kuperstein2015-07-016-35/+62
| | | | | | | | | | | | | | | and records Function static variables, typedefs and records (class, struct or union) declared inside a lexical scope were associated with the function as their parent scope, rather than the lexical scope they are defined or declared in. This fixes PR19238 Patch by: amjad.aboud@intel.com Differential Revision: http://reviews.llvm.org/D9758 llvm-svn: 241153
* [SEH] Add new intrinsics for recovering and restoring parent framesReid Kleckner2015-06-302-15/+26
| | | | | | | | | | | | | | | | | | | | | | | | | The incoming EBP value established by the runtime is actually a pointer to the end of the EH registration object, and not the true parent function frame pointer. Clang doesn't need llvm.x86.seh.exceptioninfo anymore because we know that the exception info pointer is at a fixed offset from this incoming EBP. The llvm.x86.seh.recoverfp intrinsic takes an EBP value provided by the EH runtime and returns a pointer that is usable with llvm.framerecover. The llvm.x86.seh.restoreframe intrinsic is inserted by the 32-bit specific preparation pass in blocks targetted by the EH runtime. It re-establishes any physical registers used by the parent function to address the stack, such as the frame, base, and stack pointers. Neither of these intrinsics correctly handle stack realignment prologues yet, but it's possible to add that later. Reviewers: majnemer Differential Revision: http://reviews.llvm.org/D10848 llvm-svn: 241125
* [FaultMaps] Let the frontend pre-select implicit null check candidates.Sanjoy Das2015-06-301-0/+7
| | | | | | | | | | | | | | | | | | Summary: This change introduces a !make.implicit metadata that allows the frontend to pre-select the set of explicit null checks that will be considered for transformation into implicit null checks. The reason for not using profiling data instead of !make.implicit is explained in the change to `FaultMaps.rst`. Reviewers: atrick, reames, pgavlin, JosephTremoulet Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D10824 llvm-svn: 241116
* COFF: Do not assign linker-weak symbols to selectany comdat sections.Peter Collingbourne2015-06-301-2/+0
| | | | | | | | | | | | | | It is mandatory to specify a comdat in order to receive comdat semantics for a symbol. We were previously getting this wrong in -function-sections mode; linker-weak symbols were being emitted in a selectany comdat. This change causes such symbols to use a noduplicates comdat instead, fixing the inconsistency. Also correct an inaccuracy in the docs. Differential Revision: http://reviews.llvm.org/D10828 llvm-svn: 241103
* Fix compilation failure introduced in r241093.Alex Lorenz2015-06-301-2/+2
| | | | llvm-svn: 241096
* MIR Serialization: Serialize MBB successors.Alex Lorenz2015-06-304-3/+52
| | | | | | | | | | | | | This commit implements serialization of the machine basic block successors. It uses a YAML flow sequence that contains strings that have the MBB references. The MBB references in those strings use the same syntax as the MBB machine operands in the machine instruction strings. Reviewers: Duncan P. N. Exon Smith Differential Revision: http://reviews.llvm.org/D10699 llvm-svn: 241093
OpenPOWER on IntegriCloud