Benjamin Kramer
e07d9da4f4
Simplify & microoptimize code. No intended functionality change.
...
llvm-svn: 135364
2011-07-18 00:00:20 +00:00
Nadav Rotem
4c2c253f68
Minor code cleanups
...
llvm-svn: 135362
2011-07-17 19:05:00 +00:00
Chris Lattner
1810c19d8e
tidy up
...
llvm-svn: 135360
2011-07-17 06:01:30 +00:00
Benjamin Kramer
9de5b6c35b
Silence compiler warnings.
...
llvm-svn: 135358
2011-07-16 22:26:27 +00:00
Jakub Staszak
be41018cf4
Remove unused LoopRanges from RegAllocGreedy.
...
llvm-svn: 135354
2011-07-16 20:43:00 +00:00
Jakub Staszak
7bd3be24d8
Remove "LoopInfo.h" include from BranchProbabilityInfo.h.
...
llvm-svn: 135353
2011-07-16 20:31:15 +00:00
Jakub Staszak
a0010953f7
Add MachineBlockFrequency analysis.
...
llvm-svn: 135352
2011-07-16 20:23:20 +00:00
Owen Anderson
03cf89c6f0
Revert r135319 in an attempt to get to unbreak testers.
...
llvm-svn: 135343
2011-07-16 09:17:43 +00:00
Matt Beaumont-Gay
8c4a5f3635
Silence unused variable warning
...
llvm-svn: 135339
2011-07-16 04:18:47 +00:00
Andrew Trick
3300087d49
indvars: fix a pass-sensitivity issue that would hit the SCEVExpander
...
assertion I added in r135333. Check for the existence of a preheader
before expanding a recurrence.
llvm-svn: 135335
2011-07-16 01:18:53 +00:00
Andrew Trick
3b06e51b87
indvars: remove ExprToIVMap because it won't be needed by LFTR.
...
llvm-svn: 135334
2011-07-16 01:06:48 +00:00
Andrew Trick
b2c2eec80d
Fix SCEVEXpander to handle arbitrary phi expansion. Includes two
...
related bug fixes and corresponding assertions for uninitialized data
and missing NULL check. Test cases will be included with the new LFTR.
llvm-svn: 135333
2011-07-16 00:59:39 +00:00
Bruno Cardoso Lopes
d258749f73
Add AVX 128-bit patterns for sint_to_fp
...
llvm-svn: 135332
2011-07-16 00:50:20 +00:00
Jakob Stoklund Olesen
25cece01c9
He said *before* the last split point.
...
This should unbreak the build-self-4-mingw32 tester. I have a very
complicated test case that I will try to clean up.
llvm-svn: 135329
2011-07-16 00:13:30 +00:00
Chris Lattner
b09652e74d
fix rdar://9776316 - type remapping needed for inline asm blobs,
...
fixing some objc llvm-test crashes with LTO.
llvm-svn: 135324
2011-07-15 23:18:40 +00:00
Chris Lattner
7fc89c5ff8
deconstify getType()'s.
...
llvm-svn: 135323
2011-07-15 23:15:45 +00:00
Dan Gohman
8e056f4a49
LegalizeDAG doesn't need its own copy of this enum.
...
llvm-svn: 135320
2011-07-15 22:51:43 +00:00
Owen Anderson
cd207640a2
Get rid of the separate opcodes for the Darwin versions of tBL, tBLXi, and tBLXr, using pseudo-instructions to lower to the single final opcode. Update the ARM disassembler for this change.
...
llvm-svn: 135319
2011-07-15 22:49:31 +00:00
Dan Gohman
a44add3a49
Delete LegalizeDAG's own version of isTypeLegal and getTypeAction
...
and just use the ones from TargetLowering directly.
llvm-svn: 135318
2011-07-15 22:39:09 +00:00
Bruno Cardoso Lopes
d5b62f3403
Fix a couple of things:
...
1) Make non-legal 256-bit loads to be promoted to v4i64. This lets us
canonize the loads and handle things the same way we use to handle
for 128-bit registers. Despite of what one of the removed comments
explained, the load promotion would not mess with VPERM, it's only a
matter of doing the appropriate bitcasts when this instructions comes
to be introduced. Also make LOAD v8i32 legal.
2) Doing 1) exposed two bugs:
- v4i64 was being promoted to itself for several opcodes (introduced
in r124447 by David Greene) causing endless recursion and the stack to
explode.
- there was no support for allOnes BUILD_VECTORs and ANDNP would fail to
match because it was generating early target constant pools during
lowering.
3) The testcases are already checked-in, doing 1) exposed the
bugs in the current testcases.
4) Tidy up code to be more clear and explicit about AVX.
llvm-svn: 135313
2011-07-15 22:24:33 +00:00
Bruno Cardoso Lopes
2a23e486ad
Add a few patterns for 256-bit bitcasts. No testcases now, they are
...
comming together with other tests.
llvm-svn: 135312
2011-07-15 22:24:17 +00:00
Dan Gohman
f41cbc8222
Delete an unused variable and a redundant assert.
...
llvm-svn: 135311
2011-07-15 22:19:02 +00:00
Jakob Stoklund Olesen
987cd08002
Extract parts of RAGreedy::splitAroundRegion as SplitKit methods.
...
This gets rid of some of the gory splitting details in RAGreedy and
makes them available to future SplitKit clients.
Slightly generalize the functionality to support multi-way splitting.
Specifically, SplitEditor::splitLiveThroughBlock() supports switching
between different register intervals in a block.
llvm-svn: 135307
2011-07-15 21:47:57 +00:00
Dan Gohman
038295aff9
Modernize comments.
...
llvm-svn: 135305
2011-07-15 21:42:20 +00:00
Eli Friedman
6bd9cfed88
PR10370: Make sure we know how to relax push correctly on x86-64.
...
llvm-svn: 135303
2011-07-15 21:28:39 +00:00
Devang Patel
647ad13add
Use DebugLoc directly to map inlined functions' instructions to respective lexical scope.
...
llvm-svn: 135302
2011-07-15 21:25:44 +00:00
Jakub Staszak
ada22d8fca
Fix pointer heuristic. Check whether predicator is ICMP_NE instead of if it is
...
not isEquality().
llvm-svn: 135296
2011-07-15 20:51:06 +00:00
Owen Anderson
7a380bac06
Remove VMOVDneon and VMOVQ, which are just aliases for VORR. This continues to simplify the path towards an auto-generated disassembler.
...
llvm-svn: 135290
2011-07-15 18:46:47 +00:00
Benjamin Kramer
5936e08079
ObjectFile: Add a method to check whether a section contains a symbol.
...
- No ELF or COFF implementation yet, I don't have a way to test that.
Should be straightforward to add though.
llvm-svn: 135288
2011-07-15 18:39:21 +00:00
Chad Rosier
bdf65ac132
Disable loop idiom recognition of memset/memcpy if the function being compiled
...
is named after a common idiom (i.e., memset/memcpy). Otherwise, we can run into
infinite recursion. Ideally, the user should use the correct -fno-builtin flag,
but in case they don't we should play nicely.
rdar://9763412
llvm-svn: 135286
2011-07-15 18:25:04 +00:00
Owen Anderson
4cf53f7ec4
Remove unnecessary duplicate instruction definitions that simply overloaded the type of VEXT. This can be achieved with a Pat definition, and is much more disassembler friendly.
...
llvm-svn: 135283
2011-07-15 17:48:05 +00:00
Benjamin Kramer
3a3a5a7f5e
MachOObjectFile: Get symbol functions ready for 64 bit.
...
llvm-svn: 135282
2011-07-15 17:32:45 +00:00
Frits van Bommel
6427dc44b9
No need to explicitly invoke the ArrayRef constructor here.
...
llvm-svn: 135281
2011-07-15 17:13:23 +00:00
Devang Patel
d539f30c73
Eliminate redundant map.
...
llvm-svn: 135278
2011-07-15 16:38:42 +00:00
NAKAMURA Takumi
57b7a96900
Eliminate "const" from extern const to fix breakeage since r135184 on msvc.
...
MSVC decorates (and distinguishes) "const" in mangler. It brought linkage error between "extern const" declarations and definitions.
llvm-svn: 135269
2011-07-15 12:50:21 +00:00
Frits van Bommel
9630dc9ed8
In Twine::str(), if the Twine stores only a std::string, just return a direct copy of that instead of first copying to a SmallString and converting that to a std::string. Also fix some indentation.
...
llvm-svn: 135267
2011-07-15 11:05:37 +00:00
Jay Foad
c826df8fb7
Convert CallInst and InvokeInst APIs to use ArrayRef.
...
llvm-svn: 135265
2011-07-15 08:37:34 +00:00
Chandler Carruth
cbac5b4434
Explicitly cast the second argument to unsigned in order to select the
...
desired overload.
This is a bit of a hackish workaround to fix the compile after r135259.
Let me know if there is a better approach.
llvm-svn: 135261
2011-07-15 07:31:10 +00:00
Jeffrey Yasskin
4d5d3fceaa
Add an APFloat::convertToInt(APSInt) function that automatically manages the
...
memory for the result.
llvm-svn: 135259
2011-07-15 07:04:56 +00:00
Evan Cheng
b43f66dcd3
Reverting r135232. It's causing infinite looping in DbgScope::openInsnRange.
...
llvm-svn: 135254
2011-07-15 06:26:35 +00:00
Chris Lattner
609591194a
remove the old and dangerous uncheckedReplaceAllUsesWith method,
...
which was just replaceAllUsesWith without some assertions. It was
needed back when type refinement was alive.
llvm-svn: 135253
2011-07-15 06:18:52 +00:00
Chris Lattner
6274327fff
devirtualize Constant::isNullValue:
...
4 files changed, 15 insertions(+), 60 deletions(-)
llvm-svn: 135252
2011-07-15 06:14:08 +00:00
Chris Lattner
a3a07274c9
start using the new helper methods a bit.
...
llvm-svn: 135251
2011-07-15 06:08:15 +00:00
Chris Lattner
e99d93799f
add CFP::isNegative() and ConstnatInt::isNegative() methods.
...
Devirtualize the isNegativeZeroValue method.
llvm-svn: 135249
2011-07-15 05:58:04 +00:00
Chris Lattner
20c6e388ef
bump pointer allocate LLVM IR types, since they are never deallocated.
...
llvm-svn: 135248
2011-07-15 05:49:15 +00:00
Chris Lattner
aba8e40670
remove the InvalidateStructLayoutInfo API, which is dead and unnecessary now
...
that type refinement is toast.
llvm-svn: 135245
2011-07-15 05:21:59 +00:00
Chandler Carruth
89cfaf4305
Remove an unnecessary header from this file. I don't think this header
...
was really intended, and it may have been required prior to some of the
recent refactors. Including it however causes LLVMX86Desc to need
symbols from LLVMX86CodeGen, forming a dependency cycle. This was masked
in almost all builds: Clang, and GCC w/ optimizations didn't actually
emit the symbols!
llvm-svn: 135242
2011-07-15 04:16:38 +00:00
Evan Cheng
1ae06d95e0
Move some parts of TargetAsmInfo down to MCAsmInfo. This is not the greatest
...
solution but it is a small step towards removing the horror that is
TargetAsmInfo.
llvm-svn: 135237
2011-07-15 02:09:41 +00:00
Bill Wendling
953f7ddcc2
Remove setting the bit for personality function. It should be set by the linker.
...
llvm-svn: 135236
2011-07-15 01:42:32 +00:00
Chandler Carruth
ce38403d2d
Major update to CMake build to reflect changes in r135219 in the
...
backend. Moved some MCAsmInfo files down into the MCTargetDesc
sublibraries, removed some (i suspect long) dead files from other parts
of the CMake build, etc. Also copied the include directory hack from the
Makefile.
Finally, updated the lib deps. I spot checked this, and think its
correct, but review appreciated there.
llvm-svn: 135234
2011-07-15 00:40:52 +00:00
Devang Patel
7c5092d1c2
Do not get confused by multiple empty lexical scopes inlined at one location.
...
llvm-svn: 135232
2011-07-15 00:30:39 +00:00
Benjamin Kramer
5365237e2e
Output MachO section names in the form SEGMENT,section.
...
llvm-svn: 135231
2011-07-15 00:29:02 +00:00
Benjamin Kramer
4ab7b03d14
Add support for 64 bit objects to MachOObjectFile.
...
- I don't see a better way than duplicating all the code.
llvm-svn: 135229
2011-07-15 00:14:48 +00:00
Benjamin Kramer
3622333b55
MachOObjectFile: Change isSectionText to return true for sections named text, not for load commands name __TEXT (which isn't the case in actual object files)
...
llvm-svn: 135228
2011-07-15 00:14:46 +00:00
Bill Wendling
6d36444dc5
Encode that we have a personality function.
...
llvm-svn: 135227
2011-07-15 00:07:31 +00:00
Evan Cheng
9e8f90a020
Rename createAsmInfo to createMCAsmInfo and move registration code to MCTargetDesc to prepare for next round of changes.
...
llvm-svn: 135219
2011-07-14 23:50:31 +00:00
Bill Wendling
fb25bf95c9
* If we have an LSDA, we need to mark it in the encoding.
...
* The personality function should be encoded as an absolute pointer to the function.
llvm-svn: 135215
2011-07-14 23:34:45 +00:00
Devang Patel
44a684072d
Refactor.
...
llvm-svn: 135212
2011-07-14 23:17:49 +00:00
Devang Patel
ccc8ba373c
Eliminate redundant LLVMContext argument.
...
Improve DbgScope->dump() output.
llvm-svn: 135207
2011-07-14 22:30:56 +00:00
Devang Patel
e9962ef77f
Undo r135191 (i.e. reapply Chris's patch. Now linker maps NamedMDNodes first, so there is not any need to map DebugLoc).
...
llvm-svn: 135205
2011-07-14 22:14:06 +00:00
Devang Patel
6f94a7469d
Link NamedMDNode before linking function bodies.
...
llvm-svn: 135204
2011-07-14 22:13:07 +00:00
Jim Grosbach
6122eb0fff
ARM diagnostic when 's' suffix on mnemonic that can't set flags.
...
For example, "mlss r0, r1, r2, r3".
The MLS instruction does not have a flag-setting variant.
llvm-svn: 135203
2011-07-14 22:04:21 +00:00
Bill Wendling
ed868b039b
* Redo the permutation encoding for frameless stacks to be more like what the
...
unwind library expects.
* Comment the permutation encoding for frameless stacks.
llvm-svn: 135202
2011-07-14 22:01:34 +00:00
Devang Patel
369cd5cef5
Add dump()
...
llvm-svn: 135200
2011-07-14 21:50:04 +00:00
Benjamin Kramer
cae519ebf0
Add OperandTypes for Thumb branch targets.
...
llvm-svn: 135199
2011-07-14 21:47:24 +00:00
Benjamin Kramer
d88f66e018
Port operand types for ARM and X86 over from EDIS to the .td files.
...
llvm-svn: 135198
2011-07-14 21:47:22 +00:00
Jim Grosbach
2ab898973a
ARM MCRR/MCRR2 immediate operand range checking.
...
llvm-svn: 135192
2011-07-14 21:26:42 +00:00
Chris Lattner
77acb69e12
revert r135172 until Devang and I figure out the right answer.
...
llvm-svn: 135191
2011-07-14 21:25:42 +00:00
Jim Grosbach
27ebbba831
ARM MCR/MCR2 assembly parsing operand constraints.
...
The immediate operands are restricted to 0-7. Enforce that when parsing
assembly.
llvm-svn: 135189
2011-07-14 21:19:17 +00:00
Nicolas Geoffray
94c6d2fae9
After type-system-rewrite branch update the Cpp backend to not use OpaqueType.
...
llvm-svn: 135186
2011-07-14 21:04:35 +00:00
Evan Cheng
24257cb9ea
Next round of MC refactoring. This patch factor MC table instantiations, MC
...
registeration and creation code into XXXMCDesc libraries.
llvm-svn: 135184
2011-07-14 20:59:42 +00:00
Chris Lattner
29bbec539f
simplify this logic now that GlobalAlias::isDeclaration is fixed.
...
llvm-svn: 135183
2011-07-14 20:23:05 +00:00
Chris Lattner
0e48b24f81
Fix GlobalValue::isDeclaration() to always consider aliases to be definitions.
...
llvm-svn: 135182
2011-07-14 20:22:18 +00:00
Eric Christopher
ca7ae418a5
Check register class matching instead of width of type matching
...
when determining validity of matching constraint. Allow i1
types access to the GR8 reg class for x86.
Fixes PR10352 and rdar://9777108
llvm-svn: 135180
2011-07-14 20:13:52 +00:00
Jim Grosbach
e18641e454
Reorganize ARM assembler aliases.
...
Consolidate the individual declarations together for ease of reference. This
mirrors the organization in X86, as well, so is good for consistency. No
functional change.
llvm-svn: 135179
2011-07-14 19:47:47 +00:00
Rafael Espindola
e3b7833680
Add LLVMConstNamedStruct to the C api to let its users create constants
...
of named struct types.
llvm-svn: 135178
2011-07-14 19:09:08 +00:00
Chris Lattner
6b60be1975
DebugLoc's don't hide any interesting types for TypeFinder to find.
...
llvm-svn: 135174
2011-07-14 18:58:40 +00:00
Chris Lattner
c7d5a58efc
manually copy debugloc over to a new instruction in clone() instead
...
of calling getAllMetadata(). This is semantically identical, but doing
it this way avoids unpacking the DebugLoc.
llvm-svn: 135173
2011-07-14 18:57:51 +00:00
Chris Lattner
f9d3b2a8c3
Stop the ValueMapper from calling getAllMetadata, which unpacks DebugLoc into
...
an MDNode. This saves a bunch of time and memory in the IR linker, e.g. when
doing LTO of files with debug info.
llvm-svn: 135172
2011-07-14 18:53:50 +00:00
Bruno Cardoso Lopes
d24f039847
Add 256-bit load/store recognition and matching in several places.
...
llvm-svn: 135171
2011-07-14 18:50:58 +00:00
Benjamin Kramer
8833af7c47
Don't leak operands when putting them into a shift.
...
llvm-svn: 135169
2011-07-14 18:41:22 +00:00
Jim Grosbach
aebb9cdf68
Update ARM Assembly of LDM/STM.
...
ldm/stm are the cannonical spellings for ldmia/stmia, so use them as such.
Update the parsing/encoding tests accordingly.
llvm-svn: 135168
2011-07-14 18:35:38 +00:00
Chris Lattner
5d982469f8
add comments.
...
llvm-svn: 135164
2011-07-14 18:12:44 +00:00
Chris Lattner
b3458315d4
consolidate GlobalValue::isDeclaration into one
...
non-virtual function.
llvm-svn: 135163
2011-07-14 18:10:41 +00:00
Chris Lattner
41059ff010
code cleanup
...
llvm-svn: 135157
2011-07-14 18:01:49 +00:00
Jim Grosbach
9bbc2007df
ARM ISB instruction assembly parsing.
...
The ISB instruction takes an optional operand, just like DMB/DSB. Typically
only 'sy' is meaningful.
llvm-svn: 135156
2011-07-14 18:00:31 +00:00
Benjamin Kramer
a6129829fa
Change Intrinsic::getDeclaration and friends to take an ArrayRef.
...
llvm-svn: 135154
2011-07-14 17:45:39 +00:00
Chris Lattner
f98f70f2f2
add a couple more missing C api, patch by Vitaly Lugovskiy!
...
llvm-svn: 135151
2011-07-14 16:20:28 +00:00
Richard Osborne
d73d21c487
Update XCoreRegisterInfo::eliminateFrameIndex() to handle DBG_VALUE
...
instructions.
llvm-svn: 135146
2011-07-14 14:03:48 +00:00
Frits van Bommel
5017656bef
Simplify some functions in the C API by using an ArrayRef to directly reference the array passed to them instead of copying it to a std::vector.
...
llvm-svn: 135145
2011-07-14 11:44:09 +00:00
Nadav Rotem
b93249b1e7
[VECTOR-SELECT]
...
During type legalization we often use the SIGN_EXTEND_INREG SDNode.
When this SDNode is legalized during the LegalizeVector phase, it is
scalarized because non-simple types are automatically marked to be expanded.
In this patch we add support for lowering SIGN_EXTEND_INREG manually.
This fixes CodeGen/X86/vec_sext.ll when running with the '-promote-elements'
flag.
llvm-svn: 135144
2011-07-14 11:11:14 +00:00
Nadav Rotem
1a0334b49c
Add assertion for the chain value type
...
llvm-svn: 135143
2011-07-14 10:37:54 +00:00
Chris Lattner
bd1cea5fe4
add C api for hte new type system rewrite API. Patch by Vitaly Lugovskiy!
...
llvm-svn: 135132
2011-07-14 05:53:17 +00:00
Evan Cheng
3d2be55d6c
Unfortunately several files in MC are badly violating layering rule by using
...
TargetAsmInfo, which in turn pulls in TargetRegisterInfo, etc. :-( There are
other cases of violations, but this is probably the worst.
This patch is but one small step towards fixing this. 500 more steps to go. :-(
llvm-svn: 135131
2011-07-14 05:43:07 +00:00
Jakob Stoklund Olesen
b0af7bda8d
Reapply r135121 with a fixed copy constructor.
...
Original commit message:
Count references to interference cache entries.
Each InterferenceCache::Cursor instance references a cache entry. A
non-zero reference count guarantees that the entry won't be reused for a
new register.
This makes it possible to have multiple live cursors examining
interference for different physregs.
The total number of live cursors into a cache must be kept below
InterferenceCache::getMaxCursors().
Code generation should be unaffected by this change, and it doesn't seem
to affect the cache replacement strategy either.
llvm-svn: 135130
2011-07-14 05:35:11 +00:00
Devang Patel
39f6e21de3
Simplify.
...
llvm-svn: 135127
2011-07-14 01:52:45 +00:00
Benjamin Kramer
1cab6179ab
Don't emit a bit test if there is only one case the test can yield false. A simple SETNE is sufficient.
...
llvm-svn: 135126
2011-07-14 01:38:42 +00:00
Devang Patel
1856a523ea
Simplify and delay extracting DebugLoc elements, scope and InlinedAt, as much as possible.
...
llvm-svn: 135124
2011-07-14 01:14:57 +00:00
Eric Christopher
e84fe67d4f
Add a dag combine pattern for folding C2-(A+C1) -> (C2-C1)-A
...
Fixes rdar://9761830
llvm-svn: 135123
2011-07-14 01:12:15 +00:00
Jakob Stoklund Olesen
718e76d4dd
Revert r135121 which broke a gcc-4.2 builder.
...
llvm-svn: 135122
2011-07-14 00:58:38 +00:00