Eric Christopher
c1451d764f
Don't lower splat vector load to relative to the esp if the
...
stack may be misaligned.
Update test accordingly.
Patch by Evan Cheng!
llvm-svn: 94291
2010-01-23 06:02:43 +00:00
Chris Lattner
1deb09c28d
mcstreamerize .no_dead_strip and .reference for static ctors/dtors.
...
llvm-svn: 94290
2010-01-23 05:51:36 +00:00
Eric Christopher
ba7cd4c393
Reapply 94059 while fixing the calling convention setup
...
for strcpy.
llvm-svn: 94287
2010-01-23 05:29:06 +00:00
Chris Lattner
b065f1bc31
remove unneeded directive set.
...
llvm-svn: 94286
2010-01-23 05:28:25 +00:00
Chris Lattner
5241cde324
use some helpers instead of duplicating logic.
...
llvm-svn: 94285
2010-01-23 05:26:25 +00:00
Chris Lattner
4225a7b987
mcize jump table and constant pool entry labels, .local on elf,
...
and some .weak directives.
llvm-svn: 94284
2010-01-23 05:19:23 +00:00
Chris Lattner
68eeb5ec9c
emit .ascii and .asciz through MCStreamer.
...
llvm-svn: 94282
2010-01-23 04:54:10 +00:00
Chris Lattner
531732b23c
simplify code a bit.
...
llvm-svn: 94281
2010-01-23 04:42:42 +00:00
Mon P Wang
e04b4567f8
InstCombine should not fold sext/zext of a vector and a bitcast to a scalar to a sext/zext
...
llvm-svn: 94280
2010-01-23 04:35:57 +00:00
Ted Kremenek
4a1aa119a3
Update CMake build.
...
llvm-svn: 94278
2010-01-23 04:01:37 +00:00
Chris Lattner
c3f23b84ea
remove one form of EmitString, just use EmitBytes instead. We must
...
be careful to add a \0 at the end though, because EmitString didn't
do this.
llvm-svn: 94277
2010-01-23 03:11:46 +00:00
Sean Callanan
5051cb8010
Added the skeleton for the implementation of the X86
...
target-specific AsmLexer, and added the appropriate
registration calls.
llvm-svn: 94275
2010-01-23 02:43:15 +00:00
Sean Callanan
86c1181c3d
Modified the register matcher function in AsmMatcher to
...
be static. Also made it possible for clients to get it
and no other functions from ...GenAsmMatcher.inc by
defining REGISTERS_ONLY before including GenAsmMatcher.inc.
This sets the stage for target-specific lexers that can
identify registers and return AsmToken::Register as
appropriate.
llvm-svn: 94266
2010-01-23 00:40:33 +00:00
Devang Patel
0e44c51a3e
Avoid using "Type" as the variable name.
...
llvm-svn: 94262
2010-01-23 00:26:28 +00:00
Victor Hernandez
5006e43faf
In mem2reg, for all alloca/stores that get promoted where the alloca has an associated llvm.dbg.declare instrinsic, insert an llvm.dbg.var intrinsic before each store
...
llvm-svn: 94260
2010-01-23 00:17:34 +00:00
Chris Lattner
ded9af63bb
teach MCAsmStreamer::EmitBytes to use .ascii and .asciz
...
llvm-svn: 94259
2010-01-23 00:15:00 +00:00
Victor Hernandez
73b0f99f17
Make sure ValueFn starts off empty
...
llvm-svn: 94256
2010-01-23 00:03:28 +00:00
Evan Cheng
c22893a3b7
Enable pre-regalloc scheduling load clustering by default.
...
llvm-svn: 94255
2010-01-22 23:49:45 +00:00
Evan Cheng
16cf934381
Be more conservative with clustering f32 / f64 loads.
...
llvm-svn: 94254
2010-01-22 23:49:11 +00:00
Chris Lattner
6f2d99df03
move "EOL" from asmprinter to dwarfprinter. It should eventually
...
be completely eliminated, but today is not that day.
llvm-svn: 94253
2010-01-22 23:47:11 +00:00
Chris Lattner
56940ab899
remove uses of EOL.
...
llvm-svn: 94252
2010-01-22 23:43:14 +00:00
Chris Lattner
7859b1c226
add a new EmitCFAByte method and use it.
...
llvm-svn: 94251
2010-01-22 23:40:08 +00:00
Chris Lattner
fa82355f33
move uleb printing from asmprinter to dwarfprinter, mcize,
...
cleanup and eliminate a bunch more uses of "EOL".
llvm-svn: 94250
2010-01-22 23:18:42 +00:00
Jeffrey Yasskin
690818fc27
Make OProfile support compile again after r93630 removed
...
DebugLocTuple. Also use an AssertingVH to ensure that MDNodes aren't
destroyed while the FilenameCache is using them.
llvm-svn: 94245
2010-01-22 23:04:39 +00:00
Chris Lattner
2303145081
move sleb printing out of asmprinter into dwarf printer, make clients
...
handle the comment better, MCize the non-.sleb case.
llvm-svn: 94244
2010-01-22 22:56:55 +00:00
Devang Patel
ac277eb930
Remove MetadataBase class because it is not adding significant value.
...
llvm-svn: 94243
2010-01-22 22:52:10 +00:00
Dale Johannesen
7048797468
Ignore DEBUG_VALUE when building live intervals;
...
this makes the code work transparently the same
whether they're there or not.
llvm-svn: 94240
2010-01-22 22:38:21 +00:00
Chris Lattner
edf96a4cc3
add a new DwarfPrinter::EmitEncodingByte method which handles
...
pretty printing encoding comments and eliminates redundancy on
the client side. We now get pretty dwarf like this again:
.byte 255 ## @LPStart Encoding = omit
.byte 0 ## @TType Encoding = absptr
.byte 0x28 ## @TType base offset
.byte 3 ## Call site Encoding = udata4
.byte 0x1a ## Call site table size
...
llvm-svn: 94239
2010-01-22 22:38:16 +00:00
Chris Lattner
69bb026835
rename the dwarf class to DwarfPrinter. This matches the filename
...
and much more accurately describes what it is all about.
llvm-svn: 94233
2010-01-22 22:23:57 +00:00
Chris Lattner
00a6ae240e
fix indentation
...
llvm-svn: 94232
2010-01-22 22:19:51 +00:00
Chris Lattner
f5c834fce1
inline away the trivial AsmPrinter::EOL() method.
...
llvm-svn: 94230
2010-01-22 22:09:00 +00:00
Chris Lattner
13037516aa
inline AsmPrinter::PrintHex into its two trivial callers.
...
llvm-svn: 94228
2010-01-22 21:57:56 +00:00
Chris Lattner
978e2f02a8
change this to be a static function instead of a method on asmprinter.
...
llvm-svn: 94227
2010-01-22 21:50:41 +00:00
Chris Lattner
00562558ab
make the loop comment printer print out a much better structured
...
output. An example:
.align 4, 0x90
LBB1_5: ## %while.cond3
## Parent Loop BB1_1 Depth=1
## => This Loop Header: Depth=2
## Child Loop BB1_8 Depth 3
## Child Loop BB1_6 Depth 3
llvm-svn: 94225
2010-01-22 21:43:28 +00:00
Chris Lattner
1386a88c95
Changes to fix buffering that I forgot to commit with previous patch.
...
llvm-svn: 94222
2010-01-22 21:16:10 +00:00
Chris Lattner
e567c8e67f
For blocks that are not loop headers, just print their loop depth and header BB.
...
For loop headers, print Inner loop along with the other stuff so it doesn't take
an extra line. We now get stuff like this:
LBB1_4: ## %land.end
## in Loop: Header=BB1_1 Depth=1
notb %al
testb $1, %al
jne LBB1_8
and:
LBB1_6: ## %while.cond7
## Inner Loop Header: Depth=3
## Inside Loop BB1_5 Depth 2
## Inside Loop BB1_1 Depth 1
which still isn't great for loop headers, but is much less verbose.
llvm-svn: 94221
2010-01-22 21:11:06 +00:00
Chris Lattner
23e43dbba1
reenable the label loop comments and switch them to use the formatted
...
comment emission stuff. I'm going to rewrite this though because the
current output doesn't make sense.
llvm-svn: 94215
2010-01-22 21:00:45 +00:00
Daniel Dunbar
862023fcb2
Mark EH_RETURN64 as CodeGenOnly.
...
llvm-svn: 94205
2010-01-22 20:16:37 +00:00
Benjamin Kramer
3838dfbaea
Another strncmp -> StringRef.startswith simplification.
...
llvm-svn: 94203
2010-01-22 20:00:21 +00:00
Chris Lattner
a3eee3cb69
Convert some more random-comment-printing stuff to use
...
AddComment and GetCommentOS. Add a blank line between globals
(even in non-verbose mode) to make the assembly more readable.
llvm-svn: 94202
2010-01-22 19:52:01 +00:00
Chris Lattner
8fa0e35f97
add a new MCAsmStreamer::GetCommentOS method to simplify stuff
...
that doesn't want to use twines.
llvm-svn: 94199
2010-01-22 19:17:48 +00:00
Bob Wilson
6c0c8d41b4
Revert 94059. It is breaking the MultiSource/Benchmarks/Prolangs-C/bison
...
test on ARM.
llvm-svn: 94198
2010-01-22 19:16:40 +00:00
Chris Lattner
efcadd659d
add missing break, PR6114, patch by M Wahab.
...
llvm-svn: 94197
2010-01-22 19:11:53 +00:00
Victor Hernandez
016b286758
Fix/strengthen verification of llvm.dbg.declare
...
llvm-svn: 94195
2010-01-22 19:06:12 +00:00
Victor Hernandez
5f8c8c034a
Keep ignoring pointer-to-pointer bitcasts
...
llvm-svn: 94194
2010-01-22 19:05:05 +00:00
Chris Lattner
e5f7214fac
use both the Mangler and the CBE's mangler for identifiers,
...
this should fix a problem duncan saw handling symbols with '.' in them.
llvm-svn: 94192
2010-01-22 18:33:00 +00:00
Chris Lattner
e1d8a319a1
rename addComment -> AddComment for consistency.
...
llvm-svn: 94190
2010-01-22 18:21:35 +00:00
Benjamin Kramer
94b993ed8a
Simplify some uses of str(n)cmp with StringRef.
...
llvm-svn: 94189
2010-01-22 18:21:23 +00:00
Torok Edwin
fbcd2c76d5
Fix TimeValue::now() on Unix.
...
TimeValue()::now().toEpochTime() is supposed to be the same as time(),
but it wasn't, because toEpoch subtracted PosixZeroTime, but now()
didn't add PosixZeroTime!
Add a unittest to check this works.
llvm-svn: 94178
2010-01-22 15:51:31 +00:00
Dan Gohman
6f08fa70c1
Revert r94066, which was the patch which added a Verifier pass after
...
LoopStrengthReduce, as it's causing too much trouble (even with the
old LoopStrengthReduce code).
llvm-svn: 94172
2010-01-22 10:48:28 +00:00
Chris Lattner
cfa5ebc336
add comment support to the rest of the directives.
...
llvm-svn: 94168
2010-01-22 07:36:39 +00:00
Chris Lattner
e649401824
stop using strtoll, it gives windows heartburn.
...
llvm-svn: 94167
2010-01-22 07:34:12 +00:00
Chris Lattner
38e9219f71
Add the ability for MCStreamer to emit comments on the same line as directives.
...
Switch over the asm-verbose comment for double values to use it. We now get:
_x:
.long 343597384 ## double 1.231200e+02
.long 1079953326
For example, note that the comment is on the same line as the .long. Woo.
llvm-svn: 94166
2010-01-22 07:29:22 +00:00
Chris Lattner
0522eb2160
pass "-fasm-verbose" into createAsmStreamer.
...
llvm-svn: 94165
2010-01-22 07:06:15 +00:00
Chris Lattner
7ba0661f27
Stop building RTTI information for *most* llvm libraries. Notable
...
missing ones are libsupport, libsystem and libvmcore. libvmcore is
currently blocked on bugpoint, which uses EH. Once it stops using
EH, we can switch it off.
This #if 0's out 3 unit tests, because gtest requires RTTI information.
Suggestions welcome on how to fix this.
llvm-svn: 94164
2010-01-22 06:49:46 +00:00
Chris Lattner
5264fce147
give PassNameParser a home.
...
llvm-svn: 94162
2010-01-22 06:29:25 +00:00
Chris Lattner
aec33da793
add an out-of-line virtual method to CmpInst to give it a home.
...
llvm-svn: 94161
2010-01-22 06:25:37 +00:00
Chris Lattner
c7a8eaf614
elimiante the dynamic_cast's from opt.
...
llvm-svn: 94160
2010-01-22 06:03:06 +00:00
Chris Lattner
e0701f987f
drop the pass name from the output.
...
llvm-svn: 94158
2010-01-22 05:52:51 +00:00
Chris Lattner
0b1c7235aa
eliminate dynamic_cast from this file.
...
llvm-svn: 94157
2010-01-22 05:46:59 +00:00
Chris Lattner
9efd4fcceb
eliminate a bunch more unneeded dynamic_cast's.
...
llvm-svn: 94156
2010-01-22 05:37:10 +00:00
Chris Lattner
2fa26e5fd0
eliminate a bunch of dynamic_cast's.
...
llvm-svn: 94155
2010-01-22 05:24:46 +00:00
Chris Lattner
21889d7337
eliminate a bunch of dynamic_cast's.
...
llvm-svn: 94154
2010-01-22 04:55:08 +00:00
Evan Cheng
9d92aaabf1
Teach pre-regalloc scheduler to schedule loads from nearby addresses. It may improve cache locality. This is controlled by -cluster-loads for now.
...
llvm-svn: 94148
2010-01-22 03:36:51 +00:00
Evan Cheng
4f026f3750
Add two target hooks to determine whether two loads are near and should be scheduled together.
...
llvm-svn: 94147
2010-01-22 03:34:51 +00:00
Chris Lattner
81e2b9a237
add new file
...
llvm-svn: 94132
2010-01-22 01:58:44 +00:00
Chris Lattner
5b0e01c54e
move some files out of the llvm-mc tool into the MCParser library so
...
other tools can link it.
llvm-svn: 94131
2010-01-22 01:58:08 +00:00
Chris Lattner
9a184b368b
forgot to svn add these, doh.
...
llvm-svn: 94130
2010-01-22 01:55:10 +00:00
Chris Lattner
00646cfbd4
create a new MCParser library and move some stuff into it.
...
llvm-svn: 94129
2010-01-22 01:44:57 +00:00
Chris Lattner
88c46d713b
stub out a new TargetAsmLexer interface.
...
llvm-svn: 94125
2010-01-22 00:58:59 +00:00
Dan Gohman
045f81981a
Revert LoopStrengthReduce.cpp to pre-r94061 for now.
...
llvm-svn: 94123
2010-01-22 00:46:49 +00:00
Jim Grosbach
267430f74d
Fix PR5694. The CMN instructions set the flags differently from CMP, so they
...
cannot be directly interchanged for comparisons against negated values.
Disable the CMN instructions for the time being.
llvm-svn: 94119
2010-01-22 00:08:13 +00:00
Victor Hernandez
7b151e9f06
No need to look through bitcasts for DbgInfoIntrinsic
...
llvm-svn: 94114
2010-01-21 23:09:12 +00:00
Victor Hernandez
ae4d949721
DbgInfoIntrinsic no longer appear in an instruction's use list
...
llvm-svn: 94113
2010-01-21 23:08:36 +00:00
Victor Hernandez
5f5abd598c
No need to look through bitcasts for DbgInfoIntrinsic
...
llvm-svn: 94112
2010-01-21 23:07:15 +00:00
Victor Hernandez
1df65186d1
DbgInfoIntrinsics no longer appear in an instruction's use list; so clean up looking for them in use iterations and remove OnlyUsedByDbgInfoIntrinsics()
...
llvm-svn: 94111
2010-01-21 23:05:53 +00:00
Dan Gohman
b1ee154b6b
When inserting expressions for post-increment users which contain
...
loop-variant components, adds must be inserted after the increment.
Keep track of the increment position for this case, and insert
these adds in the correct location.
llvm-svn: 94110
2010-01-21 23:01:22 +00:00
Dan Gohman
cb8d577eb2
Include IVUsers information in LSR's debug output.
...
llvm-svn: 94108
2010-01-21 22:46:32 +00:00
Dan Gohman
29916e023d
Prune the search for candidate formulae if the number of register
...
operands exceeds the number of registers used in the initial
solution, as that wouldn't lead to a profitable solution anyway.
llvm-svn: 94107
2010-01-21 22:42:49 +00:00
Evan Cheng
32bfe1e837
Trim unneeded includes.
...
llvm-svn: 94105
2010-01-21 21:44:43 +00:00
Dan Gohman
c903499ff8
Add a comment.
...
llvm-svn: 94104
2010-01-21 21:31:09 +00:00
Chris Lattner
24716b6c63
It turns out that this #include is needed because otherwise
...
ValueMapper.cpp ends up calling an out of line
__ZNK4llvm12PATypeHolder3getEv, which is a template and llvm-config
determines arbitrarily to use the one in libipo. This sucks, but
keeping the #include is a reasonable workaround.
llvm-svn: 94103
2010-01-21 21:29:25 +00:00
Chris Lattner
9889b4be04
unbreak the build, apparently without this transformutils starts depending on libipa?
...
llvm-svn: 94102
2010-01-21 21:20:51 +00:00
Chris Lattner
e39837d5ee
tidy up
...
llvm-svn: 94101
2010-01-21 21:05:54 +00:00
Chris Lattner
5522f05d32
tidy up
...
llvm-svn: 94100
2010-01-21 21:01:47 +00:00
Chris Lattner
43f2eecffa
remove dead .erase.
...
llvm-svn: 94098
2010-01-21 20:43:39 +00:00
Jim Grosbach
143f7eb4c8
back this out for now. Growing Function is not good.
...
llvm-svn: 94097
2010-01-21 20:10:22 +00:00
Chris Lattner
3785c11cd4
fix a problem with a missing _, testcase pending.
...
llvm-svn: 94095
2010-01-21 19:58:19 +00:00
Victor Hernandez
a9ad174b49
Don't need to include IntrinsicInst.h any more
...
llvm-svn: 94092
2010-01-21 19:33:59 +00:00
Victor Hernandez
d089f4e10b
No need to map NULL operands of metadata
...
llvm-svn: 94091
2010-01-21 19:26:20 +00:00
Dan Gohman
9b85ae26b1
Make the parser include the lower level error message in its own error
...
message, to be more informative.
llvm-svn: 94072
2010-01-21 10:15:06 +00:00
Dan Gohman
7c6759094a
Avoid printing a spurious semicolon when there is no filename.
...
llvm-svn: 94071
2010-01-21 10:13:27 +00:00
Dan Gohman
60a9bf414e
When re-using an existing cast for a user, it's still necessary to call
...
rememberInstruction so that future users of that user will be inserted
in the correct position. This fixes the Darwin selfhost.
llvm-svn: 94070
2010-01-21 10:08:42 +00:00
Nick Lewycky
9e26c1cc0c
Fix a crasher trying to fold each element in a comparison between two vectors
...
if one of the vectors didn't have elements (such as undef). Fixes PR 6096.
Fix an issue in the constant folder where fcmp (<2 x %ty>, <2 x %ty>) would
have <2 x i1> type if constant folding was successful and i1 type if it wasn't.
This exposed a related issue in the bitcode reader.
llvm-svn: 94069
2010-01-21 07:03:21 +00:00
Dan Gohman
55a365e797
Run the verifier after LSR, to help catch use-before-def errors before
...
they reach codegen.
llvm-svn: 94066
2010-01-21 03:51:36 +00:00
Dan Gohman
51ad99d2c5
Re-implement the main strength-reduction portion of LoopStrengthReduction.
...
This new version is much more aggressive about doing "full" reduction in
cases where it reduces register pressure, and also more aggressive about
rewriting induction variables to count down (or up) to zero when doing so
reduces register pressure.
It currently uses fairly simplistic algorithms for finding reuse
opportunities, but it introduces a new framework allows it to combine
multiple strategies at once to form hybrid solutions, instead of doing
all full-reduction or all base+index.
llvm-svn: 94061
2010-01-21 02:09:26 +00:00
Eric Christopher
fa863258d0
Add strcpy_chk -> strcpy support for "don't know" object size
...
answers. This will update as object size checking gets better information.
llvm-svn: 94059
2010-01-21 01:04:38 +00:00
Evan Cheng
5d30f7c91c
Fix a minor issue in x86 load / store folding table. movups does an unaligned load so it doesn't require 16-byte alignment.
...
llvm-svn: 94058
2010-01-21 00:55:14 +00:00
Jim Grosbach
e029a6a5ed
Make sure that landing pad entries in the EH call site table are in the proper
...
order for SjLj style exception handling.
llvm-svn: 94055
2010-01-21 00:43:30 +00:00
Chris Lattner
3c5bf71353
simplify this code.
...
llvm-svn: 94048
2010-01-20 23:30:28 +00:00
Jim Grosbach
d7cf27a1d1
SjLj EH introduces can introduce an additional edge to a landing pad and pad
...
normalization needs to take this into account.
llvm-svn: 94046
2010-01-20 23:03:55 +00:00
Chris Lattner
32fb9564bc
eliminate FnStubInfo, using MachineModuleInfoMachO instead.
...
this makes function stub emission determinstic.
llvm-svn: 94033
2010-01-20 21:36:48 +00:00
Dale Johannesen
c5db599813
make findDebugLoc a class method
...
llvm-svn: 94032
2010-01-20 21:36:02 +00:00
Chris Lattner
2f7c279257
split function stub printing out to its own function,
...
no functionality change.
llvm-svn: 94030
2010-01-20 21:19:44 +00:00
Chris Lattner
1ff4794cbb
eliminate the GVStubs and HiddenGVStubs maps, and use
...
MachineModuleInfoMachO instead. This eliminates two sources
of nondeterministic output in the ppc backend, but function
stubs are still bad.
llvm-svn: 94029
2010-01-20 21:16:14 +00:00
Chris Lattner
1edfeb2c46
don't forget to initialize an instance variable!
...
llvm-svn: 94021
2010-01-20 20:48:59 +00:00
David Greene
0985160c54
When XDEBUG is enabled, check for SelectionDAG cycles at some key
...
points. This will help us find future problems like the one
described in PR6019.
llvm-svn: 94019
2010-01-20 20:13:31 +00:00
Chris Lattner
da363d9af8
adopt getAdjustedAnalysisPointer in a few more passes.
...
llvm-svn: 94018
2010-01-20 20:09:02 +00:00
Chris Lattner
3b03327c14
adopt getAdjustedAnalysisPointer in two more passes.
...
llvm-svn: 94017
2010-01-20 19:53:32 +00:00
Chris Lattner
397af34e6f
adopt getAdjustedAnalysisPointer in BasicCallGraph.
...
llvm-svn: 94015
2010-01-20 19:51:46 +00:00
Chris Lattner
af362f014d
add some new methods to adjust this pointers. Not used yet.
...
llvm-svn: 94013
2010-01-20 19:26:14 +00:00
Chris Lattner
c47ece59a8
don't send null pointers through the constantexpr codepath unneededly.
...
llvm-svn: 94010
2010-01-20 17:57:50 +00:00
Chris Lattner
6a7939243f
reduce redundant are's.
...
llvm-svn: 94008
2010-01-20 17:53:51 +00:00
Jakob Stoklund Olesen
8a19d3c96c
Move per-function inline threshold calculation to a method.
...
No functional change except the forgotten test for
InlineLimit.getNumOccurrences() == 0 in the CurrentThreshold2 calculation.
llvm-svn: 94007
2010-01-20 17:51:28 +00:00
Chris Lattner
9fc980403e
use getGlobalDirective(), don't hardcode .globl. PR6093
...
llvm-svn: 94006
2010-01-20 17:50:30 +00:00
David Greene
35dca86659
Fix an infinite recursion problem. dbgs() should return errs() in
...
release mode.
llvm-svn: 94001
2010-01-20 15:27:19 +00:00
Chris Lattner
71601e8b3b
eliminate some uses of AsmPrinter::EmitIntXXX
...
llvm-svn: 93996
2010-01-20 07:41:15 +00:00
Victor Hernandez
ab62196c9d
Backout r93990
...
llvm-svn: 93995
2010-01-20 07:37:49 +00:00
Chris Lattner
db42c8d23d
inline and radically simplify printDataDirective. It will eventually
...
go completely away.
llvm-svn: 93994
2010-01-20 07:33:29 +00:00
Chris Lattner
f8dcf784a7
emit basic block labels with mcstreamer.
...
llvm-svn: 93993
2010-01-20 07:24:05 +00:00
Chris Lattner
4c8b1824f0
emit integer and fp zeros as (e.g.) .byte 0 instead of .space 1,
...
for tidiness.
llvm-svn: 93992
2010-01-20 07:19:19 +00:00
Chris Lattner
03cb2a3035
signficant cleanups to EmitGlobalConstant (including streamerization
...
of int initializers), change some methods to be static functions,
use raw_ostream::write_hex instead of a smallstring dance with
APValue::toStringUnsigned(S, 16).
llvm-svn: 93991
2010-01-20 07:11:32 +00:00
Victor Hernandez
6c50c06e70
Fix/strengthen verification of llvm.dbg.declare
...
llvm-svn: 93990
2010-01-20 06:57:02 +00:00
Victor Hernandez
f2462407ee
Switch Elts from vector to SmallVector
...
llvm-svn: 93989
2010-01-20 06:56:16 +00:00
Chris Lattner
37020ccf48
switch ConstantFP emission to use MCStreamer, significantly
...
simplifying the code.
llvm-svn: 93988
2010-01-20 06:53:37 +00:00
Chris Lattner
45eeffcc2a
make mcasmstreamer handle expanding 8 byte integer constants to
...
4-byte constants if .quad isn't supported. Switch a bunch of
methods used by the dwarf writer to use OutStreamer.EmitIntValue.
llvm-svn: 93987
2010-01-20 06:45:39 +00:00
Chris Lattner
38caaf14c1
give createAsmStreamer an 'isLittleEndian' argument.
...
llvm-svn: 93986
2010-01-20 06:39:07 +00:00
Chris Lattner
2b4364fe03
revert 93934, removing the MCAsmInfo endianness bit. I can't
...
stomache MCAsmInfo having this, and I found a better solution to
this layering issue.
llvm-svn: 93985
2010-01-20 06:34:14 +00:00
Victor Hernandez
d0b2ff9b7a
Fix if/else brackets; getFunctionForValue() is to be called for non-metadata values
...
llvm-svn: 93984
2010-01-20 06:22:33 +00:00
Chandler Carruth
d6514b1e13
Fix the conditions to unambiguously show the logic they represent. This is the
...
logic enforced in the test case as well, so hopefully it is correct. Please
review Victor.
llvm-svn: 93980
2010-01-20 06:01:02 +00:00
Victor Hernandez
5fa88d4e30
Map operands of all function-local metadata, not just metadata passed to llvm.dbg.declare intrinsics
...
llvm-svn: 93979
2010-01-20 05:49:59 +00:00
Victor Hernandez
20425abea4
Avoid unnecessary Elts array
...
llvm-svn: 93978
2010-01-20 05:44:11 +00:00
Victor Hernandez
e5f2af7594
Refactor common parts of MDNode::getFunction() and assertLocalFunction() into getFunctionForValue()
...
llvm-svn: 93977
2010-01-20 04:45:57 +00:00
Devang Patel
7771b7c621
If a instruction belongs to another function (and not current function) as per debug info attached with the instruction then ignore the dangling lexical scope of this instruction. Such scopes are unreachable.
...
llvm-svn: 93967
2010-01-20 02:05:23 +00:00
David Greene
3b2a68ceb8
Add some asserts to check SelectionDAG problems earlier.
...
llvm-svn: 93960
2010-01-20 00:59:23 +00:00
Dale Johannesen
91970b4ea2
Move findDebugLoc somewhere more central. Fix
...
more cases where debug declarations affect
debug line info.
llvm-svn: 93953
2010-01-20 00:19:24 +00:00
Dan Gohman
954f49014d
Fold (add x, shl(0 - y, n)) -> sub(x, shl(y, n)), to simplify some code
...
that SCEVExpander can produce when running on behalf of LSR.
llvm-svn: 93949
2010-01-19 23:30:49 +00:00
Bob Wilson
6a4491b8c7
Wrap some comments to 80 columns.
...
llvm-svn: 93940
2010-01-19 22:56:26 +00:00
Dale Johannesen
aa6655557b
Fix a case where debug_value was perturbing the
...
line number info.
llvm-svn: 93937
2010-01-19 22:50:05 +00:00
Dan Gohman
ca19445d08
When doing address-mode sinking, expand the base register first, rather
...
than the scaled register. This makes it more likely that subsequent
AddrModeMatcher queries will match the new address the same way as the
old, instead of accidentally matching what had been the base register
as the new scaled register, and then failing to match the scaled register.
This fixes some problems with address-mode sinking multiple muls into a
block, which will be a lot more common with some upcoming
LoopStrengthReduction changes.
llvm-svn: 93935
2010-01-19 22:45:06 +00:00
Chris Lattner
003b5c8472
give MCAsmInfo a 'has little endian' bit. This is unfortunate, but
...
I really want clients of the streamer to be able to say "emit this
64-bit integer" and have it get broken down right by the streamer.
I may change this in the future, we'll see how it works out.
llvm-svn: 93934
2010-01-19 22:42:28 +00:00
Dan Gohman
8d67d2f5f8
Add a comment and tidy up some whitespace.
...
llvm-svn: 93932
2010-01-19 22:27:22 +00:00
Dan Gohman
510bffca45
Fix a typo and an 80-column violation in comments.
...
llvm-svn: 93931
2010-01-19 22:26:02 +00:00
Dan Gohman
f86d904b7d
Give ScalarEvolution access to the DominatorTree. It'll need this
...
to make more intellegent AddRec folding decisions.
llvm-svn: 93930
2010-01-19 22:21:27 +00:00
Chris Lattner
eaef5e111d
simplify the rest of fp constant printing.
...
llvm-svn: 93929
2010-01-19 22:16:33 +00:00
Chris Lattner
c70daf316e
simplify the code for printing x86 long double, don't do work
...
for -fverbose-asm unless it's on.
llvm-svn: 93926
2010-01-19 22:11:05 +00:00
Jakob Stoklund Olesen
e8800b8d7c
Identify predicate and optional-def operands when printing machine
...
instructions.
llvm-svn: 93925
2010-01-19 22:08:34 +00:00
Chris Lattner
dc50e5d128
add a new EmitIntValue method that MCStreamer impls can optionally define
...
and that clients can use.
llvm-svn: 93923
2010-01-19 22:03:38 +00:00
Dan Gohman
d693472821
Add a new helper function to IVUsers for returning the "canonical"
...
form of an expression. This is the expression without the
post-increment adjustment made, which is useful in determining
which registers will be used by the expansion.
llvm-svn: 93921
2010-01-19 21:55:32 +00:00
Chris Lattner
ecaf0dcbc6
eliminate AsmPrinter::EmitZeros: just use MCStreamer directly.
...
llvm-svn: 93918
2010-01-19 21:51:22 +00:00
Sean Callanan
936b0d3144
Promoted the getTok() method to MCAsmParser so that
...
the two token accessor functions are declared consistently.
Modified the clients of MCAsmParser to reflect this change.
llvm-svn: 93916
2010-01-19 21:44:56 +00:00
Xerxes Ranby
17dc3a0a94
Stubs for getHostCPUFeatures API. This implements part of PR5389.
...
llvm-svn: 93913
2010-01-19 21:26:05 +00:00
Jakob Stoklund Olesen
bdc17f6840
Remove predicates when changing an add into an unpredicable mov.
...
Since the mov is executed unconditionally, make sure that the add didn't have
any predicate.
llvm-svn: 93909
2010-01-19 21:08:28 +00:00
Benjamin Kramer
f007697c56
Update CMake list.
...
llvm-svn: 93905
2010-01-19 20:59:04 +00:00
David Greene
f1c7388b29
Add some new debugging APIs to print out "raw" SelectionDAGs to make
...
understanding CannotYTetSelect and other errors easier.
llvm-svn: 93901
2010-01-19 20:37:34 +00:00
Sean Callanan
a83fd7d52c
Propagated the parser-side Lex function's declaration to
...
MCAsmParser, and changed the target-specific AsmParsers
to use it.
llvm-svn: 93900
2010-01-19 20:27:46 +00:00
Bruno Cardoso Lopes
e1afaf5c22
Fix a bug introduced on r92564 where the name "Node" was already
...
in use by Mips.
llvm-svn: 93897
2010-01-19 19:57:07 +00:00
Chris Lattner
c35681b298
Generalize mcasmstreamer data emission APIs to take an address space
...
identifier. There is no way to work around it.
llvm-svn: 93896
2010-01-19 19:46:13 +00:00
Evan Cheng
bf43525a29
Do not extend extension results beyond the use of a PHI instruction at the start of a use block. A PHI use is expected to kill its source values.
...
llvm-svn: 93895
2010-01-19 19:45:51 +00:00
Chris Lattner
fefcb1531c
refactor code to be static functions instead of methods on AsmPrinter.
...
This fixes some bugs handling address spaces.
llvm-svn: 93891
2010-01-19 19:10:44 +00:00
Chris Lattner
ed89f60f5e
mcstreamerize AsmPrinter::EmitZeros, at least when emitting to the
...
default address space.
llvm-svn: 93890
2010-01-19 18:58:52 +00:00
Chris Lattner
4340cb3246
add an MCAsmStreamer::EmitFill specialization of EmitFill that
...
emits one directive instead of N. Not doing this would be a
significant regression on the # bytes generated by .fill.
llvm-svn: 93889
2010-01-19 18:52:28 +00:00
Chris Lattner
0c65fd4902
add a "MCStreamer::EmitFill" method, and move the default implementation
...
(which just iteratively emits bytes) to MCStreamer.
llvm-svn: 93888
2010-01-19 18:45:47 +00:00
Chris Lattner
9c31b0c695
remove MAI::ZeroDirectiveSuffix, which is only used by MASM,
...
which we don't support anymore.
llvm-svn: 93886
2010-01-19 18:37:01 +00:00
Jim Grosbach
04770f2aa1
For aligned load/store instructions, it's only required to know whether a
...
function can support dynamic stack realignment. That's a much easier question
to answer at instruction selection stage than whether the function actually
will have dynamic alignment prologue. This allows the removal of the
stack alignment heuristic pass, and improves code quality for cases where
the heuristic would result in dynamic alignment code being generated when
it was not strictly necessary.
llvm-svn: 93885
2010-01-19 18:31:11 +00:00
Chris Lattner
18f49ce2d3
optimize ~(~X >>s Y) --> (X >>s Y), patch by Edmund Grimley
...
Evans!
llvm-svn: 93884
2010-01-19 18:16:19 +00:00
Bruno Cardoso Lopes
4f34432d09
On pic function calls some arguments were marked dead and
...
the instruction to load those args removed. This fix PR6071
llvm-svn: 93880
2010-01-19 17:00:43 +00:00
Bruno Cardoso Lopes
c9818a77cb
load f64 +0.0 in a cleaner way. This fix part of PR5445
...
llvm-svn: 93876
2010-01-19 12:53:04 +00:00
Bruno Cardoso Lopes
2f5c8e3495
Fix return registers for mips eabi
...
llvm-svn: 93875
2010-01-19 12:37:35 +00:00
Chris Lattner
3024e9813e
mcstreamer'ize the rest of EmitGlobalVariable that is used on
...
darwin. The next big piece to get global variables streamerized
is EmitGlobalConstant.
llvm-svn: 93870
2010-01-19 06:41:24 +00:00
Chris Lattner
cd2915e467
stop using the .lcomm pseudoop on darwin, instead, directly use the
...
.zerofill directive. Streamerize its generation.
llvm-svn: 93868
2010-01-19 06:25:51 +00:00
Devang Patel
018b29b039
MDNodes are not expected to disappear or replaced by another MDNode, so there is no need to pay the cost of WeakVH and ValueMaps.
...
llvm-svn: 93865
2010-01-19 06:19:05 +00:00
Devang Patel
1083b5fc3f
Avoid including DebugInfo.h in AsmPrinter.h
...
llvm-svn: 93864
2010-01-19 06:09:04 +00:00
Chris Lattner
00fa4b67e6
zap the ARM version of PrintGlobalVariable, which I missed.
...
llvm-svn: 93863
2010-01-19 06:08:15 +00:00
Chris Lattner
95b98959b0
mc'ize some stuff, don't comment out .lcomm directive in -fverbose-asm mode.
...
llvm-svn: 93860
2010-01-19 06:01:04 +00:00
Chris Lattner
282466abf7
factor this code better.
...
llvm-svn: 93859
2010-01-19 05:51:42 +00:00
Chris Lattner
c7a062d187
Now that we have everything nicely factored (e.g. asmprinter is not
...
doing global variable classification anymore) and hookized, sink almost
all target targets global variable emission code into AsmPrinter and out
of each target.
Some notes:
1. PIC16 does completely custom and crazy stuff, so it is not changed.
2. XCore has some custom handling for extra directives. I'll look at it next.
3. This switches linux/ppc to use .globl instead of .global. If .globl is
actually wrong, let me know and I'll fix it.
4. This makes linux/ppc get a lot of random cases right which were obviously
wrong before, it is probably now a bit healthier.
5. Blackfin will probably start getting .comm and other things that it didn't
before. If this is undesirable, it should explicitly opt out of these
things by clearing the relevant fields of MCAsmInfo.
This leads to a nice diffstat:
14 files changed, 127 insertions(+), 830 deletions(-)
llvm-svn: 93858
2010-01-19 05:38:33 +00:00
Chris Lattner
f75fe9e34c
use %object like other elf targets, gas accepts either.
...
llvm-svn: 93857
2010-01-19 05:25:38 +00:00
Chris Lattner
9d749a2fc4
simplify the mips target to print .size and .type for c strings
...
just like all other elf targets. Bruno, if this isn't right, please
let me know + why :)
llvm-svn: 93856
2010-01-19 05:23:59 +00:00
Chris Lattner
b1f2934fc7
hookize the cygwin ".linkonce" directive.
...
llvm-svn: 93855
2010-01-19 05:08:13 +00:00
Chris Lattner
826d77fb07
more cleanups. Emit the .local directive even on cygwin/mingw.
...
I'm not sure that this is correct, but it causes no test failures,
and just emitting a .comm without protecting its linkage somehow
is surely not right.
llvm-svn: 93854
2010-01-19 04:59:55 +00:00
Chris Lattner
f8a128a1a8
some cleanups
...
llvm-svn: 93853
2010-01-19 04:53:18 +00:00
Chris Lattner
dccbb28bca
add a bool for whether .lcomm takes an alignment instead of basing this on "isdarwin".
...
llvm-svn: 93852
2010-01-19 04:48:20 +00:00
Chris Lattner
6a160517a0
hoist handling of external globals and special globals up to common code.
...
This makes a similar code dead in all the other targets, I'll clean it up
in a bit.
This also moves handling of lcomm up before acquisition of a section,
since lcomm never needs a section.
llvm-svn: 93851
2010-01-19 04:39:15 +00:00
Chris Lattner
e9d28b19cf
move production of .reference directives for static ctor/dtor list on
...
darwin into common code.
llvm-svn: 93849
2010-01-19 04:34:02 +00:00
Bob Wilson
58d59fe394
Fix a crash in scalarrepl for memcpy/memmove where the source and destination
...
are the same. I had already fixed a similar problem where the source and
destination were different bitcasts derived from the same alloca, but the
previous fix still did not handle the case where both operands are exactly
the same value. Radar 7552893.
llvm-svn: 93848
2010-01-19 04:32:48 +00:00
Chris Lattner
35474ca4c4
use BSSLocal classifier to identify 'lcomm' data instead of
...
duplicating the logic (differently) in lots of different targets.
llvm-svn: 93847
2010-01-19 04:21:20 +00:00
Chris Lattner
b253421711
make TLOF subclassify BSS based on linkage type into private, external
...
and everything else (weak).
llvm-svn: 93846
2010-01-19 04:15:51 +00:00
Chris Lattner
70f0c33ec8
now that elf weak bss symbols are handled correctly, simplify a bunch of code.
...
llvm-svn: 93845
2010-01-19 03:13:44 +00:00
Chris Lattner
a986aa33eb
fix a significant difference between llvm and gcc on ELF systems:
...
GCC would put weak zero initialized mutable data in the .bss section,
we would put it into a crasy '.gnu.linkonce.b.test,"aw",@nobits'
section. Fixing this will allow simplifications next up.
llvm-svn: 93844
2010-01-19 03:06:01 +00:00
Chris Lattner
5b585f8b1a
introduce a section kind for common linkage. Use this to slightly
...
simplify and commonize some of the asmprinter logic for globals.
This also avoids printing the MCSection for .zerofill, which broke
the llvm-gcc build.
llvm-svn: 93843
2010-01-19 02:48:26 +00:00
Bill Wendling
220c29465e
Even more explanation.
...
llvm-svn: 93841
2010-01-19 02:44:01 +00:00
Chris Lattner
aa1f4fd0ed
change an accessor to a predicate.
...
llvm-svn: 93839
2010-01-19 02:13:06 +00:00
Chris Lattner
1d371882b6
Cleanup handling of .zerofill on darwin:
...
1. TargetLoweringObjectFileMachO should decide if something
goes in zerofill instead of having every target do it.
2. TargetLoweringObjectFileMachO should assign said symbols to
the right MCSection, the asmprinters should just emit to the
right section.
3. Since all zerofill stuff goes through mcstreamer anymore,
MAI can have a bool "haszerofill" instead of having the textual
directive to emit.
llvm-svn: 93838
2010-01-19 02:09:44 +00:00
Nate Begeman
e945172ba4
Remove this fixme, looking at the linker source, all targets pad to 4 bytes.
...
llvm-svn: 93835
2010-01-19 01:32:44 +00:00
Devang Patel
fe189e65d7
Revert accident check-in from r93165.
...
llvm-svn: 93832
2010-01-19 01:26:02 +00:00
Eric Christopher
84bd316bd6
Fix comment.
...
llvm-svn: 93831
2010-01-19 01:20:15 +00:00
Evan Cheng
6c0fb92c03
Fix r93758. Use isel patterns instead of c++ selection code to select rbit and make sure we pick different instructions for ARM vs. Thumb2.
...
llvm-svn: 93829
2010-01-19 00:44:15 +00:00
Dale Johannesen
a3db6ef9a2
Revert 93811 per request.
...
llvm-svn: 93818
2010-01-19 00:10:52 +00:00
Dale Johannesen
0c90d43b70
Enable code to emit dbg.declare as DEBUG_VALUE
...
comments (fast isel, X86). This doesn't seem
to break any functionality, but will introduce
cases where -g affects the generated code. I'll
be fixing that.
llvm-svn: 93811
2010-01-18 23:34:55 +00:00