summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
Commit message (Collapse)AuthorAgeFilesLines
* Fix spelling noticed by Duncan.Chandler Carruth2013-02-251-3/+3
| | | | llvm-svn: 176023
* Fix the root cause of PR15348 by correctly handling alignment 0 onChandler Carruth2013-02-252-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | memory intrinsics in the SDAG builder. When alignment is zero, the lang ref says that *no* alignment assumptions can be made. This is the exact opposite of the internal API contracts of the DAG where alignment 0 indicates that the alignment can be made to be anything desired. There is another, more explicit alignment that is better suited for the role of "no alignment at all": an alignment of 1. Map the intrinsic alignment to this early so that we don't end up generating aligned DAGs. It is really terrifying that we've never seen this before, but we suddenly started generating a large number of alignment 0 memcpys due to the new code to do memcpy-based copying of POD class members. That patch contains a bug that rounds bitfield alignments down when they are the first field. This can in turn produce zero alignments. This fixes weird crashes I've seen in library users of LLVM on 32-bit hosts, etc. llvm-svn: 176022
* Add a use of an otherwise unused variable to remove a warning in non-AssertsCameron Zwarich2013-02-241-0/+1
| | | | | | builds. llvm-svn: 175981
* TwoAddressInstructionPass::tryInstructionTransform() only potentially returnsCameron Zwarich2013-02-241-5/+4
| | | | | | | true when shouldOnlyCommute is false, so we can remove code that checks otherwise. llvm-svn: 175980
* TwoAddrInstructionPass::tryInstructionTransform() has a case where it callsCameron Zwarich2013-02-241-5/+10
| | | | | | | | | | | | | | | | itself recursively with a new instruction that has not been finalized, in order to determine whether to keep the instruction. On 'make check' and test-suite the only cases where the recursive invocation made any transformations were simple instruction commutations, so I am restricting the recursive invocation to do only this. The other cases wouldn't work correctly when updating LiveIntervals, since the new instructions don't have slot indices and LiveIntervals hasn't yet been updated. If the other transformations were actually triggering in any test case it would be possible to support it with a lot of effort, but since they don't it's not worth it. llvm-svn: 175979
* TargetInstrInfo::commuteInstruction() doesn't actually return a new instructionCameron Zwarich2013-02-231-13/+3
| | | | | | | unless it was requested to with an optional parameter that defaults to false, so we don't need to handle that case in TwoAddressInstructionPass. llvm-svn: 175974
* Make some fixes for LiveInterval repair with debug info. Debug valueCameron Zwarich2013-02-232-2/+6
| | | | | | MachineInstrs don't have a slot index. llvm-svn: 175961
* Fix a bug with the LiveIntervals updating in the two-address pass found byCameron Zwarich2013-02-231-1/+1
| | | | | | running ASCI_Purple/SMG2000 in the test-suite. llvm-svn: 175957
* Make TwoAddressInstructionPass::sink3AddrInstruction() LiveIntervals-aware.Cameron Zwarich2013-02-231-15/+34
| | | | llvm-svn: 175956
* Make rescheduleMIBelowKill() and rescheduleKillAboveMI() LiveIntervals-aware inCameron Zwarich2013-02-231-30/+85
| | | | | | | | TwoAddressInstructionPass. The code in rescheduleMIBelowKill() is a bit tricky, since multiple instructions need to be moved down, one-at-a-time, in reverse order. llvm-svn: 175955
* Use getSplitDebugFilename when constructing the skeleton cu andEric Christopher2013-02-221-4/+2
| | | | | | update testcase accordingly to give the correct name to the cu. llvm-svn: 175934
* SelectionDAG compile time improvement.Nadav Rotem2013-02-221-0/+19
| | | | | | | | One of the phases of SelectionDAG is LegalizeVectors. We don't need to sort the DAG and copy nodes around if there are no vector ops. Speeds up the compilation time of SelectionDAG on a big scalar workload by ~8%. llvm-svn: 175929
* Fix isa<> check which could never be true.Pete Cooper2013-02-221-1/+1
| | | | | | | | | | | | It was incorrectly checking a Function* being an IntrinsicInst* which isn't possible. It should always have been checking the CallInst* instead. Added test case for x86 which ensures we only get one constant load. It was 2 before this change. rdar://problem/13267920 llvm-svn: 175853
* Stop relying on physical register kill flags in isKilled() in the two-addressCameron Zwarich2013-02-211-3/+10
| | | | | | | | | | | | | | pass. One of the callers of isKilled() can cope with overapproximation of kills and the other can't, so I added a flag to indicate this. In theory this could pessimize code slightly, but in practice most physical register uses are kills, and most important kills of physical registers are the only uses of that register prior to register allocation, so we can recognize them as kills even without kill flags. This is relevant because LiveIntervals gets rid of all kill flags. llvm-svn: 175821
* Re-apply r175688, with the changes suggested by Jakob in PR15320.Lang Hames2013-02-211-24/+15
| | | | llvm-svn: 175809
* Move the eliminateCallFramePseudoInstr method from TargetRegisterInfoEli Bendersky2013-02-211-3/+2
| | | | | | | | | | | | | | | to TargetFrameLowering, where it belongs. Incidentally, this allows us to delete some duplicated (and slightly different!) code in TRI. There are potentially other layering problems that can be cleaned up as a result, or in a similar manner. The refactoring was OK'd by Anton Korobeynikov on llvmdev. Note: this touches the target interfaces, so out-of-tree targets may be affected. llvm-svn: 175788
* Make RAFast::UsedInInstr indexed by register units.Jakob Stoklund Olesen2013-02-211-22/+30
| | | | | | | | | | This fixes some problems with too conservative checking where we were marking all aliases of a register as used, and then also checking all aliases when allocating a register. <rdar://problem/13249625> llvm-svn: 175782
* Revert r175688 - It broke a test case (see PR15320).Lang Hames2013-02-211-13/+25
| | | | llvm-svn: 175765
* DAGCombiner: Make the post-legalize vector op optimization more aggressive.Benjamin Kramer2013-02-211-10/+0
| | | | | | | | A legal BUILD_VECTOR goes in and gets constant folded into another legal BUILD_VECTOR so we don't lose any legality here. The problematic PPC optimization that made this check necessary was fixed recently. llvm-svn: 175759
* Don't rely on the isDead() MachineOperand flag when updating LiveIntervals.Cameron Zwarich2013-02-211-1/+3
| | | | llvm-svn: 175732
* Use getInterval() instead of getOrCreateInterval().Cameron Zwarich2013-02-211-1/+1
| | | | llvm-svn: 175731
* Make another kill check LiveIntervals-aware.Cameron Zwarich2013-02-211-1/+1
| | | | | | | This brings the number of remaining failures in 'make check' without LiveVariables down to 39, with 1 unexpectedly passing test. llvm-svn: 175727
* Split part of isKilled() into a separate function for use elsewhere.Cameron Zwarich2013-02-211-22/+28
| | | | llvm-svn: 175726
* Update isKilledAt in TwoAddressInstructionPass.cpp to use LiveIntervals whenCameron Zwarich2013-02-211-4/+26
| | | | | | | | | | available. With this commit there are no longer any assertion or verifier failures when running 'make check' without LiveVariables. There are still 56 failing tests with codegen differences and 1 unexpectedly passing test. llvm-svn: 175719
* Don't allocate memory in LiveInterval::join().Jakob Stoklund Olesen2013-02-201-10/+7
| | | | | | | Rewrite value numbers directly in the 'Other' LiveInterval which is moribund anyway. This avoids allocating the OtherAssignments vector. llvm-svn: 175690
* Kill of TransferDeadFlag - Dead copies and subreg-to-reg instructions shouldLang Hames2013-02-201-25/+13
| | | | | | just be turned into kills on the spot. llvm-svn: 175688
* Copy single reaching defs directly into the LiveInterval.Jakob Stoklund Olesen2013-02-202-47/+76
| | | | | | | | | | | | | | | | | | When findReachingDefs() finds that only one value can reach the basic block, just copy the work list of visited blocks directly into the live interval. Sort the block list and use a LiveRangeUpdater to make the bulk add fast. When multiple reaching defs are found, transfer the work list to the updateSSA() work list as before. Also use LiveRangeUpdater in updateLiveIns() following updateSSA(). This makes live interval analysis more than 3x faster on one huge test case. llvm-svn: 175685
* Only use LiveIntervals in TwoAddressInstructionPass, not a mix of LiveintervalsCameron Zwarich2013-02-201-6/+4
| | | | | | and SlotIndexes. llvm-svn: 175674
* Find anchoring end points for repairIntervalsInRange and repairIndexesInRangeCameron Zwarich2013-02-203-12/+21
| | | | | | automatically. llvm-svn: 175673
* Make repairIntervalsInRange() more robust. There are now no longer any liveness-Cameron Zwarich2013-02-201-15/+58
| | | | | | | | | related failures when running 'make check' without LiveVariables with the verifier enabled. Some of the remaining failures elsewhere may still be fallout from incorrect updating of LiveIntervals or the few missing cases left in the two-address pass. llvm-svn: 175672
* DAGCombiner: Fold pointless truncate, bitcast, buildvector seriesArnold Schwaighofer2013-02-201-0/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | (2xi32) (truncate ((2xi64) bitcast (buildvector i32 a, i32 x, i32 b, i32 y))) can be folded into a (2xi32) (buildvector i32 a, i32 b). Such a DAG would cause uneccessary vdup instructions followed by vmovn instructions. We generate this code on ARM NEON for a setcc olt, 2xf64, 2xf64. For example, in the vectorized version of the code below. double A[N]; double B[N]; void test_double_compare_to_double() { int i; for(i=0;i<N;i++) A[i] = (double)(A[i] < B[i]); } radar://13191881 Fixes bug 15283. llvm-svn: 175670
* Update TargetLowering ivars for name policy.Jim Grosbach2013-02-201-5/+5
| | | | | | | | | | | http://llvm.org/docs/CodingStandards.html#name-types-functions-variables-and-enumerators-properly ivars should be camel-case and start with an upper-case letter. A few in TargetLowering were starting with a lower-case letter. No functional change intended. llvm-svn: 175667
* Use LiveRangeUpdater instead of mergeIntervalRanges.Jakob Stoklund Olesen2013-02-201-140/+11
| | | | | | | Performance is the same, but LiveRangeUpdater has a more flexible interface. llvm-svn: 175645
* Add a LiveRangeUpdater class.Jakob Stoklund Olesen2013-02-201-0/+200
| | | | | | | | | | | | | | | | | | Adding new segments to large LiveIntervals can be expensive because the LiveRange objects after the insertion point may need to be moved left or right. This can cause quadratic behavior when adding a large number of segments to a live range. The LiveRangeUpdater class allows the LIveInterval to be in a temporary invalid state while segments are being added. It maintains an internal gap in the LiveInterval when it is shrinking, and it has a spill area for new segments when the LiveInterval is growing. The behavior is similar to the existing mergeIntervalRanges() function, except it allocates less memory for the spill area, and the algorithm is turned inside out so the loop is driven by the clients. llvm-svn: 175644
* Fix PR15267Michael Liao2013-02-201-14/+119
| | | | | | | | | - When extloading from a vector with non-byte-addressable element, e.g. <4 x i1>, the current logic breaks. Extend the current logic to fix the case where the element type is not byte-addressable by loading all bytes, bit-extracting/packing each element. llvm-svn: 175642
* Move the SplatByte helper to APInt and generalize it a bit.Benjamin Kramer2013-02-202-29/+7
| | | | llvm-svn: 175621
* Fully qualify llvm::next to avoid ambiguity when building as C++11.David Blaikie2013-02-202-3/+4
| | | | llvm-svn: 175608
* Add support to the two-address pass for updating LiveIntervals in many of theCameron Zwarich2013-02-202-14/+102
| | | | | | | common transformations. This includes updating repairIntervalsInRange() to handle more cases. llvm-svn: 175604
* Move the computation of the IsEarlyClobber flag into its own loop, since theCameron Zwarich2013-02-201-1/+5
| | | | | | | correct value is needed in every iteration of the loop for updating LiveIntervals. llvm-svn: 175603
* Add SlotIndexes::repairIndexesInRange(), which repairs SlotIndexes after addingCameron Zwarich2013-02-202-0/+63
| | | | | | | | | | and removing instructions. The implementation seems more complicated than it needs to be, but I couldn't find something simpler that dealt with all of the corner cases. Also add a call to repairIndexesInRange() from repairIntervalsInRange(). llvm-svn: 175601
* Remove verification after PHIElimination when using LiveIntervals, and move itCameron Zwarich2013-02-202-3/+3
| | | | | | | after the two-address pass. The remaining problems in 'make check' are occurring later. llvm-svn: 175598
* Avoid recomputing an inserted instruction's SlotIndex.Cameron Zwarich2013-02-201-2/+1
| | | | llvm-svn: 175597
* Add preservation of SlotIndexes to PHIElimination.Cameron Zwarich2013-02-201-0/+1
| | | | llvm-svn: 175596
* Fix #includes, so we include only what we really need.Jakub Staszak2013-02-201-1/+1
| | | | llvm-svn: 175581
* Assert that the target provided hints are in the allocation order.Jakob Stoklund Olesen2013-02-191-0/+5
| | | | | | | | | | Target implementations of getRegAllocationHints() should use the provided allocation order, and they can never return hints outside the order. This is already documented in TargetRegisterInfo.h. <rdar://problem/13240556> llvm-svn: 175540
* Fix GCMetadaPrinter::finishAssembly not executed, patch by Yiannis Tsiouris.Benjamin Kramer2013-02-192-40/+3
| | | | | | | | | | | Due to the execution order of doFinalization functions, the GC information were deleted before AsmPrinter::doFinalization was executed. Thus, the GCMetadataPrinter::finishAssembly was never called. The patch fixes that by moving the code of the GCInfoDeleter::doFinalization to Printer::doFinalization. llvm-svn: 175528
* More const correcting of stack coloring.Craig Topper2013-02-191-8/+8
| | | | llvm-svn: 175490
* Const-correct the stack coloring code.Craig Topper2013-02-191-18/+15
| | | | llvm-svn: 175488
* Avoid extra DenseMap lookups in StackColoring::calculateLocalLiveness.Craig Topper2013-02-191-18/+32
| | | | llvm-svn: 175487
* Make the dump() function const and reduce the number of hash lookups it ↵Craig Topper2013-02-191-11/+17
| | | | | | performs. llvm-svn: 175485
OpenPOWER on IntegriCloud