Commit Graph

10549 Commits

Author SHA1 Message Date
Bill Wendling
af33b7b4a7 The lower invoke pass needs to have unreachable code elimination run after it
because it could create such things. This fixes a MingW buildbot test failure.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110279 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-04 23:36:02 +00:00
Jakob Stoklund Olesen
1a0f91b7c5 Coalesce stack slot accesses that arise when spilling both sides of a COPY.
This helps avoid silly code:

    %R0<def = LOAD <fi#5>
    STORE <fi#5>, %R0<kill>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110266 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-04 22:35:11 +00:00
Jakob Stoklund Olesen
7536f72a97 Checkpoint SplitKit progress.
We are now at a point where we can split around simple single-entry, single-exit
loops, although still with some bugs.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110257 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-04 22:08:39 +00:00
Devang Patel
5573a7da29 Use location entry only of the location described by DBG_VALUE is valid.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110255 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-04 22:07:27 +00:00
Bill Wendling
2464d618c0 The EH prepare passes really want to be the last passes run before code-gen.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110248 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-04 21:44:13 +00:00
Devang Patel
a54e0cca4b Fix typo in comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110244 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-04 20:32:36 +00:00
Dan Gohman
9f6a6862be Change this llvm_unreachable to report_fatal_error, since it can
be triggered by valid, if dubious, IR.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110240 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-04 18:51:09 +00:00
Devang Patel
459a36bd34 While spilling live registers at the end of block check whether they are used by DBG_VALUE machine instructions or not. If a spilled register is used by DBG_VALUE machine instruction then insert a new DBG_VALUE machine instruction to encode variable's new location on stack.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110235 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-04 18:42:02 +00:00
Devang Patel
b2cf5816f9 If a variable is spilled by code generator then use DW_OP_fbreg to describe its location on stack.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110234 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-04 18:40:52 +00:00
Dan Gohman
d98af0a5b8 Eliminate unnecessary empty string literals.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110183 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-04 01:39:08 +00:00
Jakob Stoklund Olesen
bae696956b Oops. Don't normalize spill weights twice.
When the normalizeSpillWeights function was introduced, I forgot to remove this
normalization.

This change could affect register allocation. Hopefully for the better.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110119 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-03 17:21:16 +00:00
Bill Wendling
94e4008fba Early exit and reduce indentation. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110069 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-02 22:06:08 +00:00
Devang Patel
e9a1ccaf80 Free DbgScope created for dead functions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110045 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-02 17:32:15 +00:00
Oscar Fuentes
ee56c42168 Prefix next' iterator operation with llvm::'.
Fixes potential ambiguity problems on VS 2010.

Patch by nobled!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110029 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-02 06:00:15 +00:00
Eli Friedman
1d17d199a4 PR7586: Make sure we don't claim that unknown bits are actually known in the
ISD::AND case of TargetLowering::SimplifyDemandedBits.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110019 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-02 04:42:25 +00:00
Bill Wendling
57dba1cf53 Reference the personalities. Don't copy them into a new vector.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109966 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-01 01:34:21 +00:00
Eli Friedman
ad78a88711 Fix for bug reported by Evzen Muller on llvm-commits: make sure to correctly
check the range of the constant when optimizing a comparison between a
constant and a sign_extend_inreg node.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109854 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-30 06:44:31 +00:00
Benjamin Kramer
1abcd06856 Plug the remaining MC leaks by giving MCObjectStreamer/MCAsmStreamer ownership of the TargetAsmBackend and the MCCodeEmitter.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109767 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-29 17:48:06 +00:00
Dale Johannesen
c46a5f20c5 Comment typo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109765 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-29 17:45:24 +00:00
Jakob Stoklund Olesen
4bd94f7bbe Fix a bug in the -regalloc=fast handling of exotic two-address instruction with
multiple defs, like t2LDRSB_POST.

The first def could accidentally steal the physreg that the second, tied def was
required to be allocated to.

Now, the tied use-def is treated more like an early clobber, and the physreg is
reserved before allocating the other defs.

This would never be a problem when the tied def was the only def which is the
usual case.

This fixes MallocBench/gs for thumb2 -O0.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109715 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-29 00:52:19 +00:00
Jakob Stoklund Olesen
a0c5bf19bf Print out the regclass of any virtual registers used by a machine instruction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109608 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-28 18:35:46 +00:00
Devang Patel
37032350c8 It is FE's responsibility to emit proper directory name.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109538 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-27 20:51:15 +00:00
Jim Grosbach
977fa34df8 Grammar
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109525 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-27 18:36:27 +00:00
Nate Begeman
e0efc216eb Fix a crash in the dag combiner caused by ConstantFoldBIT_CONVERTofBUILD_VECTOR calling itself
recursively and returning a SCALAR_TO_VECTOR node, but assuming the input was always a BUILD_VECTOR.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109519 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-27 18:02:18 +00:00
Jim Grosbach
57cb4f8be1 80 column
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109513 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-27 17:38:47 +00:00
Jim Grosbach
ae64eedae2 fix typo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109511 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-27 17:14:29 +00:00
Bill Wendling
dfc2c51d12 It's better to have the arrays, which would trigger the creation of stack
protectors, to be near the stack protectors on the stack. Accomplish this by
tagging the stack object with a predicate that indicates that it would trigger
this. In the prolog-epilog inserter, assign these objects to the stack after the
stack protector but before the other objects.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109481 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-27 01:55:19 +00:00
Jakob Stoklund Olesen
f0179004e9 Add SplitEditor to SplitKit. This class will be used to edit live intervals and
rewrite instructions for live range splitting.

Still work in progress.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109469 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-26 23:44:11 +00:00
Dan Gohman
3eca15bdb5 Fix a use-after-free.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109468 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-26 23:40:24 +00:00
Bill Wendling
23295cc1dd Using llvm.eh.catch.all.value instead of .llvm.eh.catch.all.value.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109462 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-26 22:36:52 +00:00
Evan Cheng
e0e925efb3 The "excess register pressure" returned by HighRegPressure() is not accurate enough to factor into scheduling priority. Eliminate it and add early exits to speed up scheduling.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109449 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-26 21:49:07 +00:00
Dan Gohman
7da5d3fc65 Handle Values with no value in getCopyFromRegs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109415 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-26 18:15:41 +00:00
Dan Gohman
ce0fe5da0d A block dominates itself, by definition.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109402 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-26 17:38:15 +00:00
Duncan Sands
b3893b193b Pacify gcc-4.5 which wrongly thinks that RExcess (passed as the Excess parameter)
may be used uninitialized in the callers of HighRegPressure.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109393 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-26 07:54:17 +00:00
Lang Hames
6f4e4df100 Factored out a bit of common code to mark VNInfos for deletion.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109388 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-26 01:49:41 +00:00
Evan Cheng
e28ed16d25 Add comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109383 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-25 18:59:43 +00:00
Bob Wilson
3f92f73970 Fix crashes when scheduling a CopyToReg node -- getMachineOpcode asserts on
those.  Radar 8231572.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109367 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-25 05:34:27 +00:00
Anton Korobeynikov
8c64b9766e Add hook to insert late LLVM=>LLVM passes just before isel
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109354 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-24 20:48:54 +00:00
Bob Wilson
f28dd88611 Change ScheduleDAGInstrs::Defs and ::Uses to be variable-size vectors
instead of fixed size arrays, so that increasing FirstVirtualRegister to 16K
won't cause a compile time performance regression.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109330 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-24 06:01:53 +00:00
Devang Patel
2f58485fc8 Use current working directory when Dirname is empty. This only happens when absolute source file path is used on compiler command line.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109302 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-24 00:53:22 +00:00
Evan Cheng
70017e44cd Add an ILP scheduler. This is a register pressure aware scheduler that's
appropriate for targets without detailed instruction iterineries.
The scheduler schedules for increased instruction level parallelism in
low register pressure situation; it schedules to reduce register pressure
when the register pressure becomes high.

On x86_64, this is a win for all tests in CFP2000. It also sped up 256.bzip2
by 16%.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109300 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-24 00:39:05 +00:00
Jim Grosbach
734738d3bd Remove too-strict assertion. We may want the vreg copy of the physical register
to be of a different register class. For example, in Thumb1 if the live-in is
a high register, we want the vreg to be a low register. rdar://8224931

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109291 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-23 23:48:02 +00:00
Devang Patel
5f2f69b648 Revert r109262.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109285 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-23 23:04:41 +00:00
Evan Cheng
3144687df7 - Allow target to specify when is register pressure "too high". In most cases,
it's too late to start backing off aggressive latency scheduling when most
  of the registers are in use so the threshold should be a bit tighter.
- Correctly handle live out's and extract_subreg etc.
- Enable register pressure aware scheduling by default for hybrid scheduler.
  For ARM, this is almost always a win on # of instructions. It's runtime
  neutral for most of the tests. But for some kernels with high register
  pressure it can be a huge win. e.g. 464.h264ref reduced number of spills by
  54 and sped up by 20%.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109279 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-23 22:39:59 +00:00
Dan Gohman
cd20c6fb18 Use the proper type for shift counts. This fixes a bootstrap error.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109265 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-23 21:08:12 +00:00
Devang Patel
f83f42599d IF directory name is empty then try to extract one using absolute file name.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109262 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-23 20:36:13 +00:00
Dan Gohman
a4f4d699ec DAGCombine (shl (anyext x, c)) to (anyext (shl x, c)) if the high bits
are not demanded. This often allows the anyext to be folded away.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109242 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-23 18:03:30 +00:00
Dan Gohman
7c98283f0e Make SDNode::dump() print a newline at the end.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109234 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-23 16:37:47 +00:00
Eric Christopher
54e1791e4b 80-col.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109205 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-23 01:05:59 +00:00
Chris Lattner
134d8eec87 remove the JIT "NeedsExactSize" feature and supporting logic.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109167 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-22 21:17:55 +00:00
Gabor Greif
481c4c0734 keep in 80 cols
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109122 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-22 17:18:03 +00:00
Gabor Greif
96f1d8ebdd mass elimination of reliance on automatic iterator dereferencing
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109103 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-22 13:36:47 +00:00
Gabor Greif
a399781289 undo 80 column trespassing I caused
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109092 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-22 10:37:47 +00:00
Evan Cheng
89ba74d117 Re-apply r109079 with fix.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109083 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-22 06:24:48 +00:00
Owen Anderson
8b9177aee2 Revert r109079, which broke a lot of CodeGen tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109082 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-22 06:01:28 +00:00
Reid Kleckner
c96a82a534 Initial modifications to MCAssembler and TargetMachine for the MCJIT.
Patch by Olivier Meurant!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109080 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-22 05:58:53 +00:00
Evan Cheng
a4081238aa Initialize RegLimit only when register pressure is being tracked.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109079 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-22 05:18:41 +00:00
Evan Cheng
4a863e2c75 More register pressure aware scheduling work.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109064 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-21 23:53:58 +00:00
Jim Grosbach
917290043f For ARM/Darwin, add a dwarf entry indicating whether a function is arm or thumb
rdar://8202967

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109057 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-21 23:03:52 +00:00
Owen Anderson
d13db2c59c Fix batch of converting RegisterPass<> to INTIALIZE_PASS().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109045 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-21 22:09:45 +00:00
Jim Grosbach
1e20b96313 80 column and trailing whitespace cleanup
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109037 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-21 21:21:52 +00:00
Dan Gohman
872814ae04 Disallow null as a named metadata operand.
Make MDNode::destroy private.
Fix the one thing that used MDNode::destroy, outside of MDNode itself.

One should never delete or destroy an MDNode explicitly. MDNodes
implicitly go away when there are no references to them (implementation
details aside).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109028 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-21 18:54:18 +00:00
Lang Hames
5a8ea65c5c Changed OStream templates to functions on raw_ostream, removed the unused "renderWarnings" function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109003 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-21 09:02:06 +00:00
Evan Cheng
4f6b4674be Teach bottom up pre-ra scheduler to track register pressure. Work in progress.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108991 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-21 06:09:07 +00:00
Jakob Stoklund Olesen
f2c6e367c1 Change the createSpiller interface to take a MachineFunctionPass argument.
The spillers can pluck the analyses they need from the pass reference.

Switch some never-null pointers to references.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108969 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-20 23:50:15 +00:00
Jakob Stoklund Olesen
6a0dc079ef Implement loop splitting analysis.
Determine which loop exit blocks need a 'pre-exit' block inserted.
Recognize when this would be impossible.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108941 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-20 21:46:58 +00:00
Dale Johannesen
21d35c1399 Fix test for switch statements and increase
threshold a bit per experimentation.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108935 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-20 21:29:12 +00:00
Jakob Stoklund Olesen
abff28087f Appease the colonials.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108845 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-20 16:12:37 +00:00
Jakob Stoklund Olesen
8ae0263471 Beginning SplitKit - utility classes for live range splitting.
This is a work in progress. So far we have some basic loop analysis to help
determine where it is useful to split a live range around a loop.

The actual loop splitting code from Splitter.cpp is also going to move in here.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108842 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-20 15:41:07 +00:00
Lang Hames
6089e464dd Updated css classes for the pressure table legend.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108839 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-20 14:35:55 +00:00
Lang Hames
2725abd039 Oops - I tables render poorly in Chrome without this explicit height specification.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108824 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-20 10:29:46 +00:00
Lang Hames
f80f31eb9f Use run-length encoding to represent identical adjacent cells in the pressure
and interval table. Reduces output HTML file sizes by ~80% in my test cases.

Also fix access of private member type by << operator.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108823 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-20 10:18:54 +00:00
Lang Hames
245581b1ac Added support for turning HTML indentation on and off (indentation off by default).
Reduces output file size ~20% on my test cases.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108822 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-20 09:13:29 +00:00
Lang Hames
c4bcc778a8 Switched to rendering after allocation (but before rewriting) in PBQP.
Updated renderer to use allocation information from VirtRegMap (if
available) to render spilled intervals differently.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108815 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-20 07:41:44 +00:00
Dale Johannesen
bf1ae5e254 Don't hoist things out of a large switch inside a
loop, for the reasons in the comments.  This is a
major win on 253.perlbmk on ARM Darwin.  I expect it
to be a good heuristic in general, but it's possible
some things will regress; I'll be watching.
7940152.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108792 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-20 00:50:13 +00:00
Stuart Hastings
0db4271069 Correct line info for declarations/definitions. Radar 8063111.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108784 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-19 23:56:30 +00:00
Devang Patel
58b8176ed3 Fix memory leak reported by valgrind.
Do not visit operands of old instruction. Visit all operands of new instruction.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108767 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-19 23:25:39 +00:00
Dan Gohman
c6e59b71f5 After a custom inserter, in a block which has constant instructions,
update the current basic block in addition to the current insert
position, so that they remain consistent. This fixes rdar://8204072.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108765 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-19 22:48:56 +00:00
Evan Cheng
d70f57b254 ARM has to provide its own TargetLowering::findRepresentativeClass because its scalar floating point registers alias its vector registers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108761 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-19 22:15:08 +00:00
Evan Cheng
46dcb57e18 Teach computeRegisterProperties() to compute "representative" register class for legal value types. A "representative" register class is the largest legal super-reg register class for a value type. e.g. On i386, GR32 is the rep register class for i8 / i16 / i32; on x86_64 it would be GR64.
This property will be used by the register pressure tracking instruction scheduler.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108735 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-19 18:47:01 +00:00
Jakob Stoklund Olesen
9529a1c3dd Spillers may alter MachineLoopInfo when breaking critical edges, so make it
non-const.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108734 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-19 18:41:20 +00:00
Devang Patel
8b3a6b651e Fix PR 7662.
Do not try to insert local variable info to a DIE used for function declaration.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108731 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-19 17:53:55 +00:00
Benjamin Kramer
5907f4c385 Update CMake build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108700 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-19 15:37:03 +00:00
Lang Hames
54cc2efb4e Render MachineFunctions to HTML pages, with options to render register
pressure estimates and liveness alongside.

Still experimental.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108698 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-19 15:22:28 +00:00
Owen Anderson
54026c0f1b Remove r108639 now that it is handled by InstCombine instead.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108688 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-19 08:10:24 +00:00
Daniel Dunbar
d73ada7d24 Target: Give the TargetAsmParser access to the TargetMachine.
- Unfortunate, but necessary for now to handle subtarget instruction matching. Eventually we should factor out the lower level target machine information so we don't need to do this.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108664 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-19 00:33:49 +00:00
Daniel Dunbar
9fbb37e10d MC: Move several clients to using AsmParser constructor function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108645 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-18 18:31:33 +00:00
Douglas Gregor
806de357a5 Fix struct/class mismatch
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108642 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-18 11:47:56 +00:00
Owen Anderson
3ecdfafe3b Add a DAGCombine xform to fold away redundant float->double->float conversions around sqrt instructions.
I am assured by people more knowledgeable than me that there are no rounding issues in eliminating this.

This fixed <rdar://problem/8197504>.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108639 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-18 08:47:54 +00:00
Lang Hames
12f35c52a5 Added -pbqp-pre-coalescing flag to PBQP. If enabled this will cause PBQP to require
LoopSplitter be run prior to register allocation.

Entirely for testing purposes at the moment.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108634 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-18 00:57:59 +00:00
Bill Wendling
7490896f9d Use isPrologLabel() instead of checking the opcode directly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108628 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-17 19:18:44 +00:00
Zhongxing Xu
d3bb335144 update CMakeLists.txt
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108620 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-17 12:12:42 +00:00
Lang Hames
3b6702db0c Removed unused inRange variable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108618 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-17 11:43:07 +00:00
Lang Hames
60f422f894 LoopSplitter - intended to split live intervals over loop boundaries.
Still very much under development. Comments and fixes will be forthcoming.

(This commit includes some small tweaks to LiveIntervals & LoopInfo to support the splitter)



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108615 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-17 07:34:01 +00:00
Lang Hames
d0f6f01731 Iterating over sets of pointers in a heuristic was a bad idea. Switching
any command line paramater changed the register allocation produced by
PBQP.

Turns out variety is not the spice of life.

Fixed some comparators, added others. All good now.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108613 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-17 06:31:41 +00:00
Eric Christopher
2b8271e029 Propagate alloca alignment information via variable size object frame
information.

No functional change yet.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108583 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-17 00:28:22 +00:00
Bill Wendling
dc86704114 Consider this function:
void foo() { __builtin_unreachable(); }

It will output the following on Darwin X86:

_func1:
Leh_func_begin0:
        pushq %rbp
Ltmp0:
        movq %rsp, %rbp
Ltmp1:
Leh_func_end0:

This prolog adds a new Call Frame Information (CFI) row to the FDE with an
address that is not within the address range of the code it describes -- part is
equal to the end of the function -- and therefore results in an invalid EH
frame. If we emit a nop in this situation, then the CFI row is now within the
address range.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108568 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-16 22:51:10 +00:00
Bill Wendling
7431beaba2 Rename DBG_LABEL PROLOG_LABEL, because it's only used during prolog emission and
thus is a much more meaningful name.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108563 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-16 22:20:36 +00:00
Jakob Stoklund Olesen
af462c4b4f Remove remaining calls to TII::isMoveInstr.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108556 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-16 21:03:55 +00:00
Dan Gohman
9c3d5e41b9 Revert r108369, sorting llvm.dbg.declare information by source position,
since it doesn't work for front-ends which don't emit column information
(which includes llvm-gcc in its present configuration), and doesn't
work for clang for K&R style variables where the variables are declared
in a different order from the parameter list.

Instead, make a separate pass through the instructions to collect the
llvm.dbg.declare instructions in order. This ensures that the debug
information for variables is emitted in this order.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108538 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-16 17:54:27 +00:00
Eli Friedman
10bb4211d6 Get rid of a bunch of duplicated ELF enum values.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108520 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-16 07:53:29 +00:00
Jakob Stoklund Olesen
04c528a0c8 Remove many calls to TII::isMoveInstr. Targets should be producing COPY anyway.
TII::isMoveInstr is going tobe completely removed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108507 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-16 04:45:42 +00:00
Dan Gohman
e667e01723 Use the source-order scheduler instead of the "fast" scheduler at -O0,
because it's more likely to keep debug line information in its original
order.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108496 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-16 02:01:19 +00:00
Dale Johannesen
bdc09d9b09 The SelectionDAGBuilder's handling of debug info, on rare
occasions, caused code to be generated in a different order.
All cases I've seen involved float softening in the type
legalizer, and this could be perhaps be fixed there, but
it's better not to generate things differently in the first
place.  7797940 (6/29/2010..7/15/2010).



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108484 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-16 00:02:08 +00:00
Bill Wendling
a60f0e7f81 Revert. This isn't the correct way to go.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108478 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-15 23:42:21 +00:00
Bill Wendling
e9bf7e692e Handle code gen for the unreachable instruction if it's the only instruction in
the function. We'll just turn it into a "trap" instruction instead.

The problem with not handling this is that it might generate a prologue without
the equivalent epilogue to go with it:

$ cat t.ll
define void @foo() {
entry:
  unreachable
}
$ llc -o - t.ll -relocation-model=pic -disable-fp-elim -unwind-tables
        .section        __TEXT,__text,regular,pure_instructions
        .globl  _foo
        .align  4, 0x90
_foo:                                   ## @foo
Leh_func_begin0:
## BB#0:                                ## %entry
        pushq   %rbp
Ltmp0:
        movq    %rsp, %rbp
Ltmp1:
Leh_func_end0:
...

The unwind tables then have bad data in them causing all sorts of problems.

Fixes <rdar://problem/8096481>.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108473 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-15 23:32:40 +00:00
Evan Cheng
60108e96bb Split -enable-finite-only-fp-math to two options:
-enable-no-nans-fp-math and -enable-no-infs-fp-math. All of the current codegen fp math optimizations only care whether the fp arithmetics arguments and results can never be NaN.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108465 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-15 22:07:12 +00:00
Chris Lattner
6a624a65f4 fix the definitions of ConstTextCoalSection/ConstDataCoalSection
to keep "Text" in sync with the "pure instructions" section attribute.
Lack of this attribute was preventing the assembler from emitting
multibyte noops instructions for templates (and inlines, and other
coalesced stuff) and was causing the assembler to mismatch .o files.

This fixes rdar://8018335



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108461 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-15 21:22:00 +00:00
Bill Wendling
87ea294b0d Use std::vector instead of TargetRegisterInfo::FirstVirtualRegister.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108452 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-15 20:04:36 +00:00
Bill Wendling
24173da61d Use std::vector instead of TargetRegisterInfo::FirstVirtualRegister.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108450 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-15 20:01:02 +00:00
Bill Wendling
9c2a034730 Use std::vector instead of TargetRegisterInfo::FirstVirtualRegister. This time
make sure to allocate enough space in the std::vector.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108449 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-15 19:58:14 +00:00
Bill Wendling
e4a4147c87 Reserve a goodly amount of room for the vectors.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108448 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-15 19:41:20 +00:00
Devang Patel
07538ad975 Fix crash reported in PR7653.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108441 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-15 18:45:27 +00:00
Bill Wendling
38306d53f9 Use std::vector instead of TargetRegisterInfo::FirstVirtualRegister.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108440 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-15 18:43:09 +00:00
Bill Wendling
dfb4eeb25c Use std::vector instead of TargetRegisterInfo::FirstVirtualRegister.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108438 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-15 18:40:50 +00:00
Chris Lattner
7fa889b946 revert bill's patches in an attempt to fix the buildbot.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108419 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-15 06:51:46 +00:00
Bill Wendling
75a5b71208 Fix headers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108413 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-15 06:05:18 +00:00
Bill Wendling
e010409cab Use std::vector instead of a hard-coded array. The length of that array could
get *very* large, but we only need it to be the size of the number of pregs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108412 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-15 06:04:38 +00:00
Bill Wendling
f7f72bc1ea Use std::vector instead of a hard-coded array. The length of that array could
get *very* large, but we only need it to be the size of thenumber of pregs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108411 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-15 05:56:32 +00:00
Chris Lattner
b5b73c4c86 a more graceful fix for test/Other/inline-asm-newline-terminator.ll,
follow on to r103765


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108390 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-15 00:37:34 +00:00
Eric Christopher
723a05a66f 80-col.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108381 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-14 23:41:32 +00:00
Dan Gohman
336e8d7e7c Make the order in which variables are described in debug information
independent of the order that isel happens to visit the dbg_declare
intrinsics. This fixes a bug in which the formal arguments were
being printed in reverse order, now that fast isel is going bottom up.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108369 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-14 23:08:16 +00:00
Dan Gohman
163f78ea40 Properly restore DebugLoc after leaving the local constant area.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108364 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-14 22:01:31 +00:00
Dan Gohman
2dd50e656f Delete fast-isel's trivial load optimization; it breaks debugging because
it can look past points where a debugger might modify user variables.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108336 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-14 17:25:37 +00:00
Evan Cheng
db89809037 Teach ProcessImplicitDefs to transform more COPY instructions into IMPLICIT_DEF (and subsequently eliminate them). This allows machine LICM to hoist IMPLICIT_DEF's. PR7620.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108304 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-14 01:22:19 +00:00
Dan Gohman
a10b8494a5 Don't propagate debug locations to instructions for materializing
constants, since they may not be emited near the other instructions
which get the same line, and this confuses debug info.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108302 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-14 01:07:44 +00:00
Jakob Stoklund Olesen
d9f6ec977a Print VNInfo flags.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108277 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-13 21:19:05 +00:00
Dale Johannesen
b5611a6230 In inline asm treat indirect 'X' constraint as 'm'.
This may not be right in all cases, but it's better
than asserting which it was doing before.  PR 7528.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108268 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-13 20:17:05 +00:00
Jakob Stoklund Olesen
6382d2cadd Add an assertion to make PR7542 fail consistently.
LiveInterval::overlapsFrom dereferences end() if it is called on an empty
interval.

It would be reasonable to just return false - an empty interval doesn't overlap
anything, but I want to know who is doing it first.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108264 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-13 19:56:28 +00:00
Jakob Stoklund Olesen
186eb73845 Fix LiveInterval::overlaps so it doesn't claim touching intervals overlap.
Also, one binary search is enough.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108261 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-13 19:42:20 +00:00
Jakob Stoklund Olesen
9fac4159dd Don't add memory operands to storeRegToStackSlot / loadRegFromStackSlot results,
they already have one.

This fixes the himenobmtxpa miscompilation on ARM.

The PostRA scheduler got confused by the double memoperand and hoisted a stack
slot load above a store to the same slot.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108219 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-13 00:23:30 +00:00
Rafael Espindola
9d544d0416 Fix a typo and fit in 80 columns. Found by Bob Wilson.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108164 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-12 18:11:17 +00:00
Duncan Sands
3472766f9e Convert some tab stops into spaces.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108130 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-12 08:16:59 +00:00
Rafael Espindola
7e1b566322 Convert the last use of getPhysicalRegisterRegClass and remove it.
AggressiveAntiDepBreaker should not be using getPhysicalRegisterRegClass. An
instruction might be using a register that can only be replaced with one from
a subclass of getPhysicalRegisterRegClass.

With this patch we use getMinimalPhysRegClass. This is correct, but
conservative. We should check the uses of the register and select the
largest register class that can be used in all of them.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108122 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-12 02:55:34 +00:00
Rafael Espindola
cbeb3db8fd Don't use getPhysicalRegisterRegClass in PBQP. The existing checks that the
physical register can be allocated in the class of the virtual are sufficient.

I think that the test for virtual registers is more strict than it needs to be,
it should be possible to coalesce two virtual registers the class of one
is a subclass of the other.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108118 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-12 01:45:38 +00:00
Rafael Espindola
0bfd09201e Convert the last getPhysicalRegisterRegClass in VirtRegRewriter.cpp to
getMinimalPhysRegClass. It was used to produce spills, and it is better to
use the most specific class if possible.

Update getLoadStoreRegOpcode to handle GR32_AD.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108115 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-12 00:52:33 +00:00
Chris Lattner
7791080151 change machinelicm to use MachineInstr::isSafeToMove. No
intended functionality change.

The avoidance of hoistiing implicitdef seems wrong though.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108109 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-12 00:00:35 +00:00
Jakob Stoklund Olesen
744b3a5acd Remove TargetInstrInfo::copyRegToReg entirely.
Targets must now implement TargetInstrInfo::copyPhysReg instead. There is no
longer a default implementation forwarding to copyRegToReg.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108095 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-11 17:01:17 +00:00
Rafael Espindola
db77609991 Convert uses of getPhysicalRegisterRegClass in VirtRegRewriter.cpp.
The first one was used just to call isSafeToMoveRegClassDefs. In
general, using a more specific reg class is better, in practice only
x86 implements that method and the results are always the same.

The second one is in FindFreeRegister and is used to check if a register
is in a register class, a much more direct call to contains is better as
it should cover more cases and is faster.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108093 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-11 16:45:17 +00:00
Chandler Carruth
c5080ba0c8 Remove two other uses of ATTRIBUTE_UNUSED for variables only used within
assert()s, switching to void-casts. Removed an unneeded Compiler.h include as
a result. There are two other uses in LLVM, but they're not due to assert()s,
so I've left them alone.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108088 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-11 08:18:12 +00:00
Jakob Stoklund Olesen
e7917bb207 Use COPY for fast-isel bitconvert, but don't create cross-class copies.
This doesn't change the behavior of SelectBitcast for X86.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108073 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-11 05:16:54 +00:00
Rafael Espindola
cbeeae23c3 Fix va_arg for doubles. With this patch VAARG nodes always contain the
correct alignment information, which simplifies ExpandRes_VAARG a bit.

The patch introduces a new alignment information to TargetLoweringInfo. This is
needed since the two natural candidates cannot be used:

* The 's' in target data: If this is set to the minimal alignment of any
  argument, getCallFrameTypeAlignment would return 4 for doubles on ARM for
  example.
* The getTransientStackAlignment method. It is possible for an architecture to
  have argument less aligned than what we maintain the stack pointer.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108072 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-11 04:01:49 +00:00
Jakob Stoklund Olesen
e797e0c864 Use COPY for extracting ImplicitDef'ed values from fast-isel instructions.
This assumes that the registers can be copied which is probably a safe
assumption.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108070 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-11 03:31:05 +00:00
Jakob Stoklund Olesen
5127f79913 Use COPY in FastISel everywhere it is safe and trivial.
The remaining copyRegToReg calls actually check the return value (shock!), so we
cannot trivially replace them with COPY instructions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108069 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-11 03:31:00 +00:00
Jakob Stoklund Olesen
1e1098c6f3 Replace copyRegToReg with COPY everywhere in lib/CodeGen except for FastISel.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108062 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-10 22:42:59 +00:00
Jakob Stoklund Olesen
c0075cce7c Only collect subreg extracting copies for later coalescing.
This also avoids fatal copies from physregs.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108061 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-10 22:42:53 +00:00
Dan Gohman
a8dab36f3d Fix a bug in the code which re-inserts DBG_VALUE nodes after scheduling;
if a block is split (by a custom inserter), the insert point may be in a
different block than it was originally. This fixes 32-bit llvm-gcc
bootstrap builds, and I haven't been able to reproduce it otherwise.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108060 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-10 22:42:31 +00:00
Jakob Stoklund Olesen
92c1f72c54 Emit COPY instructions instead of using copyRegToReg in InstrEmitter,
ScheduleDAGEmit, TwoAddressLowering, and PHIElimination.

This switches the bulk of register copies to using COPY, but many less used
copyRegToReg calls remain.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108050 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-10 19:08:25 +00:00
Dan Gohman
3cd26a2909 Insert IMPLICIT_DEF instructions at the current insert position, not
at the end of the block.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108045 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-10 13:55:45 +00:00
Dan Gohman
84023e0fbe Reapply bottom-up fast-isel, with several fixes for x86-32:
- Check getBytesToPopOnReturn().
 - Eschew ST0 and ST1 for return values.
 - Fix the PIC base register initialization so that it doesn't ever
   fail to end up the top of the entry block.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108039 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-10 09:00:22 +00:00
Devang Patel
7a029b6d7e Update DBG_VALUE to refer appropriate stack slot in case of a spill.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108023 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-09 21:48:31 +00:00
Jakob Stoklund Olesen
8ea324093c Fix small bug in isMoveInstr -> COPY translation
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108013 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-09 20:55:49 +00:00
Jakob Stoklund Olesen
1f32340d95 Automatically fold COPY instructions into stack load/store.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108012 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-09 20:43:13 +00:00
Jakob Stoklund Olesen
90fc0f4443 Remat uncoalescable COPY instrs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108010 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-09 20:43:05 +00:00
Bill Wendling
8886c495a3 Clarify what mysterious check means.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108005 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-09 19:44:12 +00:00
Dan Gohman
aa7426070d Fix MachineLICM to actually visit inner loops.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108001 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-09 18:49:45 +00:00
Jakob Stoklund Olesen
e05442d508 Change TII::foldMemoryOperand API to require the machine instruction to be
inserted in a MBB, and return an already inserted MI.

This target API change is necessary to allow foldMemoryOperand to call
storeToStackSlot and loadFromStackSlot when folding a COPY to a stack slot
reference in a target independent way.

The foldMemoryOperandImpl hook is going to change in the same way, but I'll wait
until COPY folding is actually implemented. Most targets only fold copies and
won't need to specialize this hook at all.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107991 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-09 17:29:08 +00:00
Bob Wilson
02266e29f9 --- Reverse-merging r107947 into '.':
U    utils/TableGen/FastISelEmitter.cpp
--- Reverse-merging r107943 into '.':
U    test/CodeGen/X86/fast-isel.ll
U    test/CodeGen/X86/fast-isel-loads.ll
U    include/llvm/Target/TargetLowering.h
U    include/llvm/Support/PassNameParser.h
U    include/llvm/CodeGen/FunctionLoweringInfo.h
U    include/llvm/CodeGen/CallingConvLower.h
U    include/llvm/CodeGen/FastISel.h
U    include/llvm/CodeGen/SelectionDAGISel.h
U    lib/CodeGen/LLVMTargetMachine.cpp
U    lib/CodeGen/CallingConvLower.cpp
U    lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
U    lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp
U    lib/CodeGen/SelectionDAG/FastISel.cpp
U    lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
U    lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp
U    lib/CodeGen/SelectionDAG/InstrEmitter.cpp
U    lib/CodeGen/SelectionDAG/TargetLowering.cpp
U    lib/Target/XCore/XCoreISelLowering.cpp
U    lib/Target/XCore/XCoreISelLowering.h
U    lib/Target/X86/X86ISelLowering.cpp
U    lib/Target/X86/X86FastISel.cpp
U    lib/Target/X86/X86ISelLowering.h


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107987 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-09 16:37:18 +00:00
Gabor Greif
03f09a3e32 cache result of operator*
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107980 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-09 16:08:33 +00:00
Jakob Stoklund Olesen
8154f96f44 Avoid creating %physreg:subidx operands in SimpleRegisterCoalescing::RemoveCopyByCommutingDef.
This fixes PR7602.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107957 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-09 05:56:21 +00:00
Jakob Stoklund Olesen
846a31881f Deal with a few remaining spots that assume physical registers have live intervals.
This fixes PR7601.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107955 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-09 04:35:38 +00:00
Jakob Stoklund Olesen
665eb12466 Fix broken isCopy handling in TrimLiveIntervalToLastUse.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107950 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-09 01:27:21 +00:00
Jakob Stoklund Olesen
1769cccfc8 Handle COPY in VirtRegRewriter.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107949 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-09 01:27:19 +00:00
Dan Gohman
bf87e24917 Re-apply bottom-up fast-isel, with fixes. Be very careful to avoid emitting
a DBG_VALUE after a terminator, or emitting any instructions before an EH_LABEL.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107943 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-09 00:39:23 +00:00
Bob Wilson
f1d93ca920 Reenable DAG combining for vector shuffles. It looks like it was temporarily
disabled and then never turned back on again.  Adjust some tests, one because
this change avoids an unnecessary instruction, and the other to make it
continue testing what it was intended to test.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107941 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-09 00:38:12 +00:00
Stuart Hastings
99cfb69f17 Reverting r107918 and r107919. Radar 8063111.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107930 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-08 23:25:39 +00:00
Jakob Stoklund Olesen
21e9445952 Revert "Fix broken isCopy handling in TrimLiveIntervalToLastUse"
This reverts commit 107921. It broke the clang self host.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107926 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-08 22:52:47 +00:00
Devang Patel
0afbf23453 Relax assertion. In optimized code, it is possible that first instruction is coming from a inlined function.
This fixes PR7596 .



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107923 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-08 22:39:20 +00:00
Bill Wendling
c930cbcada Extension of r107506. Make sure that we don't mark a function as having a call
if the inline ASM doesn't need a stack frame.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107922 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-08 22:38:02 +00:00
Jakob Stoklund Olesen
7cc4f9cd28 Fix broken isCopy handling in TrimLiveIntervalToLastUse
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107921 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-08 22:30:38 +00:00
Stuart Hastings
c0e2639a34 Fix decl/def debug info for template functions. Radar 8063111.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107919 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-08 22:28:59 +00:00
Devang Patel
ca76f6f57c Reuse DIEInteger for 1. This is frequently used while emitting an attribute using dwarf::DW_FORM_flag form.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107903 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-08 20:10:35 +00:00
Jim Grosbach
ed903d746d Clean up scavengeRegister() a bit to prefer available regs, which allows
the simplification of frame index register scavenging to not have to check
for available registers directly and instead just let scavengeRegister()
handle it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107880 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-08 16:49:26 +00:00
Jakob Stoklund Olesen
0bc25f4040 Convert EXTRACT_SUBREG to COPY when emitting machine instrs.
EXTRACT_SUBREG no longer appears as a machine instruction. Use COPY instead.

Add isCopy() checks in many places using isMoveInstr() and isExtractSubreg().
The isMoveInstr hook will be removed later.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107879 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-08 16:40:22 +00:00
Jakob Stoklund Olesen
5c00e07795 Remove references to INSERT_SUBREG after de-SSA.
Fix X86InstrInfo::convertToThreeAddressWithLEA to generate COPY instead of
INSERT_SUBREG.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107878 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-08 16:40:15 +00:00
Benjamin Kramer
cde51108de Merge the duplicated iabs optimization in DAGCombiner and let it detected a few more idioms.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107868 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-08 12:09:56 +00:00
Jakob Stoklund Olesen
3651d92d91 Add TargetInstrInfo::copyPhysReg hook and use it from LowerSubregs.
This target hook is intended to replace copyRegToReg entirely, but for now it
calls copyRegToReg.

Any remaining calls to copyRegToReg wil be replaced by COPY instructions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107854 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-08 05:01:41 +00:00
Dan Gohman
f595141525 Revert 107840 107839 107813 107804 107800 107797 107791.
Debug info intrinsics win for now.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107850 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-08 01:00:56 +00:00
Jim Grosbach
d9642faf7c When processing frame index virtual registers, consider all available registers
(if there are any) and use the one which remains available for the longest
rather than just using the first one. This should help enable better re-use
of the loaded frame index values. rdar://7318760



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107847 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-08 00:38:54 +00:00
Dan Gohman
49dcb0f9ec Don't forward-declare registers for static allocas, which we'll
prefer to materialize as local constants. This fixes the clang
bootstrap abort.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107840 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-07 23:52:58 +00:00
Dan Gohman
61b7cea126 Fix -fast-isel-abort to check the right instruction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107839 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-07 23:47:25 +00:00
Devang Patel
8aa61477e3 One MDNode may be used to create regular DIE as well as abstract DIE.
Keep track of abstract subprogram DIEs. 


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107822 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-07 22:20:57 +00:00
Evan Cheng
bcc8017c73 Move getExtLoad() and (some) getLoad() DebugLoc argument after EVT argument for consistency sake.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107820 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-07 22:15:37 +00:00
Dan Gohman
5c480432b5 Not all custom inserters create new basic blocks. If the inserter
didn't create a new block, don't reset the insert position.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107813 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-07 21:18:22 +00:00
Devang Patel
869aa463c8 Rename couple of maps.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107810 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-07 20:49:57 +00:00
Devang Patel
6140962aba 80 cols.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107807 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-07 20:12:52 +00:00
Dan Gohman
4df83ed159 Implement bottom-up fast-isel. This has the advantage of not requiring
a separate DCE pass over MachineInstrs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107804 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-07 19:20:32 +00:00
Dan Gohman
f423a69839 Add X86FastISel support for return statements. This entails refactoring
a bunch of stuff, to allow the target-independent calling convention
logic to be employed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107800 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-07 18:32:53 +00:00
Dan Gohman
5fc3da0665 Update the insert position after scheduling, which may change the
position when emitting multiple blocks when executing a custom
inserter.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107797 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-07 18:22:13 +00:00
Devang Patel
cc87bfb59b Update comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107796 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-07 18:18:18 +00:00
Dan Gohman
643fffe429 Fix debugging strings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107795 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-07 17:28:45 +00:00
Dan Gohman
eabaed26c3 Give FunctionLoweringInfo an MBB member, avoiding the need to pass it
around everywhere, and also give it an InsertPt member, to enable isel
to operate at an arbitrary position within a block, rather than just
appending to a block.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107791 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-07 16:47:08 +00:00
Dan Gohman
a4160c3434 Simplify FastISel's constructor by giving it a FunctionLoweringInfo
instance, rather than pointers to all of FunctionLoweringInfo's
members.

This eliminates an NDEBUG ABI sensitivity.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107789 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-07 16:29:44 +00:00
Dan Gohman
4c3fd9f92f Move FunctionLoweringInfo.h out into include/llvm/CodeGen. This will
allow target-specific fast-isel code to make use of it directly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107787 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-07 16:01:37 +00:00
Dan Gohman
c9403659a9 Split the SDValue out of OutputArg so that SelectionDAG-independent
code can do calling-convention queries. This obviates OutputArgReg.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107786 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-07 15:54:55 +00:00
Dan Gohman
2f2b0abbac Move CallingConvLower.cpp out of the SelectionDAG directory.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107781 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-07 15:15:27 +00:00
Jakob Stoklund Olesen
fcb4ccd7aa Fix more places assuming subregisters have live intervals
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107780 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-07 14:41:22 +00:00
Dan Gohman
d463a74464 Add a getFirstNonPHI utility function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107778 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-07 14:33:51 +00:00
Jakob Stoklund Olesen
4b76ffc1ff Revert "Remove references to INSERT_SUBREG after de-SSA" r107725.
Buildbot breakage.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107744 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-07 00:32:25 +00:00
Jim Grosbach
c66e150b2c By default, the eh.sjlj.setjmp/longjmp intrinsics should just do nothing rather
than assuming a target will custom lower them. Targets which do so should
exlicitly mark them as having custom lowerings. PR7454.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107734 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-06 23:44:52 +00:00