Commit Graph

52527 Commits

Author SHA1 Message Date
Chris Lattner 372dd1ea18 Add bitcode reader and writer support for ConstantDataAggregate, which
should be feature complete now.  Lets see if it works.

llvm-svn: 149215
2012-01-30 00:51:16 +00:00
Douglas Gregor 7039e358fc Move Clang's file-level locking facility over to LLVM's support
library, since it doesn't really have anything to do with Clang.

llvm-svn: 149203
2012-01-29 20:15:10 +00:00
Anton Korobeynikov d0c46550fe Cleanups for EABI standard functions
llvm-svn: 149195
2012-01-29 09:11:50 +00:00
Anton Korobeynikov 1b42e64280 Use base AAPCS for varargs functions even for AAPCS-VFP CC
llvm-svn: 149194
2012-01-29 09:06:09 +00:00
Jakob Stoklund Olesen 198236edae Fix some scavenger performance issues.
- Don't call malloc+free in the very hot forward().
- Don't call isTiedToDefOperand().
- Don't create BitVector temporaries.
- Merge DeadRegs into KillRegs.
- Eliminate the early clobber checks, they were irrelevant to scavenging.
- Remove unnecessary code from -Asserts builds.

This speeds up ARM PEI by 3.4x and overall llc -O0 codegen time by 11%.

llvm-svn: 149189
2012-01-29 01:29:28 +00:00
Jakob Stoklund Olesen 8b1853ddef Avoid creating BitVector temporaries.
llvm-svn: 149188
2012-01-29 01:29:25 +00:00
Nick Lewycky 1b3167edec Fix typo.
llvm-svn: 149185
2012-01-28 23:33:44 +00:00
Bob Wilson de0c335560 Add a note about a potential optimization for clz/ctz patterns for ARM
(and other targets).

llvm-svn: 149182
2012-01-28 18:30:07 +00:00
James Molloy b47489d4ef Ensure .AliasedSymbol() is called on all uses of getSymbol(). Affects ARM and MIPS ELF backends.
Fixes PR11877

llvm-svn: 149180
2012-01-28 15:58:32 +00:00
Benjamin Kramer 4efe5064c3 Silence GCC's -Wreturn-type warning.
llvm-svn: 149179
2012-01-28 15:28:41 +00:00
Rafael Espindola 004725876e Small improvement to the recursion detection logic from the previous commit.
llvm-svn: 149175
2012-01-28 06:22:14 +00:00
Rafael Espindola 72f5f170c6 Handle recursive variable definitions directly. This gives us better error
messages and allows us to fix PR11865.

llvm-svn: 149174
2012-01-28 05:57:00 +00:00
Kostya Serebryany 7471d1303d [asan] correctly use ConstantExpr::getGetElementPtr. Catch by NAKAMURA Takumi
llvm-svn: 149172
2012-01-28 04:27:16 +00:00
Bill Wendling 8c09040854 Reapply r149159 with a fix to add to a PHI node with a non-null parent.
llvm-svn: 149164
2012-01-28 01:17:56 +00:00
Lang Hames d78ec25e65 Remove code that adds live ranges for dead defs. It seems to be breaking things.
llvm-svn: 149163
2012-01-28 01:17:01 +00:00
Bill Wendling fa5ad212f8 Revert r149159 until I can fix tests.
llvm-svn: 149162
2012-01-28 01:10:01 +00:00
Bill Wendling b4544544a6 Don't always create a separate block for the call to _Unwind_Resume.
Sometimes there is only one 'resume' instruction per function. In those
situations, we don't need a separate block for the call to _Unwind_Resume. In
fact, it adds a lot of overhead to code-gen if we do that -- especially at -O0.
If we have a single 'resume' instruction, just generate the call within that
block.
<rdar://problem/10694814>

llvm-svn: 149159
2012-01-28 00:47:18 +00:00
David Greene ebb006fc3d Fix Record Name Reference
Get the record name though the init to avoid an assert.

llvm-svn: 149153
2012-01-28 00:03:24 +00:00
Lang Hames a6958c6c4e Silence warning about parens for && within ||
llvm-svn: 149152
2012-01-27 23:52:25 +00:00
Rafael Espindola bb893fea6b Add r149110 back with a fix for when the vector and the int have the same
width.

llvm-svn: 149151
2012-01-27 23:33:07 +00:00
Rafael Espindola a4062624d1 Revert r149110 and add a testcase that was crashing since that revision.
Unfortunately I also had to disable constant-pool-sharing.ll the code it tests has been
updated to use the IL logic.

llvm-svn: 149148
2012-01-27 22:42:48 +00:00
Lang Hames ad33d5ace7 Add a "moveInstr" method to LiveIntervals. This can be used to move instructions
around within a basic block while maintaining live-intervals.

Updated ScheduleTopDownLive in MachineScheduler.cpp to use the moveInstr API
when reordering MIs.

llvm-svn: 149147
2012-01-27 22:36:19 +00:00
Lang Hames 6f108d9229 Backing out ill-considered 'refactor'.
llvm-svn: 149146
2012-01-27 21:43:32 +00:00
Lang Hames 376a2d3e99 Move some duplicate loops in the coalescer into their own function.
llvm-svn: 149144
2012-01-27 19:58:14 +00:00
Devang Patel 63fe5697f4 Intel Syntax: Parse mem operand with seg reg. QWORD PTR FS:[320]
llvm-svn: 149142
2012-01-27 19:48:28 +00:00
Craig Topper 5639e9e8fb Move some patterns back near their instructions and use AddedComplexity to fix priority. Merge some patterns into their instruction definition.
llvm-svn: 149122
2012-01-27 07:09:40 +00:00
Lang Hames 9e18b6672a Physreg dead defs should be handled too.
llvm-svn: 149118
2012-01-27 03:20:42 +00:00
Chris Lattner cc3aaf1836 smallvectorize.
llvm-svn: 149117
2012-01-27 03:15:49 +00:00
Chris Lattner 0256be96f2 continue making the world safe for ConstantDataVector. At this point,
we should (theoretically optimize and codegen ConstantDataVector as well
as ConstantVector.

llvm-svn: 149116
2012-01-27 03:08:05 +00:00
Bill Wendling 7717e9f4ae Place the GEP instructions nearer to the instructions which use them.
GEP instructions are there for the compiler and shouldn't really output much
code (if any at all). When a GEP is stored in the entry block, Fast ISel (for
one) will not know that it could fold it into further uses. For instance, inside
of the EH handling code. This results in a lot of unnecessary spills and loads
which bloat code and slows down pretty much everything.
<rdar://problem/10694814>

llvm-svn: 149114
2012-01-27 02:02:24 +00:00
Chris Lattner e32fad43b1 make sure the file's matching header is #include'd first.
llvm-svn: 149113
2012-01-27 01:47:28 +00:00
Chris Lattner 7ba81830ff Rewrite CanShareConstantPoolEntry to be implemented in terms of the
mid-level constant folding APIs instead of doing its own analysis.
This makes it more general (e.g. can now share a <2 x i64> with a
<4 x i32>) and avoid duplicating a bunch of logic.

llvm-svn: 149111
2012-01-27 01:46:00 +00:00
Chris Lattner 111d6ee655 enhance constant folding to be able to constant fold bitcast of
ConstantVector's to integer type.

llvm-svn: 149110
2012-01-27 01:44:03 +00:00
Jim Grosbach 8f28dbdde5 Keep source location information for X86 MCFixup's.
llvm-svn: 149106
2012-01-27 00:51:27 +00:00
Jim Grosbach d856fd0d99 Source information in 'expected relocatable expression' diagnostic.
llvm-svn: 149105
2012-01-27 00:51:23 +00:00
Jim Grosbach 20275a8577 Better user diagnostics for more ARM MachO relocation errors.
llvm-svn: 149102
2012-01-27 00:37:12 +00:00
Jim Grosbach b591277c4a Better diagnostic for malformed .org assembly directive.
Provide source line number information.

llvm-svn: 149101
2012-01-27 00:37:08 +00:00
Lang Hames 286fed5c8c Rewrite instruction operands in AdjustCopiesBackFrom. Fixes PR11861.
llvm-svn: 149097
2012-01-27 00:05:42 +00:00
Jim Grosbach 5aac954be9 Tidy up.
llvm-svn: 149096
2012-01-26 23:47:45 +00:00
Jim Grosbach 5e5eabb5ab Keep source information, if available, around for ARM Fixups.
Adjust an example MachObjectWriter diagnostic to use the information
to issue a better message.

Before:
LLVM ERROR: unknown ARM fixup kind!

After:
x.s:6:5: error: unsupported relocation on symbol
    beq bar
    ^

rdar://9800182

llvm-svn: 149093
2012-01-26 23:20:15 +00:00
Jim Grosbach b18b409258 Add simple support for keeping MCFixup source information.
Can be used to issue more user friendly diagnostics for faulty
relocation constructs and such.

llvm-svn: 149092
2012-01-26 23:20:11 +00:00
Jim Grosbach dfc5b555da Add SourceMgr to MCContext for backend diagnostics.
llvm-svn: 149090
2012-01-26 23:20:05 +00:00
Jakob Stoklund Olesen fc9dce25f7 Handle call-clobbered ymm registers on Win64.
The Win64 calling convention has xmm6-15 as callee-saved while still
clobbering all ymm registers.

Add a YMM_HI_6_15 pseudo-register that aliases the clobbered part of the
ymm registers, and mark that as call-clobbered.  This allows live xmm
registers across calls.

This hack wouldn't be necessary with RegisterMask operands representing
the call clobbers, but they are not quite operational yet.

llvm-svn: 149088
2012-01-26 22:59:28 +00:00
Chris Lattner 61a1d6cb81 progress making the world safe to ConstantDataVector. While
we're at it, allow PatternMatch's "neg" pattern to match integer
vector negations, and enhance ComputeNumSigned bits to handle
shl of vectors.

llvm-svn: 149082
2012-01-26 21:37:55 +00:00
Chris Lattner 88fce10928 tidy up forward declarations.
llvm-svn: 149078
2012-01-26 20:44:57 +00:00
Chris Lattner a474bb265b smallvectorize and ArrayRef'ize some stuff.
llvm-svn: 149077
2012-01-26 20:40:56 +00:00
Chris Lattner 37e3835a94 Reduce a lot of code duplication by implementing
ConstantExpr::getWithOperandReplaced and ConstantExpr::replaceUsesOfWithOnConstant
 in terms of ConstantExpr::getWithOperands.  While we're at it,
make sure that ConstantExpr::getWithOperands covers all instructions: it was
missing insert/extractvalue.  

llvm-svn: 149076
2012-01-26 20:37:11 +00:00
Chad Rosier 9b61cf3167 Update comment for r149070.
llvm-svn: 149075
2012-01-26 20:19:05 +00:00
Chad Rosier 1a1531d65e Replace the use of isPredicable() with isPredicated() in
MachineBasicBlock::canFallThrough().  We're interested in the state of the
instruction (i.e., is this a barrier or not?), not if the instruction is
predicable or not.
rdar://10501092

llvm-svn: 149070
2012-01-26 18:24:25 +00:00
Jakob Stoklund Olesen 8c139a5125 Clear kill flags before propagating a copy.
The live range of the source register may be extended when a redundant
copy is eliminated. Make sure any kill flags between the two copies are
cleared.

This fixes PR11765.

llvm-svn: 149069
2012-01-26 17:52:15 +00:00