Dan Gohman
6019e07b3b
Improve bugpoint's error messages when it runs out of memory,
...
or when some other std::exception is thrown.
llvm-svn: 70175
2009-04-27 01:30:37 +00:00
Chris Lattner
a6fdf5a8c9
Add two new record types to the blockinfo block:
...
BLOCKNAME and SETRECORDNAME. This allows a bitcode
file to be self describing with pretty names for
records and blocks in addition to numbers. This
enhances llvm-bcanalyzer to use this to print prettily.
llvm-svn: 70165
2009-04-26 22:21:57 +00:00
Chris Lattner
0d0d3e56dd
make BitstreamCursor's copyable and assignable.
...
llvm-svn: 70159
2009-04-26 21:07:02 +00:00
Chris Lattner
277800a643
Make a major API change to BitstreamReader: split all the reading
...
state out of the BitstreamReader class into a BitstreamCursor class.
Doing this allows the client to have multiple cursors into the same
file, each with potentially different live block stacks and
abbreviation records.
llvm-svn: 70157
2009-04-26 20:59:02 +00:00
Bill Wendling
5bf1a6e986
I cast, therefore I think I know what I'm doing.
...
llvm-svn: 70151
2009-04-26 20:12:38 +00:00
Bill Wendling
febab5d928
Use uint64_t instead of unsigned.
...
llvm-svn: 70148
2009-04-26 19:46:41 +00:00
Chris Lattner
0ba740892e
revert an incorrect patch. This causes crashes all over the place on a
...
64-bit build.
llvm-svn: 70147
2009-04-26 19:44:20 +00:00
Bill Wendling
995f81c5ce
Suppress warnings about conversion shortening 64-bit to 32-bit.
...
llvm-svn: 70138
2009-04-26 18:10:20 +00:00
Sanjiv Gupta
8d319047c5
Any size of integral indices are allowed in gep for indexing into sequential types. Also adding a test case to check the indices type allowed into struct.
...
llvm-svn: 70134
2009-04-26 17:14:35 +00:00
Chris Lattner
1c1595f9ef
improve documentation on build configurations, patch by
...
Josef Eisl!
llvm-svn: 70087
2009-04-25 22:24:49 +00:00
Chris Lattner
73b5b5adae
add testcase for strange types of gep indices
...
llvm-svn: 70085
2009-04-25 22:20:49 +00:00
Chris Lattner
abd9bc89c5
Add a new TypeBuilder helper class, which eases making LLVM IR types.
...
Patch by Jeffrey Yasskin!
llvm-svn: 70084
2009-04-25 22:14:04 +00:00
Chris Lattner
dc5f7c6f83
improve documentation around memory lifetimes,
...
patch by Jeffrey Yasskin!
llvm-svn: 70083
2009-04-25 22:10:06 +00:00
Chris Lattner
0cb8977c0a
aDd support for building a subset of the llvm tools, patch by Jeffrey Yasskin!
...
llvm-svn: 70082
2009-04-25 22:08:52 +00:00
Chris Lattner
4c73d7a9b8
testcase and asmparser fix for PR4066
...
llvm-svn: 70080
2009-04-25 21:26:00 +00:00
Chris Lattner
cde89e48b2
Allow aliasee to be a GEP or bitcast instead of just a bitcast.
...
The real fix for this whole mess is to require the operand of the
alias to be a *GlobalValue* (not a general constant, including
constant exprs) but allow the operand and the alias type to be
unrelated.
This fixes PR4066
llvm-svn: 70079
2009-04-25 21:23:19 +00:00
Chris Lattner
6a6d3cc852
Update docs to not mention gcse/loadvn and mention memdep and
...
new stuff. PR3924.
llvm-svn: 70077
2009-04-25 21:11:37 +00:00
Bill Wendling
13535ceb10
Use intptr_t.
...
llvm-svn: 70076
2009-04-25 21:06:53 +00:00
Mon P Wang
0f3b758f01
size() should return a size_t; avoids a warning for 64 bit machines.
...
llvm-svn: 70072
2009-04-25 20:46:59 +00:00
Evan Cheng
80ad2e6b42
Reuse unused val#'s to avoid running out of memory in extreme cases.
...
llvm-svn: 70069
2009-04-25 20:20:15 +00:00
Chris Lattner
24061b532d
DenseMap.h needs <new> because it explicitly calls operator new/delete.
...
Patch by John McCall!
llvm-svn: 70068
2009-04-25 19:50:14 +00:00
Chris Lattner
b869a0ade1
Fix PR4040: APInt's string constructor is too strict
...
patch by Jeff Yasskin!
llvm-svn: 70058
2009-04-25 18:34:04 +00:00
Chris Lattner
3ad60b18cb
add support for detecting process features on win64, patch by
...
Nicolas Capens!
llvm-svn: 70057
2009-04-25 18:27:23 +00:00
Dan Gohman
fe9e1d5b59
Refactor the code to grab the low and high parts of a value
...
using EXTRACT_ELEMENT into a utility function.
llvm-svn: 70056
2009-04-25 17:55:53 +00:00
Dan Gohman
1b5055ab7f
Return null instead of false, as appropriate.
...
llvm-svn: 70054
2009-04-25 17:28:45 +00:00
Dan Gohman
5638e0d642
Add several more icmp simplifications. Transform signed comparisons
...
into unsigned ones when the operands are known to have the same
sign bit value.
llvm-svn: 70053
2009-04-25 17:12:48 +00:00
Dan Gohman
4539987920
Add a top-level comment about DAGCombiner's role in the compiler.
...
llvm-svn: 70052
2009-04-25 17:09:45 +00:00
Dan Gohman
df19948ea7
Handle ands with 0 and shifts by 0 correctly. These aren't
...
common, but indvars shouldn't crash on them. This fixes PR4054.
llvm-svn: 70051
2009-04-25 17:05:40 +00:00
Torok Edwin
c8afb09a3b
Fix g++-4.4.0 warning, it was causing llvm-nm to fail on wrapped BC files:
...
Path.cpp:59: warning: case label value exceeds maximum value for type
magic[0] is a (signed) char, but some case values are unsigned (e.g. 0xde).
When magic[0] was 0xde, the switch has taken the default branch instead of case
0xde branch.
Apparently this was the behaviour with older versions of gcc too, but not with g++.
Now g++-4.4 behaves as gcc, and ignores unsigned case values out of range signed
range.
llvm-svn: 70038
2009-04-25 10:25:12 +00:00
Evan Cheng
362acf8a56
Do not share a single unknown val# for all the live ranges merged into a physical sub-register live interval. When coalescer is merging in clobbered virtaul register live interval into a physical register live interval, give each virtual register val# a separate val# in the physical register live interval. Otherwise, the coalescer would have lost track of the definitions information it needs to make correct coalescing decisions.
...
llvm-svn: 70026
2009-04-25 09:25:19 +00:00
Sanjiv Gupta
0c155e6dbe
Fixed the gep example for i16 type indices.
...
llvm-svn: 70019
2009-04-25 07:27:44 +00:00
Bob Wilson
0041bd3523
Change LowerCallResult method so that CCValAssign::BCvt can be used with
...
f64 types. This is not used for anything yet.
llvm-svn: 70006
2009-04-25 00:33:20 +00:00
Dale Johannesen
56cb14c874
Fix PR 4057, a crash doing float->char const folding.
...
This particular one is undefined behavior (although this
isn't related to the crash), so it will no longer do it
at compile time, which seems better.
llvm-svn: 69990
2009-04-24 21:34:13 +00:00
Bob Wilson
40e784ce69
Adjust a comment to reflect what the code does. Splitting a 64-bit argument
...
between registers and the stack may be required with the APCS ABI, but it
isn't tied to using a particular version of the ARM architecture.
llvm-svn: 69978
2009-04-24 17:05:01 +00:00
Bob Wilson
f134b2d212
Fix up some problems with getCopyToReg and getCopyFromReg nodes being
...
chained and "flagged" together. I also made a few changes to handle the
chain and flag values more consistently. I found these problems by
inspection so I'm not aware of anything that breaks because of them
(thus no testcase).
llvm-svn: 69977
2009-04-24 17:00:36 +00:00
Gabor Greif
33e834cc0a
Use a bigger hammer to coerce subversion into english.
...
Patch by Benjamin Kramer!
llvm-svn: 69976
2009-04-24 17:00:03 +00:00
David Greene
7049e79e45
Fix multiclass inheritance to limit value resolution to new defs added
...
by base multiclasses. Do not attempt to alter defs from previous base
multiclasses. This fixes multiple multiclass inheritance.
llvm-svn: 69974
2009-04-24 16:55:41 +00:00
Bob Wilson
62d47d2361
Remove unnecessary references to f32 types. After specifying that f32
...
should be bit-converted to i32, it is sufficient to list only i32 in
subsequent definitions.
llvm-svn: 69973
2009-04-24 16:55:25 +00:00
Rafael Espindola
56548523f5
Add LTO_SYMBOL_DEFINITION_WEAKUNDEF, use that on the gold plugin.
...
llvm-svn: 69972
2009-04-24 16:55:21 +00:00
Sanjiv Gupta
77abea0d6a
Fixed spaces and the getelementpointer example with i16 type indices.
...
llvm-svn: 69971
2009-04-24 16:38:13 +00:00
Rafael Espindola
c1396a2313
Fix PR 4004 by including the call to __tls_get_addr in X86tlsaddr. This is not
...
very elegant, but neither is the tls specification :-(
llvm-svn: 69968
2009-04-24 12:59:40 +00:00
Rafael Espindola
b93db668b3
Revert 69952. Causes testsuite failures on linux x86-64.
...
llvm-svn: 69967
2009-04-24 12:40:33 +00:00
Chris Lattner
cb2147e58c
fix a typo noticed by duncan
...
llvm-svn: 69962
2009-04-24 06:37:12 +00:00
Chris Lattner
a776fc78a9
"I got annoyed at the compiler warnings from ConstantInt::get(Ty, -1,
...
true), and casts make me nervous and are verbose anyway, so here's a
ConstantInt::getSigned(Ty, int64_t) method. Just overloading
ConstantInt::get() to take an int64_t too would cause ambiguous
overload errors."
Patch by Jeffrey Yasskin!
llvm-svn: 69958
2009-04-24 05:30:14 +00:00
Nate Begeman
bb881d66f4
PR2957
...
ISD::VECTOR_SHUFFLE now stores an array of integers representing the shuffle
mask internal to the node, rather than taking a BUILD_VECTOR of ConstantSDNodes
as the shuffle mask. A value of -1 represents UNDEF.
In addition to eliminating the creation of illegal BUILD_VECTORS just to
represent shuffle masks, we are better about canonicalizing the shuffle mask,
resulting in substantially better code for some classes of shuffles.
A clean up of x86 shuffle code, and some canonicalizing in DAGCombiner is next.
llvm-svn: 69952
2009-04-24 03:42:54 +00:00
Dan Gohman
640a161c73
Instead of requiring TLI.LowerCallTo to return an ISD::BUILD_PAIR,
...
use ISD::EXTRACT_ELEMENT. SelectionDAG has a special fast-path for
the cast of an EXTRACT_ELEMENT with a BUILD_PAIR operand, for the
common case.
llvm-svn: 69948
2009-04-24 02:40:23 +00:00
Sanjiv Gupta
46c97e626f
Allow i16 type indices to gep.
...
llvm-svn: 69946
2009-04-24 02:37:54 +00:00
Dan Gohman
9478c3f8e5
Factor out a bit of code that appears in several places into a
...
utility function.
llvm-svn: 69937
2009-04-23 23:13:24 +00:00
Dan Gohman
a290ab44e8
Handle Void types in ComputeValueVTs. This doesn't currently occur,
...
but this change makes the code more general and easier to adapt for
new purposes.
llvm-svn: 69935
2009-04-23 22:50:03 +00:00
Dan Gohman
870c33f14b
Fix spurious indentation in a comment.
...
llvm-svn: 69934
2009-04-23 22:41:05 +00:00
David Greene
0e89886048
Fix a documentation bug.
...
llvm-svn: 69923
2009-04-23 21:27:58 +00:00
David Greene
196ac3c69a
Make BinOps typed and require a type specifier for !nameconcat. This
...
allows binops to be used in typed contexts such as when passing
arguments to classes.
llvm-svn: 69921
2009-04-23 21:25:15 +00:00
Evan Cheng
5bbb78dc3e
Update comments.
...
llvm-svn: 69919
2009-04-23 20:39:31 +00:00
Evan Cheng
967b04d9bc
Fix an obvious type.
...
llvm-svn: 69918
2009-04-23 20:18:13 +00:00
Dan Gohman
723f175bc9
Explicitly pass -tailcallopt=false to these tests so that they
...
work as intended no matter what the default setting of that
option is.
llvm-svn: 69911
2009-04-23 19:39:41 +00:00
Dale Johannesen
466af3eb46
Testcase for 69795.
...
llvm-svn: 69901
2009-04-23 18:04:04 +00:00
Dan Gohman
d6f9713634
Fix an error in this test.
...
llvm-svn: 69893
2009-04-23 15:22:28 +00:00
Dan Gohman
86bcd97014
Change SCEVExpander's expandCodeFor to provide more flexibility
...
with the persistent insertion point, and change IndVars to make
use of it. This fixes a bug where IndVars was holding on to a
stale insertion point and forcing the SCEVExpander to continue to
use it.
This fixes PR4038.
llvm-svn: 69892
2009-04-23 15:16:49 +00:00
Sanjiv Gupta
5058f240d9
Banksel immediate constant will always immediately follow the GA/ES, so scan an insn from beginnin to find out the banksel operand.
...
llvm-svn: 69883
2009-04-23 10:34:58 +00:00
Nick Lewycky
b4d9f7a9b3
Simplify trunc(extend(x)) in SCEVs, just for completeness. Also fix some odd
...
whitespace in the same file.
llvm-svn: 69870
2009-04-23 05:15:08 +00:00
Owen Anderson
7d82244be7
Testcase for PR3909.
...
llvm-svn: 69868
2009-04-23 04:33:42 +00:00
Owen Anderson
b94ea3ebf1
Testcase for PR2639.
...
llvm-svn: 69867
2009-04-23 04:30:52 +00:00
Owen Anderson
b211b5c478
Testcase for PR2537.
...
llvm-svn: 69866
2009-04-23 04:26:42 +00:00
Owen Anderson
437c6357e0
Fix typo.
...
llvm-svn: 69865
2009-04-23 04:24:19 +00:00
Owen Anderson
0e357e5fd3
Testcase for PR3085.
...
llvm-svn: 69863
2009-04-23 04:21:14 +00:00
Owen Anderson
7e96d34f2e
Add testcase from PR3086.
...
llvm-svn: 69862
2009-04-23 04:14:03 +00:00
Dan Gohman
14efb90fcf
Add support for printing MO_ExternalSymbol operands in
...
memory operand tuples. This doesn't ever come up in normal
code however.
llvm-svn: 69848
2009-04-23 00:57:37 +00:00
Dan Gohman
4cc0cae46c
Add more ulimit limits, to catch more kinds of runaway behavior.
...
llvm-svn: 69847
2009-04-23 00:28:31 +00:00
Owen Anderson
d4f5537c5e
Use the testcase from PR2791.
...
llvm-svn: 69846
2009-04-23 00:15:26 +00:00
Evan Cheng
d8174d3d09
Make sure both operands have binary instructions have the same type.
...
llvm-svn: 69844
2009-04-22 23:39:28 +00:00
Evan Cheng
59ca33053b
A few more places where the check of use_empty is needed.
...
llvm-svn: 69842
2009-04-22 23:09:16 +00:00
Evan Cheng
cbfe9df096
Avoid deferencing use_begin() if value does not have a use.
...
llvm-svn: 69836
2009-04-22 22:45:37 +00:00
David Greene
f00919a040
Allow defm to inherit from multiple multiclasses.
...
llvm-svn: 69832
2009-04-22 22:17:51 +00:00
David Greene
a9c6c5d39b
Implement !nameconcat to concatenate strings and look up the resulting
...
name in the symbol table, returning an object.
llvm-svn: 69822
2009-04-22 20:18:10 +00:00
Duncan Sands
7bccadac92
Testcase for PR2958.
...
llvm-svn: 69818
2009-04-22 18:55:17 +00:00
Devang Patel
51c3619018
Fix cut-n-pasto.
...
llvm-svn: 69816
2009-04-22 18:51:05 +00:00
David Greene
753ed8fd9c
Implement multiclass inheritance.
...
llvm-svn: 69810
2009-04-22 16:42:54 +00:00
Dan Gohman
79af854f55
Simplify trivial cast-of-cast SCEVs.
...
llvm-svn: 69809
2009-04-22 16:20:48 +00:00
Dan Gohman
54fd2869a3
SCEVExpander's InsertCastOfTo knows how to move existing cast
...
instructions in order to avoid inserting new ones. However, if
the cast instruction is the SCEVExpander's InsertPt, this
causes subsequently emitted instructions to be inserted near
the cast, and not at the location of the original insert point.
Fix this by adjusting the insert point in such cases.
This fixes PR4009.
llvm-svn: 69808
2009-04-22 16:11:16 +00:00
Dan Gohman
9dd9a45e12
Use BasicBlock::iterator instead of Instruction* for insert points,
...
to better handle inserting instructions at the end of a block.
llvm-svn: 69807
2009-04-22 16:05:50 +00:00
Dan Gohman
87d138c3b9
Make SCEVExpanders private methods private, instead of protected.
...
llvm-svn: 69806
2009-04-22 16:00:36 +00:00
Dan Gohman
956ae9dc15
Use CloneModule's ValueMap in more places, instead of looking
...
up functions by name.
llvm-svn: 69805
2009-04-22 15:57:18 +00:00
Dan Gohman
a4fea5b227
ISD::ADD_PARTS is gone; use ISD::SMUL_LOHI as an example instead.
...
llvm-svn: 69804
2009-04-22 15:55:31 +00:00
Sanjiv Gupta
107b2818ce
Make the function begin label start after ther data pointer.
...
The address of data frame for function can be obtained by subtracting 2 from the function begin label.
llvm-svn: 69801
2009-04-22 12:02:36 +00:00
Duncan Sands
ab4c600e8b
These tests are x86 specific.
...
llvm-svn: 69798
2009-04-22 10:39:51 +00:00
Owen Anderson
6cbf5bb9bb
Real fix for PR3549, by using caching for predecessor counts in addition to the predecessors themselves. This halves the time
...
to optimize the testcase, beyond what my previous patch did.
llvm-svn: 69792
2009-04-22 08:50:12 +00:00
Owen Anderson
9ea578ea70
Add caching of predecessor counts as well as predecessors themselves.
...
llvm-svn: 69791
2009-04-22 08:46:33 +00:00
Owen Anderson
bb754826c9
Use PredIteratorCache in LCSSA, which gives a 37% overall speedup on the testcase from PR3549. More improvements to come.
...
llvm-svn: 69788
2009-04-22 08:09:13 +00:00
Owen Anderson
ecf6910f41
Fix for PR3946, in which SmallVector could behave strangely in corner cases.
...
Patch by Peter Johnson.
llvm-svn: 69785
2009-04-22 07:16:54 +00:00
Chris Lattner
58be2d4413
use predicate instead of hand-rolled loop
...
llvm-svn: 69752
2009-04-21 23:37:18 +00:00
Dan Gohman
c8e236278e
De-pImpl-ify ScalarEvolution. The pImpl pattern doesn't provide much
...
practical benefit in the case of ScalarEvolution, and it's otherwise
a nuisance.
llvm-svn: 69749
2009-04-21 23:15:49 +00:00
Evan Cheng
1a99a5f501
It has finally happened. Spiller is now using live interval info.
...
This fixes a very subtle bug. vr defined by an implicit_def is allowed overlap with any register since it doesn't actually modify anything. However, if it's used as a two-address use, its live range can be extended and it can be spilled. The spiller must take care not to emit a reload for the vn number that's defined by the implicit_def. This is both a correctness and performance issue.
llvm-svn: 69743
2009-04-21 22:46:52 +00:00
Dan Gohman
e14efcc9f4
When turning (ashr(shl(x, n), n)) into sext(trunc(x)), the width of the
...
type to truncate to should be the number of bits of the value that are
preserved, not the number that are clobbered with sign-extension.
This fixes regressions in ldecod.
llvm-svn: 69704
2009-04-21 20:18:36 +00:00
Mikhail Glushenkov
2c332fec97
Support --with-llvmgccdir and friends in llvmc, take 2.
...
Should now work when building with objdir != srcdir and when llvm-gcc is not
available.
Thanks to Duncan Sands for testing and advice!
llvm-svn: 69700
2009-04-21 19:46:10 +00:00
Devang Patel
55f84db7ea
Test case for revision 69683.
...
llvm-svn: 69684
2009-04-21 17:21:01 +00:00
Chris Lattner
69223bb7f5
fix a crash on a pointless but valid zero-length memset, rdar://6808691
...
llvm-svn: 69680
2009-04-21 16:52:12 +00:00
Anton Korobeynikov
f7d0c1a5e6
Silence warnings.
...
Patch by Jay Foad!
llvm-svn: 69679
2009-04-21 16:04:56 +00:00
Anton Korobeynikov
5a4b52dc0c
Drop obsolete reference to __eprintf.
...
Patch by Jay Foad!
llvm-svn: 69678
2009-04-21 16:04:41 +00:00
Anton Korobeynikov
c6cd4b5016
'The "or die" is intended to catch the case where nm returned a
...
non-zero exit status, so nm will already have printed some error
messages.'
Patch by Jay Foad!
llvm-svn: 69677
2009-04-21 16:04:14 +00:00
Duncan Sands
7ce5cc6bd1
Get rid of what looks like a copy-and-pasted typo.
...
Spotted by gcc-4.5.
llvm-svn: 69673
2009-04-21 09:44:39 +00:00
Rafael Espindola
47ed1f5293
TLS_addr64 and TLS_addr32 define RDI and EAX. They don't use them.
...
This fixes PR4002.
llvm-svn: 69672
2009-04-21 08:22:09 +00:00
Sanjiv Gupta
3e3ef7c4d9
Handle direct aggregate type arguments.
...
llvm-svn: 69665
2009-04-21 05:54:51 +00:00
Dan Gohman
0ec0537403
Teach ScalarEvolution how to recognize zext-inreg and sext-inreg,
...
as they appear in LLVM IR. This isn't particularly interesting
on its own; this is just setting up some infrastructure.
llvm-svn: 69655
2009-04-21 02:26:00 +00:00
Dan Gohman
c4938497b3
This FIXME is fixed, now that SCEV understands pointers.
...
llvm-svn: 69651
2009-04-21 01:41:18 +00:00
Dan Gohman
4860db61be
Factor out a common base class from SCEVTruncateExpr, SCEVZeroExtendExpr,
...
and SCEVSignExtendExpr.
llvm-svn: 69649
2009-04-21 01:25:57 +00:00
Dan Gohman
49e062fcc1
Usage getAnalysisToUpdate for TargetData, per PR760.
...
llvm-svn: 69645
2009-04-21 01:11:19 +00:00
Dan Gohman
b397e1a7a2
Introduce encapsulation for ScalarEvolution's TargetData object, and refactor
...
the code to minimize dependencies on TargetData.
llvm-svn: 69644
2009-04-21 01:07:12 +00:00
Dan Gohman
413e91f440
Move some assertion checks so they can do more complete checking.
...
llvm-svn: 69643
2009-04-21 00:55:22 +00:00
Dan Gohman
e20f824565
Convert ScalarEvolution to use raw_ostream instead of OStream.
...
llvm-svn: 69640
2009-04-21 00:47:46 +00:00
Devang Patel
7f413cb05f
Fix Visual Studio 2008 build failure.
...
Patch by Marius Wachtler
llvm-svn: 69637
2009-04-21 00:08:56 +00:00
Dan Gohman
1addf64735
Make X86's copyRegToReg able to handle copies to and from subclasses.
...
This makes the extra copyRegToReg calls in ScheduleDAGSDNodesEmit.cpp
unnecessary. Derived from a patch by Jakob Stoklund Olesen.
llvm-svn: 69635
2009-04-20 22:54:34 +00:00
Dan Gohman
e014b69919
Simplify this code. getConstant knows how to make
...
broadcasted vector constants.
llvm-svn: 69634
2009-04-20 22:51:43 +00:00
Evan Cheng
5770950dbb
No, we are not avoiding -O3, just -fstrict-aliasing.
...
llvm-svn: 69633
2009-04-20 22:49:59 +00:00
Dale Johannesen
1238220473
Adjust loop size estimate for full unrolling;
...
GEP's don't usually become instructions.
llvm-svn: 69631
2009-04-20 22:19:33 +00:00
Evan Cheng
40c52322a7
One Mac OS X, just build with -O3 but without -fstrict-aliasing (which is kinda broken).
...
llvm-svn: 69630
2009-04-20 22:16:40 +00:00
Daniel Dunbar
3222b9be04
Make Unix.h:MakeErrMsg separate the prefix and errno string, so we get:
...
clang: error: unable to make temporary file: /etc/cc: can't make
unique filename: Permission denied
instead of
clang: error: unable to make temporary file: /etc/cc: can't make
unique filenamePermission denied
for example.
Also, audited the uses of MakeErrMsg to make the prefix strings
consistent (not end with newline/punctuation/space/": ").
llvm-svn: 69626
2009-04-20 20:50:13 +00:00
Daniel Dunbar
2c441c6afe
Remove unused variable.
...
llvm-svn: 69624
2009-04-20 20:34:38 +00:00
Bob Wilson
f8b85477ae
Move duplicated AddLiveIn function from X86 and ARM backends to be a method
...
in the MachineFunction class, renaming it to addLiveIn for consistency with
the same method in MachineBasicBlock. Thanks for Anton for suggesting this.
llvm-svn: 69615
2009-04-20 18:36:57 +00:00
Devang Patel
958d5eb032
Match C backend only if it explicitly requested.
...
llvm-svn: 69613
2009-04-20 18:07:22 +00:00
Tanya Lattner
a1eeaff125
Remove clang since its conditionally there already.
...
llvm-svn: 69610
2009-04-20 17:48:16 +00:00
Bob Wilson
da188ebbbd
Revise my previous change 68996 as suggested by Duncan.
...
llvm-svn: 69607
2009-04-20 17:27:09 +00:00
Evan Cheng
5dd2e29b67
- Remove an arbitrary spill weight tweak that should not have been there.
...
- Find more reloads from SS.
llvm-svn: 69606
2009-04-20 17:23:48 +00:00
Sanjiv Gupta
0fcc019d36
Emit the auto variables of a function into a different section than parameters.
...
llvm-svn: 69605
2009-04-20 16:59:35 +00:00
Dan Gohman
f7db87f2dc
It's not necessary for PrintModulePass to flush the output streams
...
now that errs() is properly non-buffered.
llvm-svn: 69602
2009-04-20 16:26:25 +00:00
Dan Gohman
59ceb59f5b
Use .empty() instead of .size().
...
llvm-svn: 69599
2009-04-20 16:19:02 +00:00
Dan Gohman
6c7a485c19
Don't discard an AssemblyAnnotationWriter when writing GlobalValues,
...
which include Functions, where it can be quite useful to use an
AssemblyAnnotationWriter.
llvm-svn: 69598
2009-04-20 16:10:33 +00:00
Duncan Sands
0c58fa5080
These bitfields were being miscompiled on some
...
64 bit platforms when building with optimization.
So replace them by a hand-coded implementation.
This fixes PR3822.
llvm-svn: 69597
2009-04-20 16:03:21 +00:00
Dan Gohman
5fe6b530a5
Implement operator<<(raw_ostream &OS, const Type &T).
...
llvm-svn: 69596
2009-04-20 15:55:38 +00:00
Evan Cheng
d67efaa847
Added a linearscan register allocation optimization. When the register allocator spill an interval with multiple uses in the same basic block, it creates a different virtual register for each of the reloads. e.g.
...
%reg1498<def> = MOV32rm %reg1024, 1, %reg0, 12, %reg0, Mem:LD(4,4) [sunkaddr39 + 0]
%reg1506<def> = MOV32rm %reg1024, 1, %reg0, 8, %reg0, Mem:LD(4,4) [sunkaddr42 + 0]
%reg1486<def> = MOV32rr %reg1506
%reg1486<def> = XOR32rr %reg1486, %reg1498, %EFLAGS<imp-def,dead>
%reg1510<def> = MOV32rm %reg1024, 1, %reg0, 4, %reg0, Mem:LD(4,4) [sunkaddr45 + 0]
=>
%reg1498<def> = MOV32rm %reg2036, 1, %reg0, 12, %reg0, Mem:LD(4,4) [sunkaddr39 + 0]
%reg1506<def> = MOV32rm %reg2037, 1, %reg0, 8, %reg0, Mem:LD(4,4) [sunkaddr42 + 0]
%reg1486<def> = MOV32rr %reg1506
%reg1486<def> = XOR32rr %reg1486, %reg1498, %EFLAGS<imp-def,dead>
%reg1510<def> = MOV32rm %reg2038, 1, %reg0, 4, %reg0, Mem:LD(4,4) [sunkaddr45 + 0]
From linearscan's point of view, each of reg2036, 2037, and 2038 are separate registers, each is "killed" after a single use. The reloaded register is available and it's often clobbered right away. e.g. In thise case reg1498 is allocated EAX while reg2036 is allocated RAX. This means we end up with multiple reloads from the same stack slot in the same basic block.
Now linearscan recognize there are other reloads from same SS in the same BB. So it'll "downgrade" RAX (and its aliases) after reg2036 is allocated until the next reload (reg2037) is done. This greatly increase the likihood reloads from SS are reused.
This speeds up sha1 from OpenSSL by 5.8%. It is also an across the board win for SPEC2000 and 2006.
llvm-svn: 69585
2009-04-20 08:01:12 +00:00
Douglas Gregor
b231e5791e
Make all raw_ostreams support the tell() function.
...
llvm-svn: 69583
2009-04-20 07:34:17 +00:00
Sanjiv Gupta
428d490332
Before trying to introduce/eliminate cast/ext/trunc to make indices type as
...
pointer type, make sure that the pointer size is a valid sequential index type.
llvm-svn: 69574
2009-04-20 06:05:54 +00:00
Nick Lewycky
0575dbb692
Use an AssertingVH to detect the case where the Function was deleted but
...
freeMachineCodeForFunction was never called.
llvm-svn: 69531
2009-04-19 18:32:03 +00:00
Nick Lewycky
fc5571337e
Fix missing text in doxygen documentation.
...
llvm-svn: 69529
2009-04-19 18:20:21 +00:00
Duncan Sands
f2e7133d34
Now that BUILD_VECTOR operands are allowed to be
...
bigger than the vector element type, turn checking
of the operand type back on again, appropriately
adjusted.
llvm-svn: 69516
2009-04-19 06:40:30 +00:00
Duncan Sands
3da896d861
Remove the SimpleTy enumerated type field from the MVT
...
value type union: this field was causing problems for
some compilers on 64 bit systems, presumably because
SimpleTy is 32 bits wide while the other fields are
64 bits wide.
llvm-svn: 69515
2009-04-19 06:23:05 +00:00
Mikhail Glushenkov
c48ede23bd
Add some assertions.
...
Fixes segfaults in some corner cases.
llvm-svn: 69494
2009-04-19 00:22:35 +00:00
Bill Wendling
4d10aae8c2
Revert 69474 and 69475. They are causing failures during a bootstrap on Darwin.
...
llvm-svn: 69478
2009-04-18 21:45:27 +00:00
Mikhail Glushenkov
d497a8bae1
Reconfigure.
...
Turns out that doing this by hand is easier than using autoreconf:-).
llvm-svn: 69475
2009-04-18 20:55:55 +00:00
Mikhail Glushenkov
73e9e021f1
Add a configure check for llvm-gcc (reapply).
...
llvm-svn: 69474
2009-04-18 20:55:28 +00:00
Chris Lattner
1e7da23983
testcase for PR3898
...
llvm-svn: 69473
2009-04-18 20:49:22 +00:00
Chris Lattner
7b01e66443
Fix PR3898, which manifests as failures on are an Xcore,
...
patch by Jakob Stoklund Olesen!
llvm-svn: 69472
2009-04-18 20:48:07 +00:00
Duncan Sands
e4ff21ba4b
Don't try to make BUILD_VECTOR operands have the same
...
type as the vector element type: allow them to be of
a wider integer type than the element type all the way
through the system, and not just as far as LegalizeDAG.
This should be safe because it used to be this way
(the old type legalizer would produce such nodes), so
backends should be able to handle it. In fact only
targets which have legal vector types with an illegal
promoted element type will ever see this (eg: <4 x i16>
on ppc). This fixes a regression with the new type
legalizer (vec_splat.ll). Also, treat SCALAR_TO_VECTOR
the same as BUILD_VECTOR. After all, it is just a
special case of BUILD_VECTOR.
llvm-svn: 69467
2009-04-18 20:16:54 +00:00
Nick Lewycky
13590cb204
Generalize to support more ARM types.
...
Configure was not actually regenerated, but the change last time only touched
this one line, so I'm being lazy and cheating by fixing it manually.
llvm-svn: 69453
2009-04-18 18:11:26 +00:00
Dan Gohman
31efa3098f
Add a ScalarEvolution::getCouldNotCompute() function, and use it
...
instead of allocating and leaking new SCEVCouldNotCompute objects.
llvm-svn: 69452
2009-04-18 17:58:19 +00:00
Dan Gohman
927e90c716
More const qualifiers.
...
llvm-svn: 69451
2009-04-18 17:57:20 +00:00
Dan Gohman
056857aa21
Use more const qualifiers with SCEV interfaces.
...
llvm-svn: 69450
2009-04-18 17:56:28 +00:00
Nick Lewycky
19fac3cf3c
Regenerate.
...
llvm-svn: 69447
2009-04-18 15:41:38 +00:00
Nick Lewycky
3a33c705ef
Detect beagleboard as ARM. The $target is "armv7l".
...
llvm-svn: 69446
2009-04-18 15:34:25 +00:00
Duncan Sands
10961cd40a
Make it clearer that llvm-gcc is not needed for
...
building llvm.
llvm-svn: 69441
2009-04-18 12:40:19 +00:00
Bill Wendling
02b47d9958
Temporarily revert r69438 and r69439. These were causing failures during a
...
release build of llvm.
llvm-svn: 69440
2009-04-18 11:20:33 +00:00
Mikhail Glushenkov
4308aa5272
Regenerate.
...
llvm-svn: 69439
2009-04-18 09:59:26 +00:00
Mikhail Glushenkov
e078105a89
Add a configure check for llvm-gcc.
...
llvm-svn: 69438
2009-04-18 09:57:58 +00:00
Evan Cheng
b685be0c1e
Add a new LiveInterval::overlaps(). It checks if the live interval overlaps a range specified by [Start, End).
...
llvm-svn: 69434
2009-04-18 08:52:15 +00:00
Mon P Wang
6c8bcf9da1
Fixed a few 64 bit cases in X86InstrInfo::commuteInstruction
...
llvm-svn: 69417
2009-04-18 05:16:01 +00:00
Dale Johannesen
2f6263fea3
Adjust XFAIL syntax, maybe that will help. The other
...
way worked for me...
llvm-svn: 69414
2009-04-18 02:01:23 +00:00
Dale Johannesen
e34fb6b5ce
patch 69408 breaks this by removing the opportunity
...
for the optimization it's testing to kick in (although
it improves the code, getting rid of all spills).
I don't understand the optimization well enough to
rescue the test, so XFAILing.
llvm-svn: 69409
2009-04-18 00:11:50 +00:00
Dale Johannesen
ad968ee286
Inline asm's were still introducing bogus dependencies;
...
my earlier patch to this code only fixed half of it.
llvm-svn: 69408
2009-04-18 00:09:40 +00:00
Jim Grosbach
8d62763779
remove trailing whitespace
...
llvm-svn: 69402
2009-04-17 23:30:55 +00:00
Bill Wendling
06684350c4
Recommit r69335 and r69336. These were not causing problems.
...
llvm-svn: 69394
2009-04-17 22:40:38 +00:00
Bob Wilson
b0b10f8bf6
Move the AddLiveIn function definition closer to its uses.
...
llvm-svn: 69382
2009-04-17 20:42:34 +00:00
Bob Wilson
deeaf70dad
Rearrange code to reduce indentation.
...
llvm-svn: 69381
2009-04-17 20:40:45 +00:00
Bob Wilson
9c1ec76084
Rename file to have the correct suffix.
...
llvm-svn: 69380
2009-04-17 20:40:20 +00:00
Bob Wilson
ea09d4aca8
Clean up formatting, remove trailing whitespace, fix comment typos and
...
punctuation. No functional changes.
llvm-svn: 69378
2009-04-17 20:35:10 +00:00
Dan Gohman
b47514dfe8
Delete an unused field.
...
llvm-svn: 69375
2009-04-17 20:03:31 +00:00
Bob Wilson
a4c2290e5f
Use CallConvLower.h and TableGen descriptions of the calling conventions
...
for ARM. Patch by Sandeep Patel.
llvm-svn: 69371
2009-04-17 19:07:39 +00:00
Jim Grosbach
7da1b90597
Update information on canadian cross builds
...
llvm-svn: 69358
2009-04-17 17:25:16 +00:00
David Greene
22fa407ed7
Use a safer iterator interface and get rid of std C++ library misuse.
...
This fixes a --enable-expensive-checks problem.
llvm-svn: 69353
2009-04-17 14:56:18 +00:00
David Greene
c0a34a0730
Regenerate configure.
...
llvm-svn: 69352
2009-04-17 14:50:39 +00:00
David Greene
80f48bd13f
Add a --enable-profiling option to configure to build Debug+Profile and
...
Opt+Profile tools. Now we can profile any kind of flavor we build.
llvm-svn: 69351
2009-04-17 14:49:22 +00:00
Rafael Espindola
355fe12c82
For general dynamic TLS access we must use
...
leaq foo@TLSGD(%rip), %rdi
as part of the instruction sequence. Using a register other than %rdi and then
copying it to %rdi is not valid.
llvm-svn: 69350
2009-04-17 14:35:58 +00:00
Bill Wendling
30527b1114
Revert r69335 and r69336. They were causing build failures.
...
llvm-svn: 69347
2009-04-17 04:19:22 +00:00
Dan Gohman
d2d6fd806c
Don't create ConstantInts with pointer type. This fixes a
...
regression in 403.gcc in PIC_CODEGEN=1 and DISABLE_LTO=1
mode.
llvm-svn: 69344
2009-04-17 02:02:52 +00:00
Evan Cheng
b96a1082a9
Teach spiller to unfold instructions which modref spill slot when a scratch
...
register is available and when it's profitable.
e.g.
xorq %r12<kill>, %r13
addq %rax, -184(%rbp)
addq %r13, -184(%rbp)
==>
xorq %r12<kill>, %r13
movq -184(%rbp), %r12
addq %rax, %r12
addq %r13, %r12
movq %r12, -184(%rbp)
Two more instructions, but fewer memory accesses. It can also open up
opportunities for more optimizations.
llvm-svn: 69341
2009-04-17 01:29:40 +00:00
Dan Gohman
09dbb0b5e0
MOV8rr_NOREX is a "Move" instruction. This doesn't currently
...
matter, because this instruction isn't generated until after
things that care.
llvm-svn: 69336
2009-04-17 00:45:17 +00:00
Dan Gohman
74835ce1cb
Don't use MOV8rr_NOREX on x86-32. It doesn't actually hurt anything at
...
present, but it's inconsistent.
llvm-svn: 69335
2009-04-17 00:43:09 +00:00
Chris Lattner
a8919d0a35
Fix some failures in targets on available_externally functions,
...
this fixes a crash on CodeGen/Generic/externally_available.ll
on ppc hosts. Thanks to Nicholas L for pointing this out.
llvm-svn: 69333
2009-04-17 00:26:12 +00:00
Dan Gohman
fec1d086e0
Use TargetData::getTypeSizeInBits instead of getPrimitiveSizeInBits()
...
to get the correct answer for pointer types.
llvm-svn: 69321
2009-04-16 22:35:57 +00:00
Bob Wilson
b8c370a8b5
Fix PR3994: LLVMMatchType arguments do not refer to absolute return value
...
and argument positions but only to the overloaded intrinsic parameters.
Keep a separate list of these overloaded parameters in CodeGenTarget.cpp
so they can be resolved easily. Remove assertions from IntrinsicEmitter.cpp:
they were harmless but confusing, and the assertions elsewhere in TableGen
will catch any incorrect values.
llvm-svn: 69316
2009-04-16 21:51:05 +00:00
Chris Lattner
11ceb38df0
make sure to unlock keymgr if the JIT is created and destroyed, all
...
locks must be matched with unlocks. Also, use calloc to allocate the
block so that it is properly zero'd. Thanks to Nick Kledzik for
tracking this down.
llvm-svn: 69314
2009-04-16 21:47:59 +00:00
Bob Wilson
de578e8cc6
Add a comment to describe LLVMMatchType.
...
llvm-svn: 69313
2009-04-16 21:46:42 +00:00
Eli Friedman
929207fd1d
Fix for PR3944: make mem2reg O(N) instead of O(N^2) in the number of
...
incoming edges for a block with many predecessors.
llvm-svn: 69312
2009-04-16 21:40:28 +00:00
Dan Gohman
72dc8452a3
Handle a pointer type correctly in SCEVExpander::visitAddRecExpr.
...
llvm-svn: 69310
2009-04-16 21:34:54 +00:00
Dan Gohman
eefba6bbe0
In the list-burr's pseudo two-addr dependency heuristics, don't
...
add dependencies on nodes with exactly one successor which is a
COPY_TO_REGCLASS node. In the case that the copy is coalesced
away, the dependence should be on the user of the copy, rather
than the copy itself.
llvm-svn: 69309
2009-04-16 20:59:02 +00:00
Dan Gohman
3027bb6953
Handle SUBREG_TO_REG instructions with the same heuristics
...
as INSERT_SUBREG instructions in the list-burr scheduler.
llvm-svn: 69308
2009-04-16 20:57:10 +00:00
Dan Gohman
c1c2ba7a72
Fix a bug with inttoptr/ptrtoint casts where the pointer has a different
...
size from the integer, requiring zero extension or truncation. Don't
create ZExtInsts with pointer types. This fixes a regression in
consumer-jpeg.
llvm-svn: 69307
2009-04-16 19:25:55 +00:00
Devang Patel
dab01f3fd6
Do not treat beginning of inlined scope as beginning of normal function scope if the location info is missing.
...
Insetad of doing ...
if (inlined_subroutine && known_location)
DW_TAG_inline_subroutine
else
DW_TAG_subprogram
do
if (inlined_subroutine) {
if (known_location)
DW_TAG_inline_subroutine
} else {
DW_TAG_subprogram
}
llvm-svn: 69300
2009-04-16 17:55:30 +00:00
Dan Gohman
8b6ebb1112
Minor code simplifications. Don't attempt LSR on theoretical
...
targets with pointers larger than 64 bits, due to the code not
yet being APInt clean.
llvm-svn: 69296
2009-04-16 16:49:48 +00:00
Dan Gohman
e2ead2c328
LSR is no longer a GEP optimizer. It is now an IV expression
...
optimizer, which just happen to frequently involve optimizing GEPs.
llvm-svn: 69295
2009-04-16 16:46:01 +00:00
Dan Gohman
e98ead45e2
Fix SCEVExpander::visitSMaxExpr and SCEVExpander::visitUMaxExpr to
...
not create ICmpInsts with operands of different types. This fixes
a regression in Applications/d/make_dparser.
llvm-svn: 69294
2009-04-16 16:15:25 +00:00
Dan Gohman
66e038a3e3
Teach SCEVExpander::InsertCastOfTo to avoid creating inttoptr-of-ptrtoint
...
and ptrtoint-of-inttoptr expressions. This fixes a regression in 300.twolf.
llvm-svn: 69293
2009-04-16 15:52:57 +00:00
Dan Gohman
a8be04b2db
Use ConstantExpr::getIntToPtr instead of SCEVExpander::InsertCastOfTo,
...
since the operand is always a constant.
llvm-svn: 69291
2009-04-16 15:48:38 +00:00
Dan Gohman
71bccd3e0e
Use a SCEV expression cast instead of immediately inserting a
...
new instruction with SCEVExpander::InsertCastOfTo.
llvm-svn: 69290
2009-04-16 15:47:35 +00:00
Devang Patel
9ac4390bf4
Record line number at the beginning of a func.start.
...
This line was accidently lost yesterday.
llvm-svn: 69286
2009-04-16 15:07:09 +00:00
Rafael Espindola
5e42177a0f
fix PR3995. A scale must be 1, 2, 4 or 8.
...
llvm-svn: 69284
2009-04-16 12:34:53 +00:00
Chris Lattner
cce520f884
prove diagnostic -> group mapping information.
...
llvm-svn: 69270
2009-04-16 05:52:18 +00:00
Dan Gohman
0a40ad93a9
Expand GEPs in ScalarEvolution expressions. SCEV expressions can now
...
have pointer types, though in contrast to C pointer types, SCEV
addition is never implicitly scaled. This not only eliminates the
need for special code like IndVars' EliminatePointerRecurrence
and LSR's own GEP expansion code, it also does a better job because
it lets the normal optimizations handle pointer expressions just
like integer expressions.
Also, since LLVM IR GEPs can't directly index into multi-dimensional
VLAs, moving the GEP analysis out of client code and into the SCEV
framework makes it easier for clients to handle multi-dimensional
VLAs the same way as other arrays.
Some existing regression tests show improved optimization.
test/CodeGen/ARM/2007-03-13-InstrSched.ll in particular improved to
the point where if-conversion started kicking in; I turned it off
for this test to preserve the intent of the test.
llvm-svn: 69258
2009-04-16 03:18:22 +00:00
Chris Lattner
1e86593b6a
encode subgroups into the clang .inc file. -Wall now works!
...
llvm-svn: 69257
2009-04-16 03:16:12 +00:00
Devang Patel
653dee0884
In -fast mode do what FastISel does.
...
This code could use some refactoring help!
llvm-svn: 69254
2009-04-16 02:33:41 +00:00
Devang Patel
46b04e4d06
If FastISel is run and it has known DebugLoc then use it.
...
llvm-svn: 69253
2009-04-16 01:33:10 +00:00
Devang Patel
43fc7e481b
If location where the function was inlined is not know then do not emit debug info describing inlinied region.
...
llvm-svn: 69252
2009-04-16 01:31:54 +00:00
Chris Lattner
13507d6cba
start producing subgroup info.
...
llvm-svn: 69249
2009-04-16 00:53:25 +00:00
Dale Johannesen
8958f4f30f
Another testcase for IV shortening.
...
llvm-svn: 69247
2009-04-16 00:45:21 +00:00
Dale Johannesen
a71daa83c6
Eliminate zext over (iv | const) or (signed iv),
...
and sext over (iv | const), if a longer iv is
available. Allow expressions to have more than
one zext/sext parent. All from OpenSSL.
llvm-svn: 69241
2009-04-15 23:31:51 +00:00
Chris Lattner
4816a3488f
make sure that empty diag groups get known by clang.
...
llvm-svn: 69235
2009-04-15 22:33:02 +00:00
Chris Lattner
bcba418569
implement support for writing out diagnostic group tables.
...
llvm-svn: 69219
2009-04-15 20:55:08 +00:00
Devang Patel
31043aa200
s/RootDbgScope/FunctionDbgScope/g
...
llvm-svn: 69216
2009-04-15 20:41:31 +00:00
Dale Johannesen
82230b5b17
Eliminate zext over (iv & const) or ((iv+const)&const)
...
if a longer iv is available. These subscript forms are
not common; they're a bottleneck in OpenSSL.
llvm-svn: 69215
2009-04-15 20:41:02 +00:00
Chris Lattner
e05d99f604
use UppercaseString instead of EmitAllCaps
...
llvm-svn: 69213
2009-04-15 20:16:12 +00:00
Chris Lattner
3983dfdc83
use escape string.
...
llvm-svn: 69212
2009-04-15 20:13:18 +00:00
Chris Lattner
baf9535284
teach EscapeString and UnescapeString to handle ".
...
llvm-svn: 69211
2009-04-15 20:12:52 +00:00
Devang Patel
2738d7312a
Add DISubprogram is not null check.
...
This fixes test/CodeGen//2009-01-21-invalid-debug-info.m test case.
llvm-svn: 69210
2009-04-15 20:11:08 +00:00
Dan Gohman
8aa28b9c34
Generalize one of the SelectionDAG::ReplaceAllUsesWith overloads
...
to support replacing a node with another that has a superset of
the result types. Use this instead of calling
ReplaceAllUsesOfValueWith for each value.
llvm-svn: 69209
2009-04-15 20:06:30 +00:00
Chris Lattner
c2ac800cd7
rename -gen-clang-diags-options -> -gen-clang-diag-groups
...
llvm-svn: 69208
2009-04-15 20:02:32 +00:00
Chris Lattner
b4494eb887
move clang-specific makefile goop to clang makefile.
...
llvm-svn: 69206
2009-04-15 19:57:42 +00:00
Dan Gohman
de7b3e74be
Fix 80-column violations.
...
llvm-svn: 69204
2009-04-15 19:48:57 +00:00
Dan Gohman
6711216e84
Add a folding table entry for MOV8rr_NOREX.
...
llvm-svn: 69203
2009-04-15 19:48:28 +00:00
Devang Patel
70307db0d5
Check isInlinedSubroutine() before creating DW_TAG_inlined_subroutine.
...
llvm-svn: 69202
2009-04-15 19:42:57 +00:00
Dan Gohman
37608532c4
Fix MachineInstr::getNumExplicitOperands to count
...
variadic operands correctly. Patch by Jakob Stoklund Olesen!
llvm-svn: 69190
2009-04-15 17:59:11 +00:00
Chris Lattner
06a7f37265
don't infer diag class from parenting relations, make it an explicit field
...
in the record.
llvm-svn: 69176
2009-04-15 16:55:46 +00:00
Chris Lattner
4e7b579ecc
include the default mapping in the clang diagnostic .inc files.
...
llvm-svn: 69173
2009-04-15 16:43:18 +00:00
Chris Lattner
3dfaeeaefc
minor cleanups
...
llvm-svn: 69152
2009-04-15 06:26:49 +00:00
Nick Lewycky
4a7bcf6410
Limit the number of times we're willing to chase pointers. Removes an O(n^2)
...
problem from instcombine.
llvm-svn: 69151
2009-04-15 06:23:41 +00:00
Douglas Gregor
0da0f22545
Allow jumping to the end of a bitstream while reading
...
llvm-svn: 69145
2009-04-15 04:53:47 +00:00
Bill Wendling
066b8023a4
Check for alignment.
...
llvm-svn: 69140
2009-04-15 04:51:05 +00:00
Bill Wendling
64602b1ed6
More obsessive reformatting. Fixed some validation errors.
...
llvm-svn: 69130
2009-04-15 02:12:37 +00:00
Dan Gohman
3fea040c19
Don't use "protected:" in classes that aren't intended to be
...
subclassed.
llvm-svn: 69129
2009-04-15 01:47:03 +00:00
Dan Gohman
19e7a32457
Fix doxygen comment syntax.
...
llvm-svn: 69128
2009-04-15 01:44:07 +00:00
Dan Gohman
6f873b446a
Fix X86MachineFunctionInfo's doxygen comment.
...
llvm-svn: 69127
2009-04-15 01:20:18 +00:00
Dan Gohman
210448c233
Move MachineRegisterInfo::setRegClass out of line.
...
llvm-svn: 69126
2009-04-15 01:19:35 +00:00
Dan Gohman
505065cdd0
Move MachineJumpTableInfo::ReplaceMBBInJumpTables out of line.
...
llvm-svn: 69125
2009-04-15 01:18:49 +00:00
Dan Gohman
89892b05c7
Give RemoveRegOperandFromRegInfo a comment and move the
...
code out of line.
llvm-svn: 69124
2009-04-15 01:17:37 +00:00
Dale Johannesen
7ffb7d5728
Enhance induction variable code to remove the
...
sext around sext(shorter IV + constant), using a
longer IV instead, when it can figure out the
add can't overflow. This comes up a lot in
subscripting; mainly affects 64 bit.
llvm-svn: 69123
2009-04-15 01:10:12 +00:00
Evan Cheng
ffb83a155e
Avoid making the transformation enabled by my last patch if the new destinations have phi nodes.
...
llvm-svn: 69121
2009-04-15 00:43:54 +00:00
Devang Patel
046bf624b9
While inlining, clone llvm.dbg.func.start intrinsic and adjust
...
llvm.dbg.region.end instrinsic. This nested llvm.dbg.func.start/llvm.dbg.region.end pair now enables DW_TAG_inlined_subroutine support in code generator.
llvm-svn: 69118
2009-04-15 00:17:06 +00:00
Chris Lattner
0813c0c34c
silence a warning.
...
llvm-svn: 69117
2009-04-15 00:16:05 +00:00
Devang Patel
32d17a1a29
Construct and emit DW_TAG_inlined_subroutine DIEs for inlined subroutine scopes (only in FastISel mode).
...
llvm-svn: 69116
2009-04-15 00:10:26 +00:00
Dan Gohman
dd07f638f5
Do for GR16_NOREX what r69049 did for GR8_NOREX, to avoid trouble with
...
the local register allocator.
llvm-svn: 69115
2009-04-15 00:10:16 +00:00
Devang Patel
1be3b53d3c
Add a method to check that the subprogram holds debug info for the given Function or not.
...
llvm-svn: 69113
2009-04-15 00:06:07 +00:00
Dan Gohman
7913ea5e4a
Add a new MOV8rr_NOREX, and make X86's copyRegToReg use it when
...
either the source or destination is a physical h register.
This fixes sqlite3 with the post-RA scheduler enabled.
llvm-svn: 69111
2009-04-15 00:04:23 +00:00
Bill Wendling
e665e3cf2f
Testcase for r69104.
...
llvm-svn: 69110
2009-04-15 00:04:11 +00:00
Dan Gohman
821e13a8f4
GR8_NOREX can contain the H registers, since they don't require
...
REX prefixes.
llvm-svn: 69108
2009-04-15 00:00:48 +00:00
Evan Cheng
5ebf2acd84
Optimize conditional branch on i1 phis with non-constant inputs.
...
This turns:
eq:
%3 = icmp eq i32 %1, %2
br label %join
ne:
%4 = icmp ne i32 %1, %2
br label %join
join:
%5 = phi i1 [%3, %eq], [%4, %ne]
br i1 %5, label %yes, label %no
=>
eq:
%3 = icmp eq i32 %1, %2
br i1 %3, label %yes, label %no
ne:
%4 = icmp ne i32 %1, %2
br i1 %4, label %yes, label %no
llvm-svn: 69102
2009-04-14 23:40:03 +00:00
Dan Gohman
86e43e7999
Fix the RUN lines so that this test actually tests.
...
llvm-svn: 69096
2009-04-14 22:50:17 +00:00
Dan Gohman
62f4498646
For the h-register addressing-mode trick, use the correct value for
...
any non-address uses of the address value. This fixes 186.crafty.
llvm-svn: 69094
2009-04-14 22:45:05 +00:00
Evan Cheng
3f1a3008f4
Mac OS X 10.6 and above do not use key manager to register EH frames.
...
llvm-svn: 69090
2009-04-14 22:31:59 +00:00
Dan Gohman
e5cd1fcdb9
When the result of an EXTRACT_SUBREG, INSERT_SUBREG, or SUBREG_TO_REG
...
operator is used by a CopyToReg to export the value to a different
block, don't reuse the CopyToReg's register for the subreg operation
result if the register isn't precisely the right class for the
subreg operation.
Also, rename the h-registers.ll test, now that there are more
than one.
llvm-svn: 69087
2009-04-14 22:17:14 +00:00
Mikhail Glushenkov
60cde5ba7c
Call CreateProcess with bInheritHandles = TRUE.
...
Makes llvmc show error messages printed by child processes when run from the
Cygwin/MSYS shell. Since ExecuteAndWait does not return until the child program
has finished execution, this change should be harmless.
llvm-svn: 69082
2009-04-14 21:31:36 +00:00
Mikhail Glushenkov
3a62efb732
Delete trailing whitespace.
...
llvm-svn: 69081
2009-04-14 21:31:14 +00:00
Evan Cheng
dfbbf5c043
Some of GR8_NOREX registers are only available in 64-bit mode.
...
llvm-svn: 69049
2009-04-14 16:57:43 +00:00
Sanjiv Gupta
92bb846e2b
Handle aggregate type arguments to direct and indirect calls.
...
llvm-svn: 69022
2009-04-14 02:49:52 +00:00
Dale Johannesen
b866ce73b2
Use the output of the asm so the optimizer won't
...
delete it.
llvm-svn: 69018
2009-04-14 01:51:40 +00:00
Owen Anderson
a1902318e3
LoopIndexSplit needs to inform the loop pass manager of the instructions it is
...
deleting, not just the basic block.
llvm-svn: 69011
2009-04-14 01:04:19 +00:00
Dale Johannesen
83593f4167
Do not force asm's to be chained if they don't touch
...
memory and aren't volatile. This was interfering with
good scheduling.
llvm-svn: 69008
2009-04-14 00:56:56 +00:00
Evan Cheng
9787183b9b
Fix PR3934 part 2. findOnlyInterestingUse() was not setting IsCopy and IsDstPhys which are returned by value and used by callee. This happened to work on the earlier test cases because of a logic error in the caller side.
...
llvm-svn: 69006
2009-04-14 00:32:25 +00:00
Daniel Dunbar
097f630dad
Make these errors more noticable in build logs.
...
llvm-svn: 68998
2009-04-13 22:26:09 +00:00
Bob Wilson
59dbbb2bb4
Change SelectionDAG type legalization to allow BUILD_VECTOR operands to be
...
promoted to legal types without changing the type of the vector. This is
following a suggestion from Duncan
(http://lists.cs.uiuc.edu/pipermail/llvmdev/2009-February/019923.html ).
The transformation that used to be done during type legalization is now
postponed to DAG legalization. This allows the BUILD_VECTORs to be optimized
and potentially handled specially by target-specific code.
It turns out that this is also consistent with an optimization done by the
DAG combiner: a BUILD_VECTOR and INSERT_VECTOR_ELT may be combined by
replacing one of the BUILD_VECTOR operands with the newly inserted element;
but INSERT_VECTOR_ELT allows its scalar operand to be larger than the
element type, with any extra high bits being implicitly truncated. The
result is a BUILD_VECTOR where one of the operands has a type larger the
the vector element type.
Any code that operates on BUILD_VECTORs may now need to be aware of the
potential type discrepancy between the vector element type and the
BUILD_VECTOR operands. This patch updates all of the places that I could
find to handle that case.
llvm-svn: 68996
2009-04-13 22:05:19 +00:00
Dan Gohman
6c1426308c
Rename COPY_TO_SUBCLASS to COPY_TO_REGCLASS, and generalize
...
it accordingly. Thanks to Jakob Stoklund Olesen for pointing
out how this might be useful.
llvm-svn: 68986
2009-04-13 21:06:25 +00:00
Bob Wilson
f6c2195383
Refactor some code in SelectionDAGLegalize::ExpandBUILD_VECTOR.
...
llvm-svn: 68981
2009-04-13 20:20:30 +00:00
Evan Cheng
f0843803a0
PR3934: Fix a bogus two-address pass assertion.
...
llvm-svn: 68979
2009-04-13 20:04:24 +00:00
Bill Wendling
7aba8e30c4
Get rid of some compile warnings.
...
llvm-svn: 68978
2009-04-13 19:45:05 +00:00
Douglas Gregor
afbe7d53f5
Add a static APInt::getNumWords
...
llvm-svn: 68977
2009-04-13 19:43:10 +00:00
Devang Patel
0431504fb2
Right now, Debugging information to encode scopes (DW_TAG_lexical_block) relies on DBG_LABEL. Unfortunately this intefers with the quality of optimized code.
...
This patch updates dwarf writer to encode scoping information in DWARF only in FastISel mode.
llvm-svn: 68973
2009-04-13 18:13:16 +00:00
Devang Patel
80be3511ed
Reapply 68847.
...
Now debug_inlined section is covered by TAI->doesDwarfUsesInlineInfoSection(), which is false by default.
llvm-svn: 68964
2009-04-13 17:02:03 +00:00
Dan Gohman
57d6bd36b2
Implement x86 h-register extract support.
...
- Add patterns for h-register extract, which avoids a shift and mask,
and in some cases a temporary register.
- Add address-mode matching for turning (X>>(8-n))&(255<<n), where
n is a valid address-mode scale value, into an h-register extract
and a scaled-offset address.
- Replace X86's MOV32to32_ and related instructions with the new
target-independent COPY_TO_SUBREG instruction.
On x86-64 there are complicated constraints on h registers, and
CodeGen doesn't currently provide a high-level way to express all of them,
so they are handled with a bunch of special code. This code currently only
supports extracts where the result is used by a zero-extend or a store,
though these are fairly common.
These transformations are not always beneficial; since there are only
4 h registers, they sometimes require extra move instructions, and
this sometimes increases register pressure because it can force out
values that would otherwise be in one of those registers. However,
this appears to be relatively uncommon.
llvm-svn: 68962
2009-04-13 16:09:41 +00:00
Dan Gohman
60a446ab02
Add a new TargetInstrInfo MachineInstr opcode, COPY_TO_SUBCLASS.
...
This will be used to replace things like X86's MOV32to32_.
Enhance ScheduleDAGSDNodesEmit to be more flexible and robust
in the presense of subregister superclasses and subclasses. It
can now cope with the definition of a virtual register being in
a subclass of a use.
Re-introduce the code for recording register superreg classes and
subreg classes. This is needed because when subreg extracts and
inserts get coalesced away, the virtual registers are left in
the correct subclass.
llvm-svn: 68961
2009-04-13 15:38:05 +00:00
Dan Gohman
f20462c217
Remove x86's special-case handling for ISD::TRUNCATE and
...
ISD::SIGN_EXTEND_INREG. Tablegen-generated code can handle
these cases, and the scheduling issues observed earlier
appear to be resolved now.
llvm-svn: 68959
2009-04-13 15:29:31 +00:00
Dan Gohman
e9432dcc0d
Fix copy+pastos in comments.
...
llvm-svn: 68958
2009-04-13 15:28:29 +00:00
Dan Gohman
e14b8d9853
Generalize getRegisterClassForRegister to handle registers
...
in multiple classes in the case that the classes are all
in subset/superset relations. This function is used by the
fast-isel emitter, which always wants the super-most set.
llvm-svn: 68957
2009-04-13 15:24:11 +00:00
Dan Gohman
1d50407932
Don't abort on an aliasing physical register that does not have
...
a live interval. This is needed for some upcoming subreg changes.
llvm-svn: 68956
2009-04-13 15:22:29 +00:00
Dan Gohman
4d62ff1483
When assigning a physical register to a MachineOperand, set
...
the subreg field to 0, since the subreg field is only used
for virtual register subregs. This doesn't change
current functionality; it just eliminates bogus noise from
debug output.
llvm-svn: 68955
2009-04-13 15:21:32 +00:00
Dan Gohman
9e3eb7bcd9
List the l registers before h registers, for consistency.
...
llvm-svn: 68954
2009-04-13 15:18:42 +00:00
Dan Gohman
85abd983f2
Add an assertion to verify that a copy was actually emitted.
...
llvm-svn: 68953
2009-04-13 15:16:56 +00:00
Dan Gohman
092b8b6fdb
Use X86::SUBREG_8BIT instead of hard-coding the equivalent constant.
...
llvm-svn: 68951
2009-04-13 15:14:03 +00:00
Dan Gohman
c5c2fc45ae
Add a comment about MOVSX64rr8.
...
llvm-svn: 68950
2009-04-13 15:13:28 +00:00
Dan Gohman
04b482227a
Add comments to INSERT_SUBREG, EXTRACT_SURBEG, SUBREG_TO_REG,
...
and IMPLICIT_DEF.
llvm-svn: 68949
2009-04-13 15:12:29 +00:00
Dan Gohman
39aa13a401
Fix another hard-coded constant to use X86AddrNumOperands.
...
This unbreaks the JIT on x86-64.
llvm-svn: 68948
2009-04-13 15:04:25 +00:00
Rafael Espindola
6d6c6043ea
X86-64 TLS support for local exec and initial exec.
...
llvm-svn: 68947
2009-04-13 13:02:49 +00:00
Sanjiv Gupta
0368bc4703
While passing arg of types larger than char only one byte at lower end was getting passed. We couldn't catch this as we did not have tests that were passing an int value larger than 256.
...
llvm-svn: 68946
2009-04-13 09:38:38 +00:00
Nick Lewycky
e2b8261d87
Fix ocaml bindings; add "available_externally" linkage type.
...
llvm-svn: 68945
2009-04-13 07:02:32 +00:00
Nick Lewycky
8019af6b2c
Fix warning in .ll parser, detect and reject available_externally on function
...
declarations.
llvm-svn: 68944
2009-04-13 07:02:02 +00:00
Chris Lattner
2dba0f0d75
add AvailableExternally linkage to C bindings.
...
llvm-svn: 68942
2009-04-13 06:25:37 +00:00
Chris Lattner
184f1be4a8
Add a new "available_externally" linkage type. This is intended
...
to support C99 inline, GNU extern inline, etc. Related bugzilla's
include PR3517, PR3100, & PR2933. Nothing uses this yet, but it
appears to work.
llvm-svn: 68940
2009-04-13 05:44:34 +00:00
Chris Lattner
836e77d161
eliminate unneeded parens.
...
llvm-svn: 68939
2009-04-13 05:38:23 +00:00
Nick Lewycky
11dc7c1a34
Regenerate.
...
llvm-svn: 68938
2009-04-13 04:26:27 +00:00
Nick Lewycky
e54da991d1
Link against libffi if available, fall back to "no external calls from
...
interpreter mode" when it's not.
llvm-svn: 68937
2009-04-13 04:26:06 +00:00
Nick Lewycky
04adcf153d
Add paragraph tags.
...
llvm-svn: 68934
2009-04-13 02:03:40 +00:00
Chris Lattner
ce8b7d2e24
fix PR3965:SIGINT handler not restored after calling ParseAST(),
...
patch by Alexei Svitkine!
llvm-svn: 68929
2009-04-12 23:33:13 +00:00
Rafael Espindola
7186f20a1b
In X86DAGToDAGISel::MatchWrapper, if base or index are set, avoid matching
...
only if symbolic addresses are RIP relatives.
llvm-svn: 68924
2009-04-12 23:00:38 +00:00
Owen Anderson
deadae28ea
Use a hashtable for TargetRegisterClass::contains.
...
llvm-svn: 68922
2009-04-12 22:31:17 +00:00
Rafael Espindola
6688b0a5da
refactor some code into X86DAGToDAGISel::MatchWrapper
...
llvm-svn: 68915
2009-04-12 21:55:03 +00:00
Nick Lewycky
109af6232b
Add Kaleidoscope to examples/ so that it gets built regularly and we'll notice
...
if an API change causes it to be out of date. The code is copied out of
LangImpl7.html.
llvm-svn: 68912
2009-04-12 20:47:23 +00:00
Nick Lewycky
4ac15cee54
Fix compile error. Pointed out by mait on #llvm IRC!
...
llvm-svn: 68910
2009-04-12 20:15:44 +00:00
Chris Lattner
6cd82fb430
"There was a typo in my previous patch which leads to miscompilation of
...
strncat :(
strncat(foo, "bar", 99)
would be optimized to
memcpy(foo+strlen(foo), "bar", 100, 1)
instead of
memcpy(foo+strlen(foo), "bar", 4, 1)"
Patch by Benjamin Kramer!
llvm-svn: 68905
2009-04-12 18:22:33 +00:00
Rafael Espindola
e4bd8904f7
Add tests for the parts of X86-64 TLS that are already implemented.
...
llvm-svn: 68901
2009-04-12 10:43:41 +00:00
Chris Lattner
ce6bcf0847
fix a cross-block fastisel crash handling overflow intrinsics.
...
See comment for details. This fixes rdar://6772169
llvm-svn: 68890
2009-04-12 07:51:14 +00:00
Chris Lattner
a101f6f8d3
make UpdateValueMap handle the possiblity that we could be
...
copying into the right register, avoiding a copy.
llvm-svn: 68889
2009-04-12 07:46:30 +00:00
Chris Lattner
ada5d6c37e
optimize FastISel::UpdateValueMap to avoid duplicate map lookups,
...
and make it return the assigned register.
llvm-svn: 68888
2009-04-12 07:45:01 +00:00
Chris Lattner
99a8cb627d
simplify code by using IntrinsicInst.
...
llvm-svn: 68887
2009-04-12 07:36:01 +00:00
Chris Lattner
24ac95abc1
Add new TargetInstrDesc::hasImplicitUseOfPhysReg and
...
hasImplicitDefOfPhysReg methods. Use them to remove a
look in X86 fast isel.
llvm-svn: 68886
2009-04-12 07:26:51 +00:00
Chris Lattner
91b6af24ac
add some optimizations for strncpy/strncat and factor some
...
code. Patch by Benjamin Kramer!
llvm-svn: 68885
2009-04-12 05:06:39 +00:00