Commit Graph

44025 Commits

Author SHA1 Message Date
Devang Patel
b351ebf7fc Use type's file info while describing inheritance relationship.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121289 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-08 21:46:37 +00:00
Eric Christopher
f299da8ec3 Fix comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121285 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-08 21:35:09 +00:00
Jakob Stoklund Olesen
753936602e Trim includes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121283 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-08 21:12:00 +00:00
Devang Patel
44498a640d Add support to create debug info for functions and methods.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121281 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-08 20:42:44 +00:00
Jim Grosbach
0c2c217244 Tweak ARM fixup value adjustments for Thumb to better handle the half-word
ordering of thumb mode.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121280 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-08 20:32:07 +00:00
Devang Patel
0a2551de2c Add support to create class type.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121279 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-08 20:18:20 +00:00
Andrew Trick
6b1207267f Generalize PostRAHazardRecognizer so it can be used in any pass for
both forward and backward scheduling. Rename it to
ScoreboardHazardRecognizer (Scoreboard is one word). Remove integer
division from the scoreboard's critical path.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121274 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-08 20:04:29 +00:00
Owen Anderson
cc78f5c09c Improve comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121272 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-08 19:31:11 +00:00
Jim Grosbach
022ab3779c Add initializer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121262 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-08 15:36:45 +00:00
Evan Cheng
275bf63115 Add comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121238 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-08 06:29:02 +00:00
Jakob Stoklund Olesen
cba2e06d52 Stub out RegAllocGreedy.
This new register allocator is initially identical to RegAllocBasic, but it will
receive all of the tricks that RegAllocBasic won't get.

RegAllocGreedy will eventually replace linear scan.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121234 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-08 03:26:16 +00:00
Bill Wendling
b8958b031e Add support for loading from a constant pool.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121226 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-08 01:57:09 +00:00
Devang Patel
43c249cf1e Add support to create vector, array, enums etc...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121224 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-08 01:50:15 +00:00
Jim Grosbach
5be6d2af38 Let target asm backends see assembler flags as they go by. Use that to handle
thumb vs. arm mode differences in WriteNopData().

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121219 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-08 01:16:55 +00:00
Jakob Stoklund Olesen
1b19dc1d8b Move RABasic::addMBBLiveIns to the base class, it is generally useful.
Minor optimization to the use of IntervalMap iterators. They are fairly
heavyweight, so prefer SI.valid() over SI != end().

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121217 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-08 01:06:06 +00:00
Owen Anderson
255eafbd49 Simplify the byte reordering logic slightly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121216 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-08 00:21:33 +00:00
Owen Anderson
d8e351b96f VLDR fixups need special handling under Thumb. While the encoding is the same,
the order of the bytes in the data stream is flipped around.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121215 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-08 00:18:36 +00:00
Devang Patel
94541efd92 Global variable does not need linkage name.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121212 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-08 00:06:22 +00:00
Devang Patel
48f17ba2a6 Add support to create local variable's debug info.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121211 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-07 23:58:00 +00:00
Rafael Espindola
4f4363a490 Layout each section independently. With the testcase in PR8711:
before:
        4 assembler - Number of assembler layout and relaxation steps
    78563 assembler - Number of emitted assembler fragments
  8693904 assembler - Number of emitted object file bytes
   271223 assembler - Number of evaluated fixups
330771677 assembler - Number of fragment layouts
     5958 assembler - Number of relaxed instructions
  2508361 mcexpr    - Number of MCExpr evaluations

real	0m26.123s
user	0m25.694s
sys	0m0.388s

after:

      4 assembler - Number of assembler layout and relaxation steps
  78563 assembler - Number of emitted assembler fragments
8693904 assembler - Number of emitted object file bytes
 271223 assembler - Number of evaluated fixups
 231507 assembler - Number of fragment layouts
   5958 assembler - Number of relaxed instructions
2508361 mcexpr    - Number of MCExpr evaluations

real	0m2.500s
user	0m2.113s
sys	0m0.273s

And yes, the outputs are identical :-)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121207 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-07 23:32:26 +00:00
Matt Beaumont-Gay
2bf315f087 Fix a warning about a variable which is only used in an assertion.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121206 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-07 23:26:21 +00:00
Devang Patel
fe58f95f36 Add support to create variables, structs etc.. using DIBuilder.
This is still work in progress.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121205 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-07 23:25:47 +00:00
Jakob Stoklund Olesen
953af2c3c5 Switch LiveIntervalUnion from std::set to IntervalMap.
This speeds up RegAllocBasic by 20%, not counting releaseMemory which becomes
way faster.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121201 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-07 23:18:47 +00:00
Bill Wendling
d832fa053b Cleanup in the Darwin end. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121198 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-07 23:11:00 +00:00
Evan Cheng
06d65f5156 Fix a bad prologue / epilogue codegen bug where the compiler would emit illegal
vpush instructions to save / restore VFP / NEON registers like this:
vpush {d8,d10,d11}
vpop {d8,d10,d11}

vpush and vpop do not allow gaps in the register list.
rdar://8728956


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121197 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-07 23:08:38 +00:00
Bill Wendling
52e635ea35 A bit of cleanup: early exit ApplyFixup and cache the Fixup offset. No
functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121195 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-07 23:05:20 +00:00
Jim Grosbach
d967cd096a Binary encoding for ARM tLDRspi and tSTRspi.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121186 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-07 21:50:47 +00:00
Owen Anderson
bdf714450b Fix Thumb2 encoding of the S bit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121182 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-07 20:50:15 +00:00
Jim Grosbach
97a884d602 Refactor the ARM CMPz* patterns to just use the normal CMP instructions when
possible. They were duplicates for everything exception the source pattern
before.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121179 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-07 20:41:06 +00:00
Evan Cheng
52f21e35e8 Code clean up; no functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121176 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-07 20:11:46 +00:00
Evan Cheng
9801b5c822 Code clean up; no functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121172 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-07 19:59:34 +00:00
Dan Gohman
a6399ae089 Remove the code from Function::dropAllReferences which replaced
uses of the function's blocks with undef. This code isn't needed,
because BasicBlock's destructor handles such uses. Also, undef isn't
correct, since blockaddresses may still be used for comparisons
with null.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121170 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-07 19:56:51 +00:00
Bruno Cardoso Lopes
bd3af09cef Remove target specific node MipsISD::CMov, which is not used because all conditional moves are directly matched using tablegen patterns. If there's a need in the future, we can introduce it again
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121164 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-07 19:04:14 +00:00
Bruno Cardoso Lopes
ab8d53a56a Match a pattern generated by a dag combiner opt where:
(select (load (load tga0)) (load tga1)) => (load (select (load tga0) tga1))

Thanks to Akira for pointing that.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121163 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-07 19:00:20 +00:00
Jakob Stoklund Olesen
2b38c51f0e Simplify assertion.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121162 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-07 18:51:27 +00:00
Michael J. Spencer
c20beb9cc5 Support: Remove Alarm. It is unused (via local grep and google code search).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121160 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-07 18:41:59 +00:00
Michael J. Spencer
12ccf67457 Support/PathV2: Remove const from bool return types.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121157 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-07 18:12:07 +00:00
Jim Grosbach
5169220624 Encode the literal field for tCMPzi instruction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121153 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-07 17:48:24 +00:00
Rafael Espindola
545b77ef50 Fix absolute recording of differences of symbols in two sections. Reduced from ctor_dtor_count-2.cpp.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121152 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-07 17:12:32 +00:00
Michael J. Spencer
5029159fbe Support/PathV2: Change most functions in the path namespace to return their work
via their return value instead of an out parameter.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121149 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-07 17:04:04 +00:00
Daniel Dunbar
dc3b906173 build: Go back to dropping __eprintf reference when building with Clang, see
comment.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121146 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-07 16:29:44 +00:00
Benjamin Kramer
6aa4943599 Add parens to pacify gcc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121142 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-07 15:50:35 +00:00
Frits van Bommel
8e8cdc8fe0 Remove some dead code from the jump threading pass.
The last uses of these functions were removed in r113852 when LazyValueInfo was permanently enabled and removed the need for them.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121133 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-07 13:08:07 +00:00
Jay Foad
40f8f6264d PR5207: Change APInt methods trunc(), sext(), zext(), sextOrTrunc() and
zextOrTrunc(), and APSInt methods extend(), extOrTrunc() and new method
trunc(), to be const and to return a new value instead of modifying the
object in place.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121120 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-07 08:25:19 +00:00
Owen Anderson
0ea112f104 Don't leak the mutex when loading dynamic libraries.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121119 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-07 07:56:20 +00:00
Rafael Espindola
3b3148f864 Fix relocations with weak definitions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121114 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-07 05:57:28 +00:00
Chris Lattner
1945d58025 reapply r121100 with a tweak to constant fold ConstExprs with TargetData
(if available) as we go so that we get simple constantexprs not insane ones.
This fixes the failure of clang/test/CodeGenCXX/virtual-base-ctor.cpp
that the previous iteration of this patch had.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121111 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-07 04:33:29 +00:00
Michael J. Spencer
ca3a339d76 Support/PathV2: Cleanup separator handling.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121110 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-07 03:57:48 +00:00
Michael J. Spencer
936671b2ea Support/PathV2: Remove the error_code return type from all functions in the path
namespace. None of them return anything except for success anyway. These will be
converted to returning their result soon.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121109 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-07 03:57:37 +00:00
Michael J. Spencer
ee271d8758 Support/PathV2: Move make_absolute from path to fs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121108 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-07 03:57:17 +00:00
Rafael Espindola
bf60dad984 Fix pcrel relocations that cross sections.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121107 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-07 03:50:14 +00:00
NAKAMURA Takumi
63fbb52163 lib/Target/X86/X86MCAsmInfo.cpp: [PR8741] On Win64, specify explicit PrivateGlobalPrefix as ".L".
Or, global symbols @Lxxxx might be treated as temporal symbol by MCSymbol.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121103 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-07 02:43:45 +00:00
Eric Christopher
6a3e305326 Temporarily revert r121100 as it's causing clang to fail
CodeGenCXX/virtual-base-ctor.cpp.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121102 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-07 02:41:11 +00:00
Chris Lattner
fb431099c5 fix PR8710 - teach global opt that some constantexprs are too complex to
put in a global variable's initializer.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121100 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-07 01:59:32 +00:00
Jakob Stoklund Olesen
1fe045279b Remove unused member.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121098 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-07 01:32:45 +00:00
Michael J. Spencer
69cbbbf005 Support/Unix/PathV2: Return the real error from realpath instead of any error
that close or unlink set.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121094 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-07 01:23:39 +00:00
Michael J. Spencer
79c3c3a1de Support/Unix/PathV2: Use 0770 instead of 0700 when creating a directory. Also use
the standard macros instead of octal notation.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121093 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-07 01:23:29 +00:00
Michael J. Spencer
fbd1bbd7fa Support/PathV2: Use SmallVector::clear instead of set_size.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121092 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-07 01:23:19 +00:00
Michael J. Spencer
ad8a14f24e Support/PathV2: Clarify and correct documentation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121091 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-07 01:23:08 +00:00
Michael J. Spencer
1522fce477 Support/PathV2: Move current_path from path to fs and fix the Unix implementation.
Unix bug spotted by Dan Gohman.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121090 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-07 01:22:31 +00:00
Rafael Espindola
f10d2be573 Fix a crash reduced from gcc produced assembly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121085 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-07 01:09:54 +00:00
Owen Anderson
eb6779c5b9 Second attempt at converting Thumb2's LDRpci, including updating the gazillion places that need to know about it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121082 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-07 00:45:21 +00:00
Rafael Espindola
85f2ecc697 Sorry for such a large commit. The summary is that only MachO cares about the
actuall addresses in a .o file, so it is better to let the MachO writer compute
it.

This is good for two reasons. First, areas that shouldn't care about
addresses now don't have access to it. Second, the layout of each section
is independent. I should use this in a subsequent commit to speed it up.

Most of the patch is just removing the section address computation. The two
interesting parts are the change on how we handle padding in the end
of sections and how MachO can get the address of a-b when a and b are in
different sections.

Since now the expression evaluation normally doesn't know the section address,
it will think that a-b needs relocation and let the MachO writer know. Once
it has computed the section addresses, it calls back the expression evaluation
with the section addresses to resolve these expressions.

The remaining problem is the handling of padding. Currently it will create
a special alignment fragment at the end. Since that fragment doesn't update
the alignment of the section, it needs the real address to be computed.

Since now the layout will not compute a-b with a and b in different sections,
the only effect that the special alignment fragment has is update the
address size of the section. This can also be done by the MachO writer.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121076 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-07 00:27:36 +00:00
Jim Grosbach
662a816e89 Add fixup for Thumb1 BL/BLX instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121072 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-06 23:57:07 +00:00
Frits van Bommel
6033b346e2 Implement jump threading of 'indirectbr' by keeping track of whether we're looking for ConstantInt*s or BlockAddress*s.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121066 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-06 23:36:56 +00:00
Devang Patel
b7313e274c Undefined value in reg 0 may need a marker to identify end of source range.
This will be used to truncate live range of DBG_VALUE instruction by register allocator and friends.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121061 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-06 22:48:22 +00:00
Devang Patel
afeaae7a94 If dbg_declare() or dbg_value() is not lowered by isel then emit DEBUG message instead of creating DBG_VALUE for undefined value in reg0.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121059 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-06 22:39:26 +00:00
Rafael Espindola
22373b230a Use references to simplify the code a bit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121050 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-06 22:30:54 +00:00
Wesley Peck
a3b2200472 Adding bug fix that was suppose to be part of 121044.
patch contributed by Jack Whitham!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121049 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-06 22:19:28 +00:00
Wesley Peck
dc80380de8 Fixed reversed operands for IDIV and CMP instructions in MBlaze backend.
Use BRAD instead of BRD for indirect branches in MBlaze backend.

patch contributed by Jack Whitham!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121044 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-06 22:06:49 +00:00
Jason W Kim
56a399023a Refactor ELFObjectWriter.
+ ARM/X86/MBlaze now share a common RecordRelocation
+ ARM/X86/MBlaze arch specific routines are limited to GetRelocType()



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121043 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-06 21:57:34 +00:00
Chris Lattner
f51a6cc5bf replace a linear scan with a symtab lookup, reduce indentation.
No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121042 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-06 21:53:07 +00:00
Rafael Espindola
1dda29bdff use getSymbolOffset.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121041 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-06 21:51:55 +00:00
Chris Lattner
29d8d6b039 Use a stronger predicate here, pointed out by Duncan
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121040 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-06 21:48:10 +00:00
Chris Lattner
a9d4da85d6 add some DEBUG statements.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121038 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-06 21:13:51 +00:00
Wesley Peck
1e8cdd599c Fix a 16-bit immediate value detection bug in the MBlaze delay slot filler.
Address more hazards in the MBlaze delay slot filler.

patch contributed by Jack Whitham!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121037 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-06 21:11:01 +00:00
Rafael Espindola
f96d17b886 Another use of getSymbolOffset.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121034 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-06 19:55:05 +00:00
Rafael Espindola
179821ac1f Remove the instruction fragment to data fragment lowering since it was causing
freed data to be read. I will open a bug to track it being reenabled.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121028 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-06 19:08:48 +00:00
Owen Anderson
c76c59840b Revert r121021, which broke the buildbots.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121026 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-06 18:57:40 +00:00
Jim Grosbach
ba3368ceae Trailing whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121024 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-06 18:47:44 +00:00
Owen Anderson
4c386fc754 Improve handling of Thumb2 PC-relative loads by converting LDRpci (and friends) to Pseudos.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121021 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-06 18:35:51 +00:00
Jim Grosbach
04f74942f2 Encode the register operand of ARM CondCode operands correctly. ARM::CPSR if
the instruction is predicated, reg0 otherwise.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121020 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-06 18:30:57 +00:00
Jim Grosbach
d67641b6f8 The ARM AsmMatcher needs to know that the CCOut operand is a register value,
not an immediate. It stores either ARM::CPSR or reg0.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121018 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-06 18:21:12 +00:00
Rafael Espindola
0bbe0b440e Second try at making direct object emission produce the same results
as llc + llvm-mc. This time ELF is not changed and I tested that llvm-gcc
bootstrap on darwin10 using darwin9's assembler and linker.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121006 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-06 17:27:56 +00:00
Rafael Espindola
6d86492f5e Revert previous two patches while I try to find out how to make both
linux and darwin assemblers happy :-(

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121004 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-06 15:35:15 +00:00
Rafael Espindola
2303c9dd69 Add an EmitAbsValue helper method and use it in cases where we want to be sure
that no relocations are used (on MochO).
Fixes llc producing different output from llc + llvm-mc.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121000 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-06 14:53:14 +00:00
Chris Lattner
6c3ee0f3c9 Fix PR8735, a really terrible problem in the inliner's "alloca merging"
optimization.

Consider:
static void foo() {
  A = alloca
  ...
}

static void bar() {
  B = alloca
  ...
  call foo();
}

void main() {
  bar()
}

The inliner proceeds bottom up, but lets pretend it decides not to inline foo
into bar.  When it gets to main, it inlines bar into main(), and says "hey, I
just inlined an alloca "B" into main, lets remember that.  Then it keeps going
and finds that it now contains a call to foo.  It decides to inline foo into
main, and says "hey, foo has an alloca A, and I have an alloca B from another
inlined call site, lets reuse it".  The problem with this of course, is that 
the lifetime of A and B are nested, not disjoint.

Unfortunately I can't create a reasonable testcase for this: the one in the
PR is both huge and extremely sensitive, because you minor tweaks end up
causing foo to get inlined into bar too early.  We already have tests for the
basic alloca merging optimization and this does not break them.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120995 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-06 07:52:42 +00:00
Chris Lattner
39add23dc5 improve comment
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120994 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-06 07:43:04 +00:00
Chris Lattner
7d32b8032d improve -debug output and comments a little.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120993 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-06 07:38:40 +00:00
Michael J. Spencer
476d2f769e Support/Windows: Make MinGW happy.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120991 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-06 06:02:07 +00:00
Michael J. Spencer
753cbbbd3c Support/FileSystem: Add directory_iterator implementation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120989 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-06 04:28:42 +00:00
Michael J. Spencer
f150e7695e Support/PathV2: Fix append to not add a slash to empty or root paths.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120988 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-06 04:28:23 +00:00
Michael J. Spencer
7eec50bf4f Support/Windows: Add ScopedHandle and move some clients over to it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120987 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-06 04:28:13 +00:00
Che-Liang Chiou
f964486771 ptx: add shift instructions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120982 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-06 04:00:03 +00:00
Rafael Espindola
f8803fe417 Remove the getAddress getter, initialize Ordinal in the constructor and use
that on the ELF writer to detect a section we created.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120981 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-06 03:48:09 +00:00
Rafael Espindola
f3faf92636 Simplify a bit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120980 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-06 03:36:43 +00:00
Rafael Espindola
81d8ea5bd2 Use getSymbolOffset on the COFF writer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120979 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-06 03:24:04 +00:00
Rafael Espindola
340a7a1c8f Don't use PadSectionToAlignment on windows.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120978 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-06 03:03:44 +00:00
Rafael Espindola
ffd902bfb7 Add a getSymbolOffset method and use it in the ELF writer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120977 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-06 02:57:26 +00:00
Chris Lattner
cc10244d77 Fix PR8728, a miscompilation I recently introduced. When optimizing
memcpy's like:
  memcpy(A, B)
  memcpy(A, C)

we cannot delete the first memcpy as dead if A and C might be aliases.
If so, we actually get:

  memcpy(A, B)
  memcpy(A, A)

which is not correct to transform into:

  memcpy(A, A)

This patch was heavily influenced by Jakub Staszak's patch in PR8728, thanks
Jakub!



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120974 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-06 01:48:06 +00:00