Chris Lattner
92f4702254
Implement more aggressive support for analyzing string length. This
...
generalizes the previous code to handle the case when the string is not
an immediate to the strlen call (for example, crazy stuff like
strlen(c ? "foo" : "bart"+1) -> 3). This implements
gcc.c-torture/execute/builtins/strlen-2.c. I will generalize other
cases in simplifylibcalls to use the same routine later.
llvm-svn: 50408
2008-04-29 06:56:02 +00:00
Owen Anderson
304ef22f6e
Clarify what we mean by a dead loop.
...
llvm-svn: 50406
2008-04-29 06:34:55 +00:00
Chris Lattner
141d2dfd43
new testcase for PR2094. The inline asms should not pin allocas to the
...
stack anymore.
llvm-svn: 50397
2008-04-29 05:53:29 +00:00
Ted Kremenek
a374ea9a35
Update typestate logic to support GC-mode.
...
llvm-svn: 50396
2008-04-29 05:44:10 +00:00
Ted Kremenek
4b7ca776cf
Implement semantics of CFMakeCollectable for the CF-reference count checker.
...
llvm-svn: 50395
2008-04-29 05:33:51 +00:00
Ted Kremenek
4d1f422c6f
Provide the option to run the CF-retain checker in GC enabled mode.
...
The transfer functions for the checker don't do anything special yet in GC mode.
llvm-svn: 50394
2008-04-29 05:13:59 +00:00
Chris Lattner
e331a65c79
don't delete the last store to an alloca if the store is volatile.
...
llvm-svn: 50390
2008-04-29 04:58:38 +00:00
Chris Lattner
5c88f7b1ad
make the vector conversion magic handle multiple results.
...
We now compile test2/test3 to:
_test2:
## InlineAsm Start
set %xmm0, %xmm1
## InlineAsm End
addps %xmm1, %xmm0
ret
_test3:
## InlineAsm Start
set %xmm0, %xmm1
## InlineAsm End
paddd %xmm1, %xmm0
ret
as expected.
llvm-svn: 50389
2008-04-29 04:48:56 +00:00
Ted Kremenek
25a3b878e5
Convert CFLF to LF. CRLF was causing this test to fail under Mac OS X.
...
llvm-svn: 50388
2008-04-29 04:43:50 +00:00
Ted Kremenek
d796c18d7b
Add -fobjc-gc and -fobjc-gc-only options to the driver.
...
Add corresponding enum in LangOptions.
llvm-svn: 50387
2008-04-29 04:37:03 +00:00
Chris Lattner
f9a49c4322
add support for multiple return values in inline asm. This is a step
...
towards PR2094. It now compiles the attached .ll file to:
_sad16_sse2:
movslq %ecx, %rax
## InlineAsm Start
%ecx %rdx %rax %rax %r8d %rdx %rsi
## InlineAsm End
## InlineAsm Start
set %eax
## InlineAsm End
ret
which is pretty decent for a 3 output, 4 input asm.
llvm-svn: 50386
2008-04-29 04:29:54 +00:00
Evan Cheng
11b98b6612
Another extract_subreg coalescing bug.
...
e.g.
vr1024<2> extract_subreg vr1025, 2
If vr1024 do not have the same register class as vr1025, it's not safe to coalesce this away. For example, vr1024 might be a GPR32 while vr1025 might be a GPR64.
llvm-svn: 50385
2008-04-29 01:41:44 +00:00
Owen Anderson
586216e5bb
Add some more comments.
...
llvm-svn: 50384
2008-04-29 00:45:15 +00:00
Owen Anderson
41377175d3
Remove debugging code.
...
llvm-svn: 50383
2008-04-29 00:39:24 +00:00
Owen Anderson
94ad702412
Add dead loop elimination, which removes dead loops for which we can compute
...
the trip count.
llvm-svn: 50382
2008-04-29 00:38:34 +00:00
Evan Cheng
73c3b4741a
Add -march=x86.
...
llvm-svn: 50380
2008-04-28 23:31:41 +00:00
Dan Gohman
c73845b387
Update and_ops.ll according to the recent dagcombiner changes.
...
Add a new test, and_ops_more.ll, which is XFAIL'd, to
record the parts of and_ops.ll that were affected by this
change.
llvm-svn: 50379
2008-04-28 23:26:22 +00:00
Evan Cheng
315e3cb9a3
Test case.
...
llvm-svn: 50377
2008-04-28 22:14:34 +00:00
Evan Cheng
b96782ecbd
Fix a bug in RegsForValue::getCopyToRegs() that causes cyclical scheduling units. If it's creating multiple CopyToReg nodes that are "flagged" together, it should not create a TokenFactor for it's chain outputs:
...
c1, f1 = CopyToReg
c2, f2 = CopyToReg
c3 = TokenFactor c1, c2
...
= user c3, ..., f2
Now that the two CopyToReg's and the user are "flagged" together. They effectively forms a single scheduling unit. The TokenFactor is now both an operand and a successor of the Flagged nodes.
llvm-svn: 50376
2008-04-28 22:07:13 +00:00
Anton Korobeynikov
5bf6876ab8
Correct parameter attributes encoding for C bindings.
...
Patch by Anders Johnsen!
llvm-svn: 50375
2008-04-28 21:48:04 +00:00
Anton Korobeynikov
c53565c479
Add possibility of using arbitrary to to execute stuff from bugpoint.
...
Patch by Pekka Jääskeläinen!
llvm-svn: 50373
2008-04-28 20:53:48 +00:00
Dan Gohman
f06226f506
Fix a pointer-arithmetic bug that caused 64-bit host pointer values to
...
be truncated to 32 bits. This fixes the recent Benchmarks/McCat/09-vor
regression on x86-64, among other things.
llvm-svn: 50372
2008-04-28 20:25:15 +00:00
Dan Gohman
8cb19d967f
Fix DSE to not eliminate volatile loads with no uses.
...
llvm-svn: 50370
2008-04-28 19:51:27 +00:00
Dale Johannesen
adc322bb6d
Don't try to convert PPC long double.
...
llvm-svn: 50369
2008-04-28 19:46:58 +00:00
Dan Gohman
c968c1f592
Evan pointed out that folding sext to zext may not be correct
...
if the zext is not legal.
llvm-svn: 50368
2008-04-28 18:47:17 +00:00
Dan Gohman
77ce6da378
Delete an unused constructor.
...
llvm-svn: 50367
2008-04-28 18:28:49 +00:00
Dan Gohman
d961d30b7f
Add a comment to CreateRegForValue that clarifies the handling of
...
aggregate types.
llvm-svn: 50366
2008-04-28 18:19:43 +00:00
Dan Gohman
80c692d439
Rewrite the comments for RegsForValue and its members, and
...
reorder some of the members for clarity.
llvm-svn: 50365
2008-04-28 18:10:39 +00:00
Ted Kremenek
6065ef6b9b
Bug fix in CFG::getBlockEdgeImpl(): Use a BumpPtrAllocator to allocate
...
std::pair<CFGBlock*, CFGBlock*> that have an 8-byte alignment for use with
ProgramPoint. This fixes a bug reported by Argiris where using std::set<> on
Windows would result in a 4-byte alignment, not an 8-byte alignment.
Fixes: <rdar://problem/5892265>
llvm-svn: 50364
2008-04-28 18:00:46 +00:00
Ted Kremenek
f592efe3f5
Add more alignment enums.
...
llvm-svn: 50363
2008-04-28 17:58:20 +00:00
Ted Kremenek
e51f22986b
Bug fix in BumpPtrAllocator: don't assume that all objects have the same alignment. "Bump" of the pointer for the next allocated object to be of the specified alignment.
...
llvm-svn: 50362
2008-04-28 17:58:07 +00:00
Dan Gohman
14a05df97b
Don't call size() on each iteration of the loop.
...
llvm-svn: 50361
2008-04-28 17:42:03 +00:00
Gordon Henriksen
2d9cc2197a
Expose parameter attributes via C bindings.
...
Patch by Anders Johnsen!
llvm-svn: 50360
2008-04-28 17:37:06 +00:00
Dan Gohman
da44054867
Fix the SVOffset values for loads and stores produced by
...
memcpy/memset expansion. It was a bug for the SVOffset value
to be used in the actual address calculations.
llvm-svn: 50359
2008-04-28 17:15:20 +00:00
Dan Gohman
72ec3f4562
Teach InstCombine's ComputeMaskedBits what SelectionDAG's
...
ComputeMaskedBits knows about cttz, ctlz, and ctpop. Teach
SelectionDAG's ComputeMaskedBits what InstCombine's knows
about SRem. And teach them both some things about high bits
in Mul, UDiv, URem, and Sub. This allows instcombine and
dagcombine to eliminate sign-extension operations in
several new cases.
llvm-svn: 50358
2008-04-28 17:02:21 +00:00
Dan Gohman
3eb10f758e
Teach DAGCombine to convert (sext x) to (zext x) when the
...
sign-bit of x is known to be zero.
llvm-svn: 50357
2008-04-28 16:58:24 +00:00
Mikhail Glushenkov
5653d3bc48
Add support for response files to the CommandLine library.
...
llvm-svn: 50355
2008-04-28 16:44:25 +00:00
Anton Korobeynikov
fac70f2f44
Fix FP return for Win64 ABI
...
llvm-svn: 50342
2008-04-28 07:40:07 +00:00
Chris Lattner
c9e280c78a
Another collection of random cleanups. No functionality change.
...
llvm-svn: 50341
2008-04-28 07:16:35 +00:00
Chris Lattner
52504e78fb
Remove the SmallVector ctor that converts from a SmallVectorImpl. This
...
conversion open the door for many nasty implicit conversion issues, and
can be easily solved by initializing with (V.begin(), V.end()) when
needed.
This patch includes many small cleanups for sdisel also.
llvm-svn: 50340
2008-04-28 06:44:42 +00:00
Chris Lattner
d03f4516cf
restore the copy ctor in SmallVector. This fixes serious
...
errors I introduced in my last patch.
llvm-svn: 50338
2008-04-28 06:32:08 +00:00
Chris Lattner
8c7f5ad968
switch RegsForValue::Regs to be a SmallVector to avoid
...
heap thrash on tiny (usually single-element) vectors.
llvm-svn: 50335
2008-04-28 06:02:19 +00:00
Chris Lattner
84836144d9
generalize SmallVector copy ctor, there is no requirement for
...
the initialization vector to have the same fixed size, just the
same element type.
llvm-svn: 50334
2008-04-28 06:01:06 +00:00
Chris Lattner
8be72700b8
Fix PR2256, yet another miscompilation in simplifycfg of i
...
multiple return values.
Bill, please pull this into Tak.
llvm-svn: 50332
2008-04-28 00:19:07 +00:00
Chris Lattner
7855a5cb70
several multiple-retval fixes for bugpoint.
...
llvm-svn: 50331
2008-04-28 00:04:58 +00:00
Chris Lattner
d04b818a91
move static function out of anon namespace, no functionality change.
...
llvm-svn: 50330
2008-04-27 23:48:12 +00:00
Chris Lattner
122721843b
Another step to getting multiple result inline asm to work.
...
llvm-svn: 50329
2008-04-27 23:44:28 +00:00
Chris Lattner
10748d8edd
Allow asms to return multiple results by value.
...
llvm-svn: 50328
2008-04-27 23:33:55 +00:00
Anton Korobeynikov
e183b3cd76
Properly lower vararg's FORMAL_ARGUMENTS node on win64
...
llvm-svn: 50325
2008-04-27 23:15:03 +00:00
Anton Korobeynikov
b5096e9c73
Handle fp80 for win64
...
llvm-svn: 50324
2008-04-27 22:54:09 +00:00