Commit Graph

44938 Commits

Author SHA1 Message Date
Mikhail Glushenkov
7987e1a2c1 80-column violation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64586 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-15 11:32:31 +00:00
Duncan Sands
4782b305c2 If the target of an alias has internal linkage, then the
alias can be morphed into the target.  Implement this
transform, and fix a crash in the existing transform at
the same time.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64583 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-15 09:56:08 +00:00
Evan Cheng
b599979ab5 Fix PR3522. It's not safe to sink into landing pad BB's.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64582 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-15 08:36:12 +00:00
Evan Cheng
8f40afe62d Fix pr3571: If stride is a value defined by an instruction, make sure it dominates the loop preheader. When IV users are strength reduced, the stride is inserted into the preheader. It could create a use before def situation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64579 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-15 06:06:15 +00:00
Evan Cheng
f8546f10c2 ifdef out unneeded if statement.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64575 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-15 03:20:37 +00:00
Mikhail Glushenkov
8eada627d5 Fix warning on gcc 4.3.
"system() declared with attribute warn_unused_result."

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64574 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-15 03:20:32 +00:00
Mikhail Glushenkov
b8863a16ad Whitespace fixes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64573 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-15 03:20:03 +00:00
Cedric Venet
07b9d69ad1 Add mode_t to the config.h generated by cmake on win32. Used by clang.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64555 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-14 16:13:26 +00:00
Cedric Venet
aff9c270de Unbreak the build on win32.
Cleanup some warning.

Remark: when struct/class are declared differently than they are defined, this make problem for VC++ since it seems to mangle class differently that struct. These error are very hard to understand and find. So please, try to keep your definition/declaration in sync.

Only tested with VS2008. hope it does not break anything. feel free to revert.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64554 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-14 16:06:42 +00:00
Duncan Sands
d869b3847f Generalize some alias analysis logic from atomic
intrinsics to any IntrWriteArgMem intrinsics.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64551 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-14 10:56:35 +00:00
Mikhail Glushenkov
178eaf37f6 80-column violation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64550 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-14 08:41:25 +00:00
Duncan Sands
fadc999188 The trampoline intrinsic can be marked IntrWriteArgMem,
now that this no longer implies nocapture.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64540 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-14 05:33:26 +00:00
Duncan Sands
054a40cadb IntrWriteArgMem implies nocapture, but this wasn't
taken advantage of anywhere.  Change the definition
of IntrWriteArgMem to no longer imply nocapture, and
explicitly add nocapture attributes everywhere (well,
not quite everywhere, because some of these intrinsics
did capture their arguments!).  Also, make clear that
the lack of other side-effects does not exclude doing
volatile loads or stores - the atomic intrinsics do
these, yet they are all marked IntrWriteArgMem (this
change is safe because nothing exploited it).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64539 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-14 05:16:25 +00:00
Dan Gohman
b5aa3ad1e7 The x86-64 red zone is now being used.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64535 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-14 03:30:05 +00:00
Dan Gohman
aa03649af2 Extend the IndVarSimplify support for promoting induction variables:
- Test for signed and unsigned wrapping conditions, instead of just
   testing for non-negative induction ranges. 
 - Handle loops with GT comparisons, in addition to LT comparisons.
 - Support more cases of induction variables that don't start at 0.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64532 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-14 02:31:09 +00:00
Dan Gohman
f108e2eaaa Clarify debug output.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64531 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-14 02:26:50 +00:00
Dan Gohman
cd3eb9b098 Simplify some code. hasComputableLoopEvolution is overkill in this case.
No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64530 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-14 02:25:19 +00:00
Dale Johannesen
b463272fbb Testcase for llvm-gcc 64510.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64511 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-14 00:19:28 +00:00
Evan Cheng
c7ce29b04f Teach x86 target -soft-float.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64496 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-13 22:36:38 +00:00
Dan Gohman
03ce042d70 In CodeGenPrepare's debug output, use WriteAsOperand instead of
printing getName(), so that unnamed values are printed correctly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64468 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-13 17:45:12 +00:00
Dan Gohman
e698696569 Complete the sentance in this comment. I have reservations
about the code it describes, but at least now the comment
is right.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64465 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-13 17:36:42 +00:00
Duncan Sands
070fbe69d3 Correct a comment: since AccessArguments is now
being used for atomic intrinsics, it seems the
access may be volatile.  No code was exploiting
the original non-volatile definition, so only
the comment needs changing.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64464 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-13 17:36:13 +00:00
Duncan Sands
ddd8c450ec If a function only reads memory, then we know that...
it only reads memory!  The other change has no
functional effect, it just seems more logical to
go in order of decreasing knowledge.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64463 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-13 17:32:26 +00:00
Nick Lewycky
02b6a6a75f Mark strto* as readonly when the endptr is null.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64460 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-13 17:08:33 +00:00
Nick Lewycky
4c49841f34 On strtod and friends, mark 'endptr' nocapture in the function prototype, and
mark the first argument nocapture if endptr=NULL for each particular call.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64453 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-13 15:31:46 +00:00
Duncan Sands
e70a6835c4 Reapply r64301. These uses of "inline" can cause strange
link-time failures when building with optimization.  Just
get rid of them.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64449 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-13 09:42:34 +00:00
Evan Cheng
e2b3fdd649 Switch from new[] + delete[] to malloc + free since llvm does not catch C++ exceptions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64448 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-13 08:24:55 +00:00
Evan Cheng
726135ad1a If new[] fails, return 0 rather then trying to dereference a null pointer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64444 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-13 07:54:34 +00:00
Nick Lewycky
8968a07768 Reapply r64300:
Make sure the SCC pass manager initializes any contained
function pass managers.  Without this, simplify-libcalls
would add nocapture attributes when run on its own, but
not when run as part of -std-compile-opts or similar.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64443 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-13 07:15:53 +00:00
Nick Lewycky
826f7cebfd BasicAA was making the assumption that a local allocation which hadn't escaped
couldn't ever be the return of call instruction. However, it's quite possible
that said local allocation is itself the return of a function call. That's
what malloc and calloc are for, actually.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64442 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-13 07:06:27 +00:00
Dan Gohman
9194e8b0c8 Fix the code that checked if a SCEVAddRecExpr Start contains an
addrec in a different loop to check the value being added to
the accumulated Start value, not the Start value before it has
the new value added to it. This prevents LSR from going crazy
on the included testcase. Dale, please review.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64440 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-13 03:58:31 +00:00
Dale Johannesen
a200c8faf8 Remove non-DebugLoc versions of BuildMI.
"I got blisters on my fingers."



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64439 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-13 02:35:20 +00:00
Dale Johannesen
948175785d Remove non-DebugLoc versions of BuildMI from IA64, Mips.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64438 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-13 02:34:39 +00:00
Dale Johannesen
8d13f8f104 Remove non-DebugLoc versions of BuildMI from X86.
There were some that might even matter in X86FastISel.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64437 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-13 02:33:27 +00:00
Dale Johannesen
0b4581f16c missed file
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64436 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-13 02:32:04 +00:00
Dale Johannesen
d552eee4a0 Remove non-DebugLoc versions of buildMI from Sparc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64435 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-13 02:31:35 +00:00
Dale Johannesen
01b36e6436 Remove non-DebugLoc versions of BuildMI from Alpha and Cell.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64433 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-13 02:30:42 +00:00
Dale Johannesen
bd9ef18f74 Remove refs to non-DebugLoc version of BuildMI from XCore, PIC16.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64432 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-13 02:29:03 +00:00
Dale Johannesen
536a2f1f84 Remove refs to non-DebugLoc version of BuildMI from PowerPC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64431 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-13 02:27:39 +00:00
Dale Johannesen
8a43d98644 and one more file
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64430 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-13 02:26:21 +00:00
Dale Johannesen
b67284057e Remove refs to non-DebugLoc versions of BuildMI from ARM.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64429 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-13 02:25:56 +00:00
Bill Wendling
92c1e12647 Revert this. It was breaking stuff.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64428 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-13 02:16:35 +00:00
Bill Wendling
54fc7d6714 Turn off the old way of handling debug information in the code generator. Use
the new way, where all of the information is passed on SDNodes and machine
instructions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64427 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-13 02:01:04 +00:00
Dan Gohman
bc511725f0 Fix LSR's IV sorting function to explicitly sort by bitwidth
after sorting by stride value. This prevents it from missing
IV reuse opportunities in a host-sensitive manner.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64415 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-13 00:26:43 +00:00
Mike Stump
b445d740b2 Avoid order files for now, as they aren't supported in 3.79.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64412 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-12 23:45:11 +00:00
Dale Johannesen
c5b5051357 Check in missing file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64410 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-12 23:24:44 +00:00
Dale Johannesen
21b5541814 Eliminate a couple of non-DebugLoc BuildMI variants.
Modify callers.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64409 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-12 23:08:38 +00:00
Dan Gohman
c2390b14c9 Teach IndVarSimplify to optimize code using the C "int" type for
loop induction on LP64 targets. When the induction variable is
used in addressing, IndVars now is usually able to inserst a
64-bit induction variable and eliminates the sign-extending cast.
This is also useful for code using C "short" types for
induction variables on targets with 32-bit addressing.

Inserting a wider induction variable is easy; the tricky part is
determining when trunc(sext(i)) expressions are no-ops. This
requires range analysis of the loop trip count. A common case is
when the original loop iteration starts at 0 and exits when the
induction variable is signed-less-than a fixed value; this case
is now handled.

This replaces IndVarSimplify's OptimizeCanonicalIVType. It was
doing the same optimization, but it was limited to loops with
constant trip counts, because it was running after the loop
rewrite, and the information about the original induction
variable is lost by that point.

Rename ScalarEvolution's executesAtLeastOnce to
isLoopGuardedByCond, generalize it to be able to test for
ICMP_NE conditions, and move it to be a public function so that
IndVars can use it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64407 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-12 22:19:27 +00:00
Nate Begeman
0f123cf732 Add suppport for ConstantExprs of shufflevectors whose result type is not equal to the
type of the vectors being shuffled.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64401 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-12 21:28:33 +00:00
Dale Johannesen
78e3e521cd Arrange to print constants that match "n" and "i" constraints
in inline asm as signed (what gcc does).  Add partial support
for x86-specific "e" and "Z" constraints, with appropriate
signedness for printing.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64400 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-12 20:58:09 +00:00