oota-llvm.git
11 years agoMapVector: Add lookup().
Benjamin Kramer [Wed, 19 Dec 2012 11:08:33 +0000 (11:08 +0000)]
MapVector: Add lookup().

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170527 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoChange TargetLowering::isCondCodeLegal to take an MVT, instead of EVT.
Patrik Hagglund [Wed, 19 Dec 2012 10:19:55 +0000 (10:19 +0000)]
Change TargetLowering::isCondCodeLegal to take an MVT, instead of EVT.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170524 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoX86ISelLowering.cpp: Fix warnings. [-Wlogical-op-parentheses]
NAKAMURA Takumi [Wed, 19 Dec 2012 10:12:48 +0000 (10:12 +0000)]
X86ISelLowering.cpp: Fix warnings. [-Wlogical-op-parentheses]

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170523 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoChange TargetLowering::getCondCodeAction to take an MVT, instead of
Patrik Hagglund [Wed, 19 Dec 2012 10:09:26 +0000 (10:09 +0000)]
Change TargetLowering::getCondCodeAction to take an MVT, instead of
EVT.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170522 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoInline hasFunctionOnlyAttrs into its only use.
Bill Wendling [Wed, 19 Dec 2012 09:15:11 +0000 (09:15 +0000)]
Inline hasFunctionOnlyAttrs into its only use.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170518 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoInline the only use of the hasParameterOnlyAttrs method.
Bill Wendling [Wed, 19 Dec 2012 09:04:58 +0000 (09:04 +0000)]
Inline the only use of the hasParameterOnlyAttrs method.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170517 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoInline the 'hasIncompatibleWithVarArgsAttrs' method into its only uses. And some...
Bill Wendling [Wed, 19 Dec 2012 08:57:40 +0000 (08:57 +0000)]
Inline the 'hasIncompatibleWithVarArgsAttrs' method into its only uses. And some minor comment reformatting.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170516 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoDOC: fix the url format.
Nadav Rotem [Wed, 19 Dec 2012 08:43:05 +0000 (08:43 +0000)]
DOC: fix the url format.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170513 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoChange TargetLowering::getTruncStoreAction to take MVTs, instead of EVTs.
Patrik Hagglund [Wed, 19 Dec 2012 08:28:51 +0000 (08:28 +0000)]
Change TargetLowering::getTruncStoreAction to take MVTs, instead of EVTs.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170510 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoDOC: add a benchmarks that compares us to gcc and icc.
Nadav Rotem [Wed, 19 Dec 2012 08:28:24 +0000 (08:28 +0000)]
DOC: add a benchmarks that compares us to gcc and icc.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170509 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoOptimized load + SIGN_EXTEND patterns in the X86 backend.
Elena Demikhovsky [Wed, 19 Dec 2012 07:50:20 +0000 (07:50 +0000)]
Optimized load + SIGN_EXTEND patterns in the X86 backend.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170506 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoAfter reducing the size of an operation in the DAG we zero-extend the reduced
Nadav Rotem [Wed, 19 Dec 2012 07:39:08 +0000 (07:39 +0000)]
After reducing the size of an operation in the DAG we zero-extend the reduced
bitwidth op back to the original size. If we reduce ANDs then this can cause
an endless loop. This patch changes the ZEXT to ANY_EXTEND if the demanded bits
are equal or smaller than the size of the reduced operation.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170505 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agodocs: fix typos.
Nadav Rotem [Wed, 19 Dec 2012 07:36:35 +0000 (07:36 +0000)]
docs: fix typos.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170504 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoDOC: Add a webpage that describes the loop and bb vectorizers.
Nadav Rotem [Wed, 19 Dec 2012 07:22:24 +0000 (07:22 +0000)]
DOC: Add a webpage that describes the loop and bb vectorizers.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170503 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoRename the 'Attributes' class to 'Attribute'. It's going to represent a single attrib...
Bill Wendling [Wed, 19 Dec 2012 07:18:57 +0000 (07:18 +0000)]
Rename the 'Attributes' class to 'Attribute'. It's going to represent a single attribute in the future.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170502 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoRemove more of 'else's after 'returns'. No functional change.
Craig Topper [Wed, 19 Dec 2012 06:43:58 +0000 (06:43 +0000)]
Remove more  of 'else's after 'returns'. No functional change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170497 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoRemove a bunch of 'else's after 'returns'
Craig Topper [Wed, 19 Dec 2012 06:39:17 +0000 (06:39 +0000)]
Remove a bunch of 'else's after 'returns'

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170496 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoTeach SimplifySetCC that comparing AssertZext i1 against a constant 1 can be rewritte...
Craig Topper [Wed, 19 Dec 2012 06:12:28 +0000 (06:12 +0000)]
Teach SimplifySetCC that comparing AssertZext i1 against a constant 1 can be rewritten as a compare against a constant 0 with the opposite condition.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170495 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoAdd some missing Defs and Uses.
Reed Kotler [Wed, 19 Dec 2012 04:06:15 +0000 (04:06 +0000)]
Add some missing Defs and Uses.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170493 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoMake sure the buffer, which containas an instance of APFloat, has proper alignment.
Shuxin Yang [Wed, 19 Dec 2012 01:10:17 +0000 (01:10 +0000)]
Make sure the buffer, which containas an instance of APFloat, has proper alignment.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170486 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoAdd to the disassembler C API an option to print the disassembled
Kevin Enderby [Tue, 18 Dec 2012 23:47:28 +0000 (23:47 +0000)]
Add to the disassembler C API an option to print the disassembled
instructions in the assembly code variant if one exists.

The intended use for this is so tools like lldb and darwin's otool(1)
can be switched to print Intel-flavored disassembly.

I discussed extensively this API with Jim Grosbach and we feel
while it may not be fully general, in reality there is only one syntax
for each assembly with the exception of X86 which has exactly
two for historical reasons.

rdar://10989182

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170477 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoRemove MachineInstr::setIsInsideBundle().
Jakob Stoklund Olesen [Tue, 18 Dec 2012 23:40:14 +0000 (23:40 +0000)]
Remove MachineInstr::setIsInsideBundle().

The bundle flags are now maintained by the slightly higher-level
functions bundleWithPred() / bundleWithSucc() which enforce consistent
bundle flags between neighboring instructions.

See also MIBundleBuilder for an even higher-level approach to building
bundles.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170475 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoUse bidirectional bundle flags to simplify important functions.
Jakob Stoklund Olesen [Tue, 18 Dec 2012 23:21:49 +0000 (23:21 +0000)]
Use bidirectional bundle flags to simplify important functions.

The bundle_iterator::operator++ function now doesn't need to dig out the
basic block and check against end(). It can use the isBundledWithSucc()
flag to find the last bundled instruction safely.

Similarly, MachineInstr::isBundled() no longer needs to look at
iterators etc. It only has to look at flags.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170473 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agordar://12801297
Shuxin Yang [Tue, 18 Dec 2012 23:10:12 +0000 (23:10 +0000)]
rdar://12801297

 InstCombine for unsafe floating-point add/sub.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170471 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoEnable the loop vectorizer in clang and not in the pass manager, so that we can disab...
Nadav Rotem [Tue, 18 Dec 2012 23:09:44 +0000 (23:09 +0000)]
Enable the loop vectorizer in clang and not in the pass manager, so that we can disable it in clang.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170470 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoVerify bundle flag consistency when setting them.
Jakob Stoklund Olesen [Tue, 18 Dec 2012 23:00:28 +0000 (23:00 +0000)]
Verify bundle flag consistency when setting them.

Now that the bundle flag aware APIs are all in place, it is possible to
continuously verify the flag consistency.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170465 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoReverse order of checking SSE level when calculating compare cost, so we check
Jakub Staszak [Tue, 18 Dec 2012 22:57:56 +0000 (22:57 +0000)]
Reverse order of checking SSE level when calculating compare cost, so we check
AVX2 before AVX.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170464 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoVerify bundle flags for consistency in MachineVerifier.
Jakob Stoklund Olesen [Tue, 18 Dec 2012 22:55:07 +0000 (22:55 +0000)]
Verify bundle flags for consistency in MachineVerifier.

The new bidirectional bundle flags are redundant, so inadvertent bundle
tearing can be detected in the machine code verifier.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170463 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoDisable ARM partial flag dependency optimization at -Oz
Quentin Colombet [Tue, 18 Dec 2012 22:47:16 +0000 (22:47 +0000)]
Disable ARM partial flag dependency optimization at -Oz

To not over constrain the scheduler for ARM in thumb mode, some optimizations  for code size reduction, specific to ARM thumb, are blocked when they add a dependency (like write after read dependency).

Disables this check when code size is the priority, i.e., code is compiled with -Oz.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170462 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoDon't allow the automatically updated MI flags to be set directly.
Jakob Stoklund Olesen [Tue, 18 Dec 2012 21:36:05 +0000 (21:36 +0000)]
Don't allow the automatically updated MI flags to be set directly.

The bundle-related MI flags need to be kept in sync with the neighboring
instructions. Don't allow the bulk flag-setting setFlags() function to
change them.

Also don't copy MI flags when cloning an instruction. The clone's bundle
flags will be set when it is explicitly inserted into a bundle.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170459 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoTighten up the splice() API for bundled instructions.
Jakob Stoklund Olesen [Tue, 18 Dec 2012 20:59:41 +0000 (20:59 +0000)]
Tighten up the splice() API for bundled instructions.

Remove the instr_iterator versions of the splice() functions. It doesn't
seem useful to be able to splice sequences of instructions that don't
consist of full bundles.

The normal splice functions that take MBB::iterator arguments are not
changed, and they can move whole bundles around without any problems.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170456 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoMISched: add dependence to ExitSU to model live-out latency.
Andrew Trick [Tue, 18 Dec 2012 20:53:01 +0000 (20:53 +0000)]
MISched: add dependence to ExitSU to model live-out latency.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170454 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoMISched: Cleanup, redundant statement.
Andrew Trick [Tue, 18 Dec 2012 20:52:58 +0000 (20:52 +0000)]
MISched: Cleanup, redundant statement.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170453 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoMISched: Heuristics, compare latency more precisely. It matters more for some targets.
Andrew Trick [Tue, 18 Dec 2012 20:52:56 +0000 (20:52 +0000)]
MISched: Heuristics, compare latency more precisely. It matters more for some targets.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170452 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoMISched: Remove SchedRemainder::IsResourceLimited. I don't know how to compute it.
Andrew Trick [Tue, 18 Dec 2012 20:52:54 +0000 (20:52 +0000)]
MISched: Remove SchedRemainder::IsResourceLimited. I don't know how to compute it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170451 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoMISched: cleanup, use the proper iterator type.
Andrew Trick [Tue, 18 Dec 2012 20:52:52 +0000 (20:52 +0000)]
MISched: cleanup, use the proper iterator type.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170450 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoMISched: minor improvement, initialize remaining resources before the first schedulin...
Andrew Trick [Tue, 18 Dec 2012 20:52:49 +0000 (20:52 +0000)]
MISched: minor improvement, initialize remaining resources before the first scheduling decision.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170449 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoAdd an assertion for a likely ilist::splice() contract violation.
Jakob Stoklund Olesen [Tue, 18 Dec 2012 19:28:37 +0000 (19:28 +0000)]
Add an assertion for a likely ilist::splice() contract violation.

The single-element ilist::splice() function supports a noop move:

  List.splice(I, List, I);

The corresponding std::list function doesn't allow that, so add a unit
test to document that behavior.

This also means that

  List.splice(I, List, F);

is somewhat surprisingly not equivalent to

  List.splice(I, List, F, next(F));

This patch adds an assertion to catch the illegal case I == F above.
Alternatively, we could make I == F a legal noop, but that would make
ilist differ even more from std::list.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170443 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoLoopVectorize: Emit reductions as log2(vectorsize) shuffles + vector ops instead...
Benjamin Kramer [Tue, 18 Dec 2012 18:40:20 +0000 (18:40 +0000)]
LoopVectorize: Emit reductions as log2(vectorsize) shuffles + vector ops instead of scalar operations.

For example on x86 with SSE4.2 a <8 x i8> add reduction becomes
movdqa %xmm0, %xmm1
movhlps %xmm1, %xmm1            ## xmm1 = xmm1[1,1]
paddw %xmm0, %xmm1
pshufd $1, %xmm1, %xmm0        ## xmm0 = xmm1[1,0,0,0]
paddw %xmm1, %xmm0
phaddw %xmm0, %xmm0
pextrb $0, %xmm0, %edx

instead of
pextrb $2, %xmm0, %esi
pextrb $0, %xmm0, %edx
addb %sil, %dl
pextrb $4, %xmm0, %esi
addb %dl, %sil
pextrb $6, %xmm0, %edx
addb %sil, %dl
pextrb $8, %xmm0, %esi
addb %dl, %sil
pextrb $10, %xmm0, %edi
pextrb $14, %xmm0, %edx
addb %sil, %dil
pextrb $12, %xmm0, %esi
addb %dil, %sil
addb %sil, %dl

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170439 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoGet rid of the pesky -Woverloaded-virtual warning. No change in functionality.
Eli Bendersky [Tue, 18 Dec 2012 18:21:29 +0000 (18:21 +0000)]
Get rid of the pesky -Woverloaded-virtual warning. No change in functionality.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170438 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoTighten the insert() API for bundled instructions.
Jakob Stoklund Olesen [Tue, 18 Dec 2012 17:54:53 +0000 (17:54 +0000)]
Tighten the insert() API for bundled instructions.

The normal insert() function takes an MBB::iterator position, and
inserts a stand-alone MachineInstr as before.

The insert() function that takes an MBB::instr_iterator position can
insert instructions inside a bundle, and will now update the bundle
flags correctly when that happens.

When the insert position is between two bundles, it is unclear whether
the instruction should be appended to the previous bundle, prepended to
the next bundle, or stand on its own. The MBB::insert() function doesn't
bundle the instruction in that case, use the MIBundleBuilder class for
that.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170437 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoCheck multiple register classes for inline asm tied registers
Hal Finkel [Tue, 18 Dec 2012 17:50:58 +0000 (17:50 +0000)]
Check multiple register classes for inline asm tied registers

A register can be associated with several distinct register classes.
For example, on PPC, the floating point registers are each associated with
both F4RC (which holds f32) and F8RC (which holds f64). As a result, this code
would fail when provided with a floating point register and an f64 operand
because it would happen to find the register in the F4RC class first and
return that. From the F4RC class, SDAG would extract f32 as the register
type and then assert because of the invalid implied conversion between
the f64 value and the f32 register.

Instead, search all register classes. If a register class containing the
the requested register has the requested type, then return that register
class. Otherwise, as before, return the first register class found that
contains the requested register.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170436 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoEnable the loop vectorizer.
Nadav Rotem [Tue, 18 Dec 2012 06:37:12 +0000 (06:37 +0000)]
Enable the loop vectorizer.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170416 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoRename the test so that we can add additional vectors-of-pointers tests
Nadav Rotem [Tue, 18 Dec 2012 05:50:54 +0000 (05:50 +0000)]
Rename the test so that we can add additional vectors-of-pointers tests
into the same file in the future.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170414 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoSROA: Replace calls to getScalarSizeInBits to DataLayout's API because
Nadav Rotem [Tue, 18 Dec 2012 05:23:31 +0000 (05:23 +0000)]
SROA: Replace calls to getScalarSizeInBits to DataLayout's API because
getScalarSizeInBits could not handle vectors of pointers.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170412 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agollvm/test/MC/ELF/comp-dir.s: Appease MSYS Bash.
NAKAMURA Takumi [Tue, 18 Dec 2012 05:08:12 +0000 (05:08 +0000)]
llvm/test/MC/ELF/comp-dir.s: Appease MSYS Bash.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170410 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoInitialize NoRedZone and remove unused default values.
Rafael Espindola [Tue, 18 Dec 2012 03:35:05 +0000 (03:35 +0000)]
Initialize NoRedZone and remove unused default values.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170404 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoCleanup comment and formatting
Eli Bendersky [Tue, 18 Dec 2012 00:53:36 +0000 (00:53 +0000)]
Cleanup comment and formatting

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170398 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoRepair bundles that were broken by removing and reinserting the first
Jakob Stoklund Olesen [Tue, 18 Dec 2012 00:46:39 +0000 (00:46 +0000)]
Repair bundles that were broken by removing and reinserting the first
instruction.

This isn't strictly necessary at the moment because Thumb2SizeReduction
also copies all MI flags from the old instruction to the new. However, a
future patch will make that kind of direct flag tampering illegal.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170395 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoFormatting.
Eric Christopher [Tue, 18 Dec 2012 00:42:26 +0000 (00:42 +0000)]
Formatting.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170394 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoAdd support for passing -main-file-name all the way through to
Eric Christopher [Tue, 18 Dec 2012 00:31:01 +0000 (00:31 +0000)]
Add support for passing -main-file-name all the way through to
the assembler.

Part of PR14624

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170390 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoCleanup formatting and whitespace.
Eric Christopher [Tue, 18 Dec 2012 00:30:54 +0000 (00:30 +0000)]
Cleanup formatting and whitespace.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170389 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoExtract a method, no functional change intended.
Jakob Stoklund Olesen [Tue, 18 Dec 2012 00:13:11 +0000 (00:13 +0000)]
Extract a method, no functional change intended.

Sadly, this costs us a perfectly good opportunity to use 'goto'.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170385 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoTighten up the erase/remove API for bundled instructions.
Jakob Stoklund Olesen [Mon, 17 Dec 2012 23:55:38 +0000 (23:55 +0000)]
Tighten up the erase/remove API for bundled instructions.

Most code is oblivious to bundles and uses the MBB::iterator which only
visits whole bundles. MBB::erase() operates on whole bundles at a time
as before.

MBB::remove() now refuses to remove bundled instructions. It is not safe
to remove all instructions in a bundle without deleting them since there
is no way of returning pointers to all the removed instructions.

MBB::remove_instr() and MBB::erase_instr() will now update bundle flags
correctly, lifting individual instructions out of bundles while leaving
the remaining bundle intact.

The MachineInstr convenience functions are updated so

  eraseFromParent() erases a whole bundle as before
  eraseFromBundle() erases a single instruction, leaving the rest of its bundle.
  removeFromParent() refuses to operate on bundled instructions, and
  removeFromBundle() lifts a single instruction out of its bundle.

These functions will no longer accidentally split or coalesce bundles -
bundle flags are updated to preserve the existing bundling, and explicit
bundleWith* / unbundleFrom* functions should be used to change the
instruction bundling.

This API update is still a work in progress. I am going to update APIs
first so they maintain bundle flags automatically when possible. Then
I'll add stricter verification of the bundle flags.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170384 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoEmitDebugLabel should by default be the same as EmitLabel everywhere.
Reed Kotler [Mon, 17 Dec 2012 23:41:45 +0000 (23:41 +0000)]
EmitDebugLabel should by default be the same as EmitLabel everywhere.
It must be explicity set in MCPureStreamer because otherwise it will
inherit incorrectly from the parent.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170383 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agofix indentation
Eli Bendersky [Mon, 17 Dec 2012 22:50:56 +0000 (22:50 +0000)]
fix indentation

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170381 91177308-0d34-0410-b5e6-96231b3b80d8

11 years ago[arm fast-isel] Minor cleanup. No functional change intended.
Chad Rosier [Mon, 17 Dec 2012 22:35:29 +0000 (22:35 +0000)]
[arm fast-isel] Minor cleanup. No functional change intended.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170379 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoFix some integer constant warnings by using a suffix
Nick Kledzik [Mon, 17 Dec 2012 22:11:17 +0000 (22:11 +0000)]
Fix some integer constant warnings by using a suffix

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170376 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoAdd a triple to this test -- it has to be an ELF platform...
Chandler Carruth [Mon, 17 Dec 2012 21:44:50 +0000 (21:44 +0000)]
Add a triple to this test -- it has to be an ELF platform...

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170374 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoPrepare LLVM to fix PR14625, exposing a hook in MCContext to manage the
Chandler Carruth [Mon, 17 Dec 2012 21:32:42 +0000 (21:32 +0000)]
Prepare LLVM to fix PR14625, exposing a hook in MCContext to manage the
compilation directory.

This defaults to the current working directory, just as it always has,
but now an assembler can choose to override it with a custom directory.
I've taught llvm-mc about this option and added a test case.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170371 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agore-enable test cases now that traits work with g++. Fix some g++ warnings
Nick Kledzik [Mon, 17 Dec 2012 20:43:53 +0000 (20:43 +0000)]
re-enable test cases now that traits work with g++.  Fix some g++ warnings

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170369 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoRemove trailing whitespace
Michael Ilseman [Mon, 17 Dec 2012 20:40:14 +0000 (20:40 +0000)]
Remove trailing whitespace

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170368 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoRemoved trailing whitespace
Michael Ilseman [Mon, 17 Dec 2012 20:37:55 +0000 (20:37 +0000)]
Removed trailing whitespace

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170367 91177308-0d34-0410-b5e6-96231b3b80d8

11 years ago[arm fast-isel] Fast-isel only handles simple VTs, so make sure the necessary
Chad Rosier [Mon, 17 Dec 2012 19:59:43 +0000 (19:59 +0000)]
[arm fast-isel] Fast-isel only handles simple VTs, so make sure the necessary
checks are in place.  Some minor cleanup as well.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170360 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoUse different trait techniques to be compatible with g++
Nick Kledzik [Mon, 17 Dec 2012 19:02:05 +0000 (19:02 +0000)]
Use different trait techniques to be compatible with g++

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170355 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoFix another SROA crasher, PR14601.
Chandler Carruth [Mon, 17 Dec 2012 18:48:07 +0000 (18:48 +0000)]
Fix another SROA crasher, PR14601.

This was a silly oversight, we weren't pruning allocas which were used
by variable-length memory intrinsics from the set that could be widened
and promoted as integers. Fix that.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170353 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoQuery section for whether it should be executable.
Tim Northover [Mon, 17 Dec 2012 17:59:35 +0000 (17:59 +0000)]
Query section for whether it should be executable.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170350 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoTeach MachO which sections contain code
Tim Northover [Mon, 17 Dec 2012 17:59:32 +0000 (17:59 +0000)]
Teach MachO which sections contain code

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170349 91177308-0d34-0410-b5e6-96231b3b80d8

11 years ago[msan] Fix lint warning.
Evgeniy Stepanov [Mon, 17 Dec 2012 16:30:05 +0000 (16:30 +0000)]
[msan] Fix lint warning.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170347 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoAdd instruction encodings / disassembly support for l2r instructions.
Richard Osborne [Mon, 17 Dec 2012 16:28:02 +0000 (16:28 +0000)]
Add instruction encodings / disassembly support for l2r instructions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170345 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoR600: enable S_*N2_* instructions
Tom Stellard [Mon, 17 Dec 2012 15:14:56 +0000 (15:14 +0000)]
R600: enable S_*N2_* instructions

They seem to work fine.

Patch by: Christian König

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
Tested-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Christian König <deathsimple@vodafone.de>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170343 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoR600: BB operand support for SI
Tom Stellard [Mon, 17 Dec 2012 15:14:54 +0000 (15:14 +0000)]
R600: BB operand support for SI

Patch by: Christian König

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
Tested-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Christian König <deathsimple@vodafone.de>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170342 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoR600: remove nonsense setPrefLoopAlignment
Tom Stellard [Mon, 17 Dec 2012 15:14:53 +0000 (15:14 +0000)]
R600: remove nonsense setPrefLoopAlignment

The Align parameter is a power of two, so 16 results in 64K
alignment. Additional to that even 16 byte alignment doesn't
make any sense, so just remove it.

Patch by: Christian König

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
Tested-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Christian König <deathsimple@vodafone.de>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170341 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoTeach the rewriting of memcpy calls to support subvector copies.
Chandler Carruth [Mon, 17 Dec 2012 14:51:24 +0000 (14:51 +0000)]
Teach the rewriting of memcpy calls to support subvector copies.

This also cleans up a bit of the memcpy call rewriting by sinking some
irrelevant code further down and making the call-emitting code a bit
more concrete.

Previously, memcpy of a subvector would actually miscompile (!!!) the
copy into a single vector element copy. I have no idea how this ever
worked. =/ This is the memcpy half of PR14478 which we probably weren't
noticing previously because it didn't actually assert.

The rewrite relies on the newly refactored insert- and extractVector
functions to do the heavy lifting, and those are the same as used for
loads and stores which makes the test coverage a bit more meaningful
here.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170338 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoRevert/correct some FastISel changes in r170104 (EVT->MVT for
Patrik Hagglund [Mon, 17 Dec 2012 14:30:06 +0000 (14:30 +0000)]
Revert/correct some FastISel changes in r170104 (EVT->MVT for
TargetLowering::getRegClassFor).

Some isSimple() guards were missing, or getSimpleVT() were hoisted too
far, resulting in asserts on valid LLVM assembly input.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170336 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoOptimize tree walking in markAliveBlocks.
Evgeniy Stepanov [Mon, 17 Dec 2012 14:28:00 +0000 (14:28 +0000)]
Optimize tree walking in markAliveBlocks.

Check whether a BB is known as reachable before adding it to the worklist.
This way BB's with multiple predecessors are added to the list no more than
once.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170335 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoAdd instruction encodings for PEEK and ENDIN.
Richard Osborne [Mon, 17 Dec 2012 14:23:54 +0000 (14:23 +0000)]
Add instruction encodings for PEEK and ENDIN.

Previously these were marked with the wrong format.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170334 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoFix a secondary bug I introduced while fixing the first part of PR14478.
Chandler Carruth [Mon, 17 Dec 2012 14:03:01 +0000 (14:03 +0000)]
Fix a secondary bug I introduced while fixing the first part of PR14478.

The first half of fixing this bug was actually in r170328, but was
entirely coincidental. It did however get me to realize the nature of
the bug, and adapt the test case to test more interesting behavior. In
turn, that uncovered the rest of the bug which I've fixed here.

This should fix two new asserts that showed up in the vectorize nightly
tester.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170333 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoFix parameter name in prototypes in XCoreDisassembler.
Richard Osborne [Mon, 17 Dec 2012 13:55:49 +0000 (13:55 +0000)]
Fix parameter name in prototypes in XCoreDisassembler.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170332 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoHoist a convertValue call to the two paths where it is needed.
Chandler Carruth [Mon, 17 Dec 2012 13:51:03 +0000 (13:51 +0000)]
Hoist a convertValue call to the two paths where it is needed.

I noticed this while looking at r170328. We only ever do a vector
rewrite when the alloca *is* the vector type, so it's good to not paper
over bugs here by doing a convertValue that isn't needed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170331 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoAdd instruction encodings / disassembly support for rus instructions.
Richard Osborne [Mon, 17 Dec 2012 13:50:04 +0000 (13:50 +0000)]
Add instruction encodings / disassembly support for rus instructions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170330 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoHoist the insertVector helper to be a static helper.
Chandler Carruth [Mon, 17 Dec 2012 13:41:21 +0000 (13:41 +0000)]
Hoist the insertVector helper to be a static helper.

This will allow its use inside of memcpy rewriting as well. This routine
is more complex than extractVector, and some of its uses are not 100%
where I want them to be so there is still some work to do here.

While this can technically change the output in some cases, it shouldn't
be a change that matters -- IE, it can leave some dead code lying around
that prior versions did not, etc.

Yet another step in the refactorings leading up to the solution to the
last component of PR14478.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170328 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoAdd instruction encodings for ZEXT and SEXT.
Richard Osborne [Mon, 17 Dec 2012 13:20:37 +0000 (13:20 +0000)]
Add instruction encodings for ZEXT and SEXT.

Previously these were marked with the wrong format.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170327 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoLift the extractVector helper all the way out to a static helper function.
Chandler Carruth [Mon, 17 Dec 2012 13:07:30 +0000 (13:07 +0000)]
Lift the extractVector helper all the way out to a static helper function.

The method helpers all implicitly act upon the alloca, and what we
really want is a fully generic helper. Doing memcpy rewrites is more
special than all other rewrites because we are at times rewriting
instructions which touch pointers *other* than the alloca. As
a consequence all of the helpers needed by memcpy rewriting of
sub-vector copies will need to be generalized fully.

Note that all of these helpers ({insert,extract}{Integer,Vector}) are
woefully uncommented. I'm going to go back through and document them
once I get the factoring correct.

No functionality changed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170325 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoFactor the vector load rewriting into a more generic form.
Chandler Carruth [Mon, 17 Dec 2012 12:50:21 +0000 (12:50 +0000)]
Factor the vector load rewriting into a more generic form.

This makes it suitable for use in rewriting memcpy in the presence of
subvector memcpy intrinsics.

No functionality changed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170324 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoAdd instruction encodings / disassembly support for 2r instructions.
Richard Osborne [Mon, 17 Dec 2012 12:29:31 +0000 (12:29 +0000)]
Add instruction encodings / disassembly support for 2r instructions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170323 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoAdd instruction encodings / disassembly support for 0r instructions.
Richard Osborne [Mon, 17 Dec 2012 12:26:29 +0000 (12:26 +0000)]
Add instruction encodings / disassembly support for 0r instructions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170322 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoSimplify assertion in XCoreInstPrinter.
Richard Osborne [Mon, 17 Dec 2012 12:13:46 +0000 (12:13 +0000)]
Simplify assertion in XCoreInstPrinter.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170321 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoUpdate comments to match recommended doxygen style.
Richard Osborne [Mon, 17 Dec 2012 12:13:41 +0000 (12:13 +0000)]
Update comments to match recommended doxygen style.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170320 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoRemove unnecessary include.
Richard Osborne [Mon, 17 Dec 2012 12:13:32 +0000 (12:13 +0000)]
Remove unnecessary include.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170319 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoFix typo that results in new landing pads not getting a name, fixing PR14617.
Duncan Sands [Mon, 17 Dec 2012 12:02:36 +0000 (12:02 +0000)]
Fix typo that results in new landing pads not getting a name, fixing PR14617.
Patch by Chris Toshok.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170318 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoFix comment typo.
Duncan Sands [Mon, 17 Dec 2012 11:43:15 +0000 (11:43 +0000)]
Fix comment typo.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170317 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoRemove EFLAGS from the BLSI/BLSMSK/BLSR patterns. The nodes created by DAG combine...
Craig Topper [Mon, 17 Dec 2012 06:13:48 +0000 (06:13 +0000)]
Remove EFLAGS from the BLSI/BLSMSK/BLSR patterns. The nodes created by DAG combine don't contain an EFLAGS def.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170308 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoSimplify BMI ANDN matching to use patterns instead of a DAG combine. Also add ANDN...
Craig Topper [Mon, 17 Dec 2012 05:12:30 +0000 (05:12 +0000)]
Simplify BMI ANDN matching to use patterns instead of a DAG combine. Also add ANDN to isDefConvertible.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170305 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoAdd rest of BMI/BMI2 instructions to the folding tables as well as popcnt and lzcnt.
Craig Topper [Mon, 17 Dec 2012 05:02:29 +0000 (05:02 +0000)]
Add rest of BMI/BMI2 instructions to the folding tables as well as popcnt and lzcnt.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170304 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoRemove store forms of DEC/INC from isDefConvertible. Since they are stores they don...
Craig Topper [Mon, 17 Dec 2012 04:55:07 +0000 (04:55 +0000)]
Remove store forms of DEC/INC from isDefConvertible. Since they are stores they don't have a register def.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170303 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoFix the first part of PR14478: memset now works.
Chandler Carruth [Mon, 17 Dec 2012 04:07:37 +0000 (04:07 +0000)]
Fix the first part of PR14478: memset now works.

PR14478 highlights a serious problem in SROA that simply wasn't being
exercised due to a lack of vector input code mixed with C-library
function calls. Part of SROA was written carefully to handle subvector
accesses via memset and memcpy, but the rewriter never grew support for
this. Fixing it required refactoring the subvector access code in other
parts of SROA so it could be shared, and then fixing the splat formation
logic and using subvector insertion (this patch).

The PR isn't quite fixed yet, as memcpy is still broken in the same way.
I'm starting on that series of patches now.

Hopefully this will be enough to bring the bullet benchmark back to life
with the bb-vectorizer enabled, but that may require fixing memcpy as
well.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170301 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoExtract the logic for inserting a subvector into a vector alloca.
Chandler Carruth [Mon, 17 Dec 2012 04:07:35 +0000 (04:07 +0000)]
Extract the logic for inserting a subvector into a vector alloca.

No functionality changed. Another step of refactoring toward solving
PR14487.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170300 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoLift the integer splat computation into a helper function.
Chandler Carruth [Mon, 17 Dec 2012 04:07:30 +0000 (04:07 +0000)]
Lift the integer splat computation into a helper function.

No functionality changed. Refactoring leading up to the fix for PR14478
which requires some significant changes to the memset and memcpy
rewriting.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170299 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoAdd debug prints for when optimizeLoadInstr folds a load.
Craig Topper [Mon, 17 Dec 2012 03:56:00 +0000 (03:56 +0000)]
Add debug prints for when optimizeLoadInstr folds a load.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170298 91177308-0d34-0410-b5e6-96231b3b80d8