Commit Graph

59707 Commits

Author SHA1 Message Date
Christian Konig 72d5d5c754 R600/SI: cleanup SIInstrInfo.td and SIInstrFormat.td
Those two files got mixed up.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
llvm-svn: 175746
2013-02-21 15:16:44 +00:00
Tom Stellard 0d171c8877 R600: Fix for Unigine when MachineSched is enabled
Fixes for-loop.cl piglit test

Patch By: Vincent Lejeune

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>

NOTE: This is a candidate for the Mesa stable branch.
llvm-svn: 175742
2013-02-21 15:06:59 +00:00
Bill Schmidt 49498dac9d Code review cleanup for r175697
llvm-svn: 175739
2013-02-21 14:35:42 +00:00
Michel Danzer 7f02a8c7a7 R600/SI: Make sure M0 is loaded for V_INTERP_MOV_F32
NOTE: This is a candidate for the Mesa stable branch.

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
llvm-svn: 175733
2013-02-21 08:57:10 +00:00
Cameron Zwarich 3ab4c4ba30 Don't rely on the isDead() MachineOperand flag when updating LiveIntervals.
llvm-svn: 175732
2013-02-21 08:51:58 +00:00
Cameron Zwarich d113292bce Use getInterval() instead of getOrCreateInterval().
llvm-svn: 175731
2013-02-21 08:51:55 +00:00
Cameron Zwarich 9e722aed4a Make another kill check LiveIntervals-aware.
This brings the number of remaining failures in 'make check' without
LiveVariables down to 39, with 1 unexpectedly passing test.

llvm-svn: 175727
2013-02-21 07:02:30 +00:00
Cameron Zwarich c896478f0d Split part of isKilled() into a separate function for use elsewhere.
llvm-svn: 175726
2013-02-21 07:02:28 +00:00
Cameron Zwarich 94b204be54 Update isKilledAt in TwoAddressInstructionPass.cpp to use LiveIntervals when
available.

With this commit there are no longer any assertion or verifier failures when
running 'make check' without LiveVariables. There are still 56 failing tests
with codegen differences and 1 unexpectedly passing test.

llvm-svn: 175719
2013-02-21 04:33:02 +00:00
Reed Kotler 97ba5f2772 Expand the sel pseudo/macro. This generates basic blocks where previously
there were inline br .+4 instructions. Soon everything can enjoy the
full instruction scheduling experience.

llvm-svn: 175718
2013-02-21 04:22:38 +00:00
Jack Carter dc46338e2d Mips specific standalone assembler addressing mode %hi and %lo.
The constructs %hi() and %lo() represent the high and low 16 
bits of the address. 
Because the 16 bit offset field of an LW instruction is 
interpreted as signed, if bit 15 of the low part is 1 then the 
low part will act as a negative and 1 needs to be added to the 
high part.

Contributer: Vladimir Medic
llvm-svn: 175707
2013-02-21 02:09:31 +00:00
Bill Schmidt f5b474c6c6 PPCDAGToDAGISel::PostprocessISelDAG()
This patch implements the PPCDAGToDAGISel::PostprocessISelDAG virtual
method to perform post-selection peephole optimizations on the DAG
representation.

One optimization is implemented here:  folds to clean up complex
addressing expressions for thread-local storage and medium code
model.  It will also be useful for large code model sequences when
those are added later.  I originally thought about doing this on the
MI representation prior to register assignment, but it's difficult to
do effective global dead code elimination at that point.  DCE is
trivial on the DAG representation.

A typical example of a candidate code sequence in assembly:

   addis 3, 2, globalvar@toc@ha
   addi  3, 3, globalvar@toc@l
   lwz   5, 0(3)

When the final instruction is a load or store with an immediate offset
of zero, the offset from the add-immediate can replace the zero,
provided the relocation information is carried along:

   addis 3, 2, globalvar@toc@ha
   lwz   5, globalvar@toc@l(3)

Since the addi can in general have multiple uses, we need to only
delete the instruction when the last use is removed.

llvm-svn: 175697
2013-02-21 00:38:25 +00:00
David Blaikie ef04593de1 Provide a "None" value for convenience when using Optional<T>()
This implementation of NoneType/None does have some holes but I haven't
found one that doesn't - open to improvement.

llvm-svn: 175696
2013-02-21 00:27:28 +00:00
Bill Schmidt 3822ef2c0c Relocation enablement for PPC DAG postprocessing pass
llvm-svn: 175693
2013-02-21 00:05:29 +00:00
Chad Rosier c0955a57df Formatting.
llvm-svn: 175692
2013-02-20 23:57:30 +00:00
Jakob Stoklund Olesen 1744fd8018 Don't allocate memory in LiveInterval::join().
Rewrite value numbers directly in the 'Other' LiveInterval which is
moribund anyway. This avoids allocating the OtherAssignments vector.

llvm-svn: 175690
2013-02-20 23:51:10 +00:00
Lang Hames 24e3759230 Kill of TransferDeadFlag - Dead copies and subreg-to-reg instructions should
just be turned into kills on the spot.

llvm-svn: 175688
2013-02-20 23:36:57 +00:00
Pedro Artigas 0c09481d6b as the allocator is reset zero out the number of bytes allocated, this was just
missed before but probably what was intended.

llvm-svn: 175687
2013-02-20 23:30:56 +00:00
Jack Carter 1ac5322e61 ELF symbol table field st_other support,
excluding visibility bits.

Mips specific standalone assembler directive "set at".

This directive changes the general purpose register
that the assembler will use when given the symbolic
register name $at.

This does not include negative testing. That will come
in a future patch.

A side affect of this patch recognizes the different 
GPR register names for temporaries between old abi
and new abi so a test case for that is included.

Contributer: Vladimir Medic
llvm-svn: 175686
2013-02-20 23:11:17 +00:00
Jakob Stoklund Olesen b389271101 Copy single reaching defs directly into the LiveInterval.
When findReachingDefs() finds that only one value can reach the basic
block, just copy the work list of visited blocks directly into the live
interval.

Sort the block list and use a LiveRangeUpdater to make the bulk add
fast.

When multiple reaching defs are found, transfer the work list to the
updateSSA() work list as before. Also use LiveRangeUpdater in
updateLiveIns() following updateSSA().

This makes live interval analysis more than 3x faster on one huge test
case.

llvm-svn: 175685
2013-02-20 23:08:26 +00:00
Bill Wendling 1c20ff028e Add and remove the attribute from the correct slot.
The slot that we're adding/removing the attribute from may not be the same as
the attribute coming in. Make sure that they match up before we try to
add/remove them.
PR15313

llvm-svn: 175684
2013-02-20 23:04:11 +00:00
Erik Verbruggen ef40cdd95b Fix accidental concatenation for "outputuntil" in the -debug-buffer-size option description.
llvm-svn: 175682
2013-02-20 22:33:46 +00:00
Jim Grosbach d2037eb1ee MCParser: Update method names per coding guidelines.
s/AddDirectiveHandler/addDirectiveHandler/
s/ParseMSInlineAsm/parseMSInlineAsm/
s/ParseIdentifier/parseIdentifier/
s/ParseStringToEndOfStatement/parseStringToEndOfStatement/
s/ParseEscapedString/parseEscapedString/
s/EatToEndOfStatement/eatToEndOfStatement/
s/ParseExpression/parseExpression/
s/ParseParenExpression/parseParenExpression/
s/ParseAbsoluteExpression/parseAbsoluteExpression/
s/CheckForValidSection/checkForValidSection/

http://llvm.org/docs/CodingStandards.html#name-types-functions-variables-and-enumerators-properly

No functional change intended.

llvm-svn: 175675
2013-02-20 22:21:35 +00:00
Cameron Zwarich 2ad3ca37bd Only use LiveIntervals in TwoAddressInstructionPass, not a mix of Liveintervals
and SlotIndexes.

llvm-svn: 175674
2013-02-20 22:10:02 +00:00
Cameron Zwarich caad7e10c1 Find anchoring end points for repairIntervalsInRange and repairIndexesInRange
automatically.

llvm-svn: 175673
2013-02-20 22:10:00 +00:00
Cameron Zwarich 8e7dc068c9 Make repairIntervalsInRange() more robust. There are now no longer any liveness-
related failures when running 'make check' without LiveVariables with the
verifier enabled. Some of the remaining failures elsewhere may still be fallout
from incorrect updating of LiveIntervals or the few missing cases left in the
two-address pass.

llvm-svn: 175672
2013-02-20 22:09:57 +00:00
Arnold Schwaighofer 3f9568e921 DAGCombiner: Fold pointless truncate, bitcast, buildvector series
(2xi32) (truncate ((2xi64) bitcast (buildvector i32 a, i32 x, i32 b, i32 y)))
can be folded into a (2xi32) (buildvector i32 a, i32 b).

Such a DAG would cause uneccessary vdup instructions followed by vmovn
instructions.

We generate this code on ARM NEON for a setcc olt, 2xf64, 2xf64. For example, in
the vectorized version of the code below.

double A[N];
double B[N];

void test_double_compare_to_double() {
  int i;
  for(i=0;i<N;i++)
    A[i] = (double)(A[i] < B[i]);
}

radar://13191881

Fixes bug 15283.

llvm-svn: 175670
2013-02-20 21:33:32 +00:00
Jim Grosbach d15cd2a11c R600: Update for name changes from r175667.
llvm-svn: 175668
2013-02-20 21:31:28 +00:00
Jim Grosbach 341ad3e72a Update TargetLowering ivars for name policy.
http://llvm.org/docs/CodingStandards.html#name-types-functions-variables-and-enumerators-properly

ivars should be camel-case and start with an upper-case letter. A few in
TargetLowering were starting with a lower-case letter.

No functional change intended.

llvm-svn: 175667
2013-02-20 21:13:59 +00:00
Bill Schmidt c6cbecc2c7 Additional fixes for bug 15155.
This handles the cases where the 6-bit splat element is odd, converting
to a three-instruction sequence to add or subtract two splats.  With this
fix, the XFAIL in test/CodeGen/PowerPC/vec_constants.ll is removed.

llvm-svn: 175663
2013-02-20 20:41:42 +00:00
Chad Rosier 4d87d45a05 Update a comment that looks to have been accidentally deleted many moons ago.
llvm-svn: 175658
2013-02-20 20:15:55 +00:00
Dan Gohman f857cd7518 Rewrite comments.
llvm-svn: 175651
2013-02-20 19:28:46 +00:00
Krzysztof Parzyszek 12ba711f35 Add comment in Memory.inc explaining r175646.
llvm-svn: 175650
2013-02-20 19:25:09 +00:00
Dan Gohman 5cdb345883 SIGQUIT is a "kill" signal, rather than an "int" signal, in this context.
llvm-svn: 175648
2013-02-20 19:15:01 +00:00
Andrew Kaylor fca968e13d Formatting, grammar
llvm-svn: 175647
2013-02-20 18:24:34 +00:00
Krzysztof Parzyszek 798679e140 On PowerPC, the cache-flush instructions dcbf and icbi are treated as
loads. On FreeBSD, add PROT_READ page protection flag before flushing
cache.

llvm-svn: 175646
2013-02-20 18:24:30 +00:00
Jakob Stoklund Olesen 623d8329e3 Use LiveRangeUpdater instead of mergeIntervalRanges.
Performance is the same, but LiveRangeUpdater has a more flexible
interface.

llvm-svn: 175645
2013-02-20 18:18:15 +00:00
Jakob Stoklund Olesen 521c708e6e Add a LiveRangeUpdater class.
Adding new segments to large LiveIntervals can be expensive because the
LiveRange objects after the insertion point may need to be moved left or
right. This can cause quadratic behavior when adding a large number of
segments to a live range.

The LiveRangeUpdater class allows the LIveInterval to be in a temporary
invalid state while segments are being added. It maintains an internal
gap in the LiveInterval when it is shrinking, and it has a spill area
for new segments when the LiveInterval is growing.

The behavior is similar to the existing mergeIntervalRanges() function,
except it allocates less memory for the spill area, and the algorithm is
turned inside out so the loop is driven by the clients.

llvm-svn: 175644
2013-02-20 18:18:12 +00:00
Andrew Kaylor 3d5d3101ed Adding support for absolute relocations. This occurs in ELF files when a relocation is given with no name and an undefined section. The relocation is applied with an address of zero.
llvm-svn: 175643
2013-02-20 18:09:21 +00:00
Michael Liao 7fb39669ef Fix PR15267
- When extloading from a vector with non-byte-addressable element, e.g.
  <4 x i1>, the current logic breaks. Extend the current logic to
  fix the case where the element type is not byte-addressable by loading
  all bytes, bit-extracting/packing each element.

llvm-svn: 175642
2013-02-20 18:04:21 +00:00
Chad Rosier a018cfd10c [ms-inline asm] Make the comment a bit more verbose.
llvm-svn: 175641
2013-02-20 18:03:44 +00:00
Bill Schmidt 6631e94838 Fix bug 14779 for passing anonymous aggregates [patch by Kai Nacke].
The PPC backend doesn't handle these correctly.  This patch uses logic
similar to that in the X86 and ARM backends to track these arguments
properly.

llvm-svn: 175635
2013-02-20 17:31:41 +00:00
Jyotsna Verma 7503a62bce Hexagon: Move HexagonMCInst.h to MCTargetDesc/HexagonMCInst.h.
Add HexagonMCInst class which adds various Hexagon VLIW annotations.
In addition, this class also includes some APIs related to the
constant extenders.

llvm-svn: 175634
2013-02-20 16:13:27 +00:00
Bill Schmidt 51e7951e24 Fix PR15155: lost vadd/vsplat optimization.
During lowering of a BUILD_VECTOR, we look for opportunities to use a
vector splat.  When the splatted value fits in 5 signed bits, a single
splat does the job.  When it doesn't fit in 5 bits but does fit in 6,
and is an even value, we can splat on half the value and add the result
to itself.

This last optimization hasn't been working recently because of improved
constant folding.  To circumvent this, create a pseudo VADD_SPLAT that
can be expanded during instruction selection.

llvm-svn: 175632
2013-02-20 15:50:31 +00:00
Benjamin Kramer 5c3e21ba55 Move the SplatByte helper to APInt and generalize it a bit.
llvm-svn: 175621
2013-02-20 13:00:06 +00:00
Elena Demikhovsky 0ccdd1315b I optimized the following patterns:
sext <4 x i1> to <4 x i64>
 sext <4 x i8> to <4 x i64>
 sext <4 x i16> to <4 x i64>
 
I'm running Combine on SIGN_EXTEND_IN_REG and revert SEXT patterns:
 (sext_in_reg (v4i64 anyext (v4i32 x )), ExtraVT) -> (v4i64 sext (v4i32 sext_in_reg (v4i32 x , ExtraVT)))
 
 The sext_in_reg (v4i32 x) may be lowered to shl+sar operations.
 The "sar" does not exist on 64-bit operation, so lowering sext_in_reg (v4i64 x) has no vector solution.

I also added a cost of this operations to the AVX costs table.

llvm-svn: 175619
2013-02-20 12:42:54 +00:00
Kostya Serebryany 699ac28aa5 [asan] instrument invoke insns with noreturn attribute (as well as call insns)
llvm-svn: 175617
2013-02-20 12:35:15 +00:00
Logan Chien 53c18d8ac7 Fix thumbv5e frame lowering assertion failure.
It is possible that frame pointer is not found in the
callee saved info, thus FramePtrSpillFI may be incorrect
if we don't check the result of hasFP(MF).

Besides, if we enable the stack coloring algorithm, there
will be an assertion to ensure the slot is live.  But in
the test case, %var1 is not live in the prologue of the
function, and we will get the assertion failure.

Note: There is similar code in ARMFrameLowering.cpp.
llvm-svn: 175616
2013-02-20 12:21:33 +00:00
David Blaikie 9db062ebdb Fully qualify llvm::next to avoid ambiguity when building as C++11.
llvm-svn: 175608
2013-02-20 07:39:20 +00:00
David Blaikie 725fda1213 Fix the (clang -Werror) build by removing an unused member variable.
llvm-svn: 175607
2013-02-20 07:39:18 +00:00
Bill Wendling 90bc19cd91 Modify the LLVM assembly output so that it uses references to represent function attributes.
This makes the LLVM assembly look better. E.g.:

     define void @foo() #0 { ret void }
     attributes #0 = { nounwind noinline ssp }

llvm-svn: 175605
2013-02-20 07:21:42 +00:00
Cameron Zwarich 8e60d4d240 Add support to the two-address pass for updating LiveIntervals in many of the
common transformations. This includes updating repairIntervalsInRange() to
handle more cases.

llvm-svn: 175604
2013-02-20 06:46:48 +00:00
Cameron Zwarich 2991feb0d3 Move the computation of the IsEarlyClobber flag into its own loop, since the
correct value is needed in every iteration of the loop for updating
LiveIntervals.

llvm-svn: 175603
2013-02-20 06:46:46 +00:00
Cameron Zwarich 2941482387 Add SlotIndexes::repairIndexesInRange(), which repairs SlotIndexes after adding
and removing instructions. The implementation seems more complicated than it
needs to be, but I couldn't find something simpler that dealt with all of the
corner cases.

Also add a call to repairIndexesInRange() from repairIntervalsInRange().

llvm-svn: 175601
2013-02-20 06:46:41 +00:00
Cameron Zwarich 3673581de9 Remove verification after PHIElimination when using LiveIntervals, and move it
after the two-address pass. The remaining problems in 'make check' are occurring
later.

llvm-svn: 175598
2013-02-20 06:46:34 +00:00
Cameron Zwarich 68fbc4f642 Avoid recomputing an inserted instruction's SlotIndex.
llvm-svn: 175597
2013-02-20 06:46:32 +00:00
Cameron Zwarich 37ca2e81d8 Add preservation of SlotIndexes to PHIElimination.
llvm-svn: 175596
2013-02-20 06:46:28 +00:00
Reed Kotler 7b503c2b03 Expand pseudos/macros:
SltCCRxRy16, SltiCCRxImmX16, SltiuCCRxImmX16, SltuCCRxRy16
$T8 shows up as register $24 when emitted from C++ code so we had
to change some tests that were already there for this functionality.

llvm-svn: 175593
2013-02-20 05:45:15 +00:00
Jakub Staszak 2be3832d50 Add missing #include.
llvm-svn: 175583
2013-02-20 00:31:54 +00:00
Jakub Staszak 8bc7af1a93 Fix #includes, so we include only what we really need.
llvm-svn: 175581
2013-02-20 00:26:25 +00:00
Jakub Staszak 6605c604b9 Move part of APInt implementation from header to cpp file. These methods
require call cpp file anyway, so we wouldn't gain anything by keeping them
inline.

llvm-svn: 175579
2013-02-20 00:17:42 +00:00
Pedro Artigas 7ba2edc0bf clear new map and initialize new variable
llvm-svn: 175578
2013-02-20 00:10:29 +00:00
Bill Wendling 6da216f6f4 Add the function attributes from an inline asm call. These don't have declarations that set the attribute groups, so we must do it on our own.
llvm-svn: 175577
2013-02-20 00:04:41 +00:00
Chad Rosier 45a52fa097 [ms-inline asm] Force the use of a base pointer if the MachineFunction includes
MS-style inline assembly.

This is a follow-on to r175334.  Forcing a FP to be emitted doesn't ensure it
will be used.  Therefore, force the base pointer as well.  We now treat MS
inline assembly in the same way we treat functions with dynamic stack
realignment and VLAs.  This guarantees the BP will be used to reference 
parameters and locals.
rdar://13218191

llvm-svn: 175576
2013-02-19 23:50:45 +00:00
Dan Gohman 3e1729484f Update a portability kludge to keep it in sync with changes in the code
which uses it. This is not ideal, but it ought to at least restore the
behavior to what it was before.

llvm-svn: 175571
2013-02-19 22:38:58 +00:00
Jack Carter 10c97e5ca0 ELF symbol table field st_other support,
excluding visibility bits.

Mips (o32 abi) specific e_header setting.

EF_MIPS_ABI_O32 needs to be set in the 
ELF header flags for o32 abi output.

Contributer: Reed Kotler
llvm-svn: 175569
2013-02-19 22:29:00 +00:00
Jakub Staszak ae2fd9c97d Remove unused variable.
llvm-svn: 175568
2013-02-19 22:17:58 +00:00
Jakub Staszak 3c6583a1b1 Minor cleanups. No functionality change.
llvm-svn: 175567
2013-02-19 22:14:45 +00:00
Jack Carter 1ba1f3cec8 ELF symbol table field st_other support,
excluding visibility bits.

Mips (Mips16) specific e_header setting.

EF_MIPS_ARCH_ASE_M16 needs to be set in the 
ELF header flags for Mips16.

Contributer: Reed Kotler
llvm-svn: 175566
2013-02-19 22:14:34 +00:00
Jakub Staszak 90fbe91c58 Remove unneeded #includes.
llvm-svn: 175565
2013-02-19 22:06:38 +00:00
Jack Carter ab3cb425aa ELF symbol table field st_other support,
excluding visibility bits.

Mips (MicroMips) specific STO handling .

The st_other field settig for STO_MIPS_MICROMIPS

Contributer: Zoran Jovanovic
llvm-svn: 175564
2013-02-19 22:04:37 +00:00
Jakub Staszak 086f6cde5d Fix typos.
llvm-svn: 175562
2013-02-19 22:02:21 +00:00
Jack Carter 2f8d9d913c ELF symbol table field st_other support,
excluding visibility bits.

Generic STO handling at the Target level.

The st_other field of the ELF symbol table is one
byte in size. The first 2 bytes are used for generic
visibility and are currently handled by llvm.

The other six bits are processor specific and need 
to be set at the target level.

A couple of notes:

The new static methods for accessing and setting the "other"
flags in include/llvm/MC/MCELF.h match the style guide
and not the other methods in the file. I don't like the
inconsistency, but feel I should follow the prescribed 
lowerUpper() convention.

STO_ value definitions are not specified in gnu land as 
consistently as the STT_ and STB_ fields. Probably because
the latter were defined in a standards doc and the former
defined partially in code. I have stuck with the full byte
definition of the flags.

Contributer: Zoran Jovanovic
llvm-svn: 175561
2013-02-19 21:57:35 +00:00
Jakub Staszak e167cf5c4d Add obvious constantness.
llvm-svn: 175560
2013-02-19 21:54:59 +00:00
Arnold Schwaighofer e4df5eb34a ARM NEON: Don't need COPY_TO_REGCLASS in pattern
In my previous commit:
"Merge a f32 bitcast of a v2i32 extractelt

A vectorized sitfp on doubles will get scalarized to a sequence of an
extract_element of <2 x i32>, a bitcast to f32 and a sitofp.
Due to the the extract_element, and the bitcast we will uneccessarily generate
moves between scalar and vector registers."

I added a pattern containing a copy_to_regclass. The copy_to_regclass is
actually not needed.

radar://13191881

llvm-svn: 175555
2013-02-19 20:16:45 +00:00
Nadav Rotem 0186347c4c Fix a bug in mayHaveSideEffects. Functions that do not return are now considered as instructions with side effects.
rdar://13227456

llvm-svn: 175553
2013-02-19 20:02:09 +00:00
Nadav Rotem 0e48803252 Fix a bug that was found by the clang static analyzer. The var "AT" is null so we cant deref it.
llvm-svn: 175550
2013-02-19 19:36:59 +00:00
Dan Gohman 782609e146 Whitelist files and block devices instead of blacklisting fifos and
character devices.

llvm-svn: 175549
2013-02-19 19:36:55 +00:00
Dan Gohman 22954dbb7e Don't trust st_size of a character device. This fixes using
/dev/stdin as an input when stdin is connected to a tty, for example.

No test, because it's difficult to write a reasonably portable test
for this. /dev/stdin isn't a character device when stdin is redirected
from a file or connected to a pipe.

llvm-svn: 175542
2013-02-19 18:57:53 +00:00
Jim Grosbach 3fa275e6f7 ARM: Allocation hints must make sure to be in the alloc order.
When creating an allocation hint for a register pair, make sure the hint
for the physical register reference is still in the allocation order.

rdar://13240556

llvm-svn: 175541
2013-02-19 18:55:36 +00:00
Jakob Stoklund Olesen 7e28db019a Assert that the target provided hints are in the allocation order.
Target implementations of getRegAllocationHints() should use the
provided allocation order, and they can never return hints outside the
order. This is already documented in TargetRegisterInfo.h.

<rdar://problem/13240556>

llvm-svn: 175540
2013-02-19 18:41:01 +00:00
Jyotsna Verma e758da2080 Hexagon: Sync TSFlags in MCTargetDesc/HexagonBaseInfo.h with
HexagonInstrFormats.td.

llvm-svn: 175537
2013-02-19 18:18:36 +00:00
Benjamin Kramer 1cb826b0ad Clean up HiPE prologue emission a bit and avoid signed arithmetic tricks.
No intended functionality change.

llvm-svn: 175536
2013-02-19 17:32:57 +00:00
Rafael Espindola 1c040b5788 Move LLVM_LIBRARY_VISIBILITY for consistency with what was done to
PPCJITInfo.cpp in r175394.

llvm-svn: 175531
2013-02-19 17:14:33 +00:00
Benjamin Kramer b3aa2b8497 Fix GCMetadaPrinter::finishAssembly not executed, patch by Yiannis Tsiouris.
Due to the execution order of doFinalization functions, the GC information were
deleted before AsmPrinter::doFinalization was executed. Thus, the
GCMetadataPrinter::finishAssembly was never called.

The patch fixes that by moving the code of the GCInfoDeleter::doFinalization to
Printer::doFinalization.

llvm-svn: 175528
2013-02-19 16:51:44 +00:00
Eli Bendersky 6aa4fc389e Make ARMAsmPrinter pass name more precise and fix comment.
llvm-svn: 175527
2013-02-19 16:47:59 +00:00
Eli Bendersky b0b13b22a3 Make pass name more precise and fix comment.
llvm-svn: 175525
2013-02-19 16:38:32 +00:00
Arnold Schwaighofer e5083442b2 ARM NEON: Merge a f32 bitcast of a v2i32 extractelt
A vectorized sitfp on doubles will get scalarized to a sequence of an
extract_element of <2 x i32>, a bitcast to f32 and a sitofp.
Due to the the extract_element, and the bitcast we will uneccessarily generate
moves between scalar and vector registers.

The patch fixes this by using a COPY_TO_REGCLASS and a EXTRACT_SUBREG to extract
the element from the vector instead.

radar://13191881

llvm-svn: 175520
2013-02-19 15:27:05 +00:00
Tom Stellard d4409e2cec R600: Add AR_X to the R600_TReg_X register class.
NOTE: This is a candidate for the Mesa stable branch.
llvm-svn: 175519
2013-02-19 15:22:47 +00:00
Tom Stellard a24a516737 R600: Mark all members of the TRegMem register class as reserved
This stops the Machine Verifier from complaining about uses of undefined
physical registers.

NOTE: This is a candidate for the Mesa stable branch.
llvm-svn: 175518
2013-02-19 15:22:45 +00:00
Tom Stellard 8d469edbe3 R600: Fix scheduler crash caused by invalid MachinePointerInfo
Kernel function arguments are lowered to loads from the PARAM_I address
space.  When creating these load instructions, we were initializing
their MachinePointerInfo with an Arguement object that was not attached
to any function.  This was causing the MachineScheduler to crash when
it tried to access the parent of the Arguement.

This has been fixed by initializing the MachinePointerInfo with a
UndefValue instead.

NOTE: This is a candidate for the Mesa stable branch.
llvm-svn: 175517
2013-02-19 15:22:44 +00:00
Tom Stellard 0f965aaf9b R600: Fix tracking of implicit defs in the IndirectAddressing pass
In some cases, we were losing track of live implicit registers which
was creating dead defs and causing the scheduler to produce invalid
code.

NOTE: This is a candidate for the Mesa stable branch.
llvm-svn: 175516
2013-02-19 15:22:42 +00:00
Alexey Samsonov f940f0c417 Fix initialization-order bug in llvm::Support::TimeValue. TimeValue::now() is explicitly called during module initialization of lib/Support/Process.cpp. It reads the field of global object PosixZeroTime, which is not guaranteed to be initialized at this point. Found by AddressSanitizer with -fsanitize=init-order option.
llvm-svn: 175509
2013-02-19 11:35:39 +00:00
Kostya Serebryany 3ece9beaf1 [asan] instrument memory accesses with unusual sizes
This patch makes asan instrument memory accesses with unusual sizes (e.g. 5 bytes or 10 bytes), e.g. long double or
packed structures.
Instrumentation is done with two 1-byte checks
(first and last bytes) and if the error is found
__asan_report_load_n(addr, real_size) or
__asan_report_store_n(addr, real_size)
is called.

Also, call these two new functions in memset/memcpy
instrumentation.

asan-rt part will follow.

llvm-svn: 175507
2013-02-19 11:29:21 +00:00
Jakub Staszak 977def1acc Simplify code. No functionality change.
llvm-svn: 175501
2013-02-19 09:48:30 +00:00
Craig Topper f371e89264 Fix capitalization in comment to match function name.
llvm-svn: 175497
2013-02-19 07:43:59 +00:00
Craig Topper 4ce8a909ba More const correcting of stack coloring.
llvm-svn: 175490
2013-02-19 06:02:40 +00:00
Craig Topper b35030b229 Const-correct the stack coloring code.
llvm-svn: 175488
2013-02-19 05:32:02 +00:00
Craig Topper 9a4b318491 Avoid extra DenseMap lookups in StackColoring::calculateLocalLiveness.
llvm-svn: 175487
2013-02-19 04:47:31 +00:00
Reed Kotler 3e457f505e Expand pseudos/macros BteqzT8SltiX16, BteqzT8SltiuX16,
BtnezT8SltiX16, BtnezT8SltiuX16 .

llvm-svn: 175486
2013-02-19 03:56:57 +00:00
Craig Topper ac82084563 Make the dump() function const and reduce the number of hash lookups it performs.
llvm-svn: 175485
2013-02-19 03:14:22 +00:00
Craig Topper 85abf9ea73 Use a reference into the BlockLiveness DenseMap to avoid repeated hash lookups in collectMarkers.
llvm-svn: 175484
2013-02-19 03:06:17 +00:00
Chandler Carruth c2fd56a21d Remove some unused private fields from the AArch64MCCodeEmitter. These
fields were only ever set in the constructor. The create method retains
its consistent interface so that these bits can be re-threaded through
the emitter if they're ever needed.

This was found by the -Wunused-private-field Clang warning.

llvm-svn: 175482
2013-02-19 02:08:14 +00:00
Bill Wendling c98e4fef1a Temporarily revert r175470 for more review.
llvm-svn: 175476
2013-02-19 00:52:45 +00:00
Reed Kotler d82171990f Expand pseudos BteqzT8CmpiX16 and BtnezT8CmpiX16.
llvm-svn: 175474
2013-02-19 00:20:58 +00:00
Jakub Staszak 1f199a0ef2 Use array_pod_sort instead of std::sort.
llvm-svn: 175472
2013-02-18 23:18:22 +00:00
Bill Wendling 66651e4c2f Check to see if the 'no-builtin' attribute is set before simplifying a library call.
llvm-svn: 175470
2013-02-18 23:17:16 +00:00
NAKAMURA Takumi 3a8002f61d X86FrameLowering.cpp: Fixup. Sorry for the breakage.
llvm-svn: 175467
2013-02-18 23:15:21 +00:00
David Blaikie 772d4f75f6 Use LLVM_DELETED_FUNCTION rather than '// do not implement' comments.
Also removes some redundant DNI comments on function declarations already
using the macro.

llvm-svn: 175466
2013-02-18 23:11:17 +00:00
NAKAMURA Takumi a614ec7e6f X86FrameLowering.cpp: Fix a warning in -Asserts. [-Wunused-variable]
llvm-svn: 175464
2013-02-18 23:08:49 +00:00
Chad Rosier 441e81287f Remove a useless assert.
llvm-svn: 175463
2013-02-18 22:20:16 +00:00
Chad Rosier f3f8f443e1 [fast-isel] Remove an invalid assert.
If the memcpy has an odd length with an alignment of 2, this would incorrectly
assert on the last 1 byte copy.
rdar://13202135

llvm-svn: 175459
2013-02-18 21:46:28 +00:00
Benjamin Kramer 5c6e653b72 Fix a 32/64 bit incompatibility in the HiPE prologue generation.
llvm-svn: 175458
2013-02-18 21:45:01 +00:00
Benjamin Kramer 53bc37ca2a Support for HiPE-compatible code emission, patch by Yiannis Tsiouris.
llvm-svn: 175457
2013-02-18 20:55:12 +00:00
Chad Rosier 3489bcc9ab [ms-inline asm] Remove a redundant call to the setHasMSInlineAsm function.
llvm-svn: 175456
2013-02-18 20:13:59 +00:00
Vincent Lejeune 1ce13f553e R600/SI: Use MULADD_IEEE/V_MAD_F32 instruction for mad pattern
llvm-svn: 175446
2013-02-18 14:11:28 +00:00
Vincent Lejeune 685018009b R600: Support for TBO
NOTE: This is a candidate for the Mesa stable branch.

Reviewed-by: Tom Stellard <thomas.stellard at amd.com>
llvm-svn: 175445
2013-02-18 14:11:19 +00:00
Vincent Lejeune 4c1602b5c9 R600: Increase number of ArrayBase Reg to 32
Reviewed-by: Tom Stellard <thomas.stellard at amd.com>
llvm-svn: 175443
2013-02-18 13:48:09 +00:00
Kostya Serebryany 7ca384bc1a [asan] revert r175266 as it breaks code with packed structures. supporting long double will require a more general solution
llvm-svn: 175442
2013-02-18 13:47:02 +00:00
Benjamin Kramer eaf706bef3 Futureproof AttrBuild if we ever have more than 64 attr enum values.
Currently we're at 34. Bitset should compile into virtually the same code as
uint64_t here.

llvm-svn: 175437
2013-02-18 12:09:51 +00:00
David Blaikie 12bbf715fc DIBuilder: Correct the null/0 type of trailing fields in struct debug info.
Paired with an Clang commit so this may cause temporary build failures.

llvm-svn: 175426
2013-02-18 07:27:30 +00:00
David Blaikie 595eb44a2c DIBuilder: Add function and method definitions to the list of all subprograms
Previously we seemed to be assuming that all functions were definitions and all
methods were declarations. This may be consistent with how Clang uses DIBuilder
but doesn't have to be true of all clients (such as DragonEgg).

llvm-svn: 175423
2013-02-18 07:10:22 +00:00
NAKAMURA Takumi 68426c79db [ms-inline asm] Fix undefined behavior to reset hasMSInlineAsm in advance of SelectAllBasicBlocks().
llvm-svn: 175422
2013-02-18 07:06:48 +00:00
David Blaikie f11de2f27d Narrow the return types of a few DIBuilder utility functions.
llvm-svn: 175421
2013-02-18 06:41:57 +00:00
Reed Kotler 1460738710 Expand macro/pseudo instructions BtnezT8SltX16 and BtnezT8SltuX16.
llvm-svn: 175420
2013-02-18 05:43:03 +00:00
Reed Kotler 6879e56dc7 Expand pseudo/macro BteqzT8SltuX16 . There is no test case because
at this time, llvm is generating a different but equivalent pattern
that would lead to this instruction. I am trying to think of a way
to get it to generate this. If I can't, I may just remove the pseudo.

llvm-svn: 175419
2013-02-18 04:55:38 +00:00
Reed Kotler c40f4e5899 Expand pseudo/macro BteqzT8SltX16.
llvm-svn: 175417
2013-02-18 04:04:26 +00:00
Reed Kotler 7e4bc6067b Expand macro/pseudo BteqzT8CmpX16.
llvm-svn: 175416
2013-02-18 03:06:29 +00:00
Reed Kotler cb37409b92 Beginning of expanding all current mips16 macro/pseudo instruction sequences.
This expansion will be moved to expandISelPseudos as soon as I can figure
out how to do that. There are other instructions which use this 
ExpandFEXT_T8I816_ins and as soon as I have finished expanding them all,
I will delete the macro asm string text so it has no way to be used
in the future.

llvm-svn: 175413
2013-02-18 00:59:04 +00:00
Benjamin Kramer 189fc5819a X86: Add a note.
llvm-svn: 175408
2013-02-17 23:34:14 +00:00
Richard Osborne 53fff94527 [XCore] Add missing 2r instructions.
These instructions are not targeted by the compiler but it is needed for
the MC layer.

llvm-svn: 175407
2013-02-17 22:38:05 +00:00
Richard Osborne f5a3ffcba9 [XCore] Add TSETR instruction.
This instruction is not targeted by the compiler but it is needed for the
MC layer.

llvm-svn: 175406
2013-02-17 22:32:41 +00:00
Richard Osborne 2192615d9f [XCore] Add missing u10 / lu10 instructions.
These instructions are not targeted by the compiler but they are
needed for the MC layer.

llvm-svn: 175404
2013-02-17 20:44:48 +00:00
Richard Osborne 3814491fb1 [XCore] Add missing u6 / lu6 instructions.
These instructions are not targeted by the compiler but they are
needed for the MC layer.

llvm-svn: 175403
2013-02-17 20:43:17 +00:00
Jakub Staszak 74010cd9c2 Return false instead of 0.
llvm-svn: 175402
2013-02-17 18:35:25 +00:00
Benjamin Kramer a5dce35cba AArch64: Avoid shifts by 64, that's undefined behavior.
No functionality change.

llvm-svn: 175400
2013-02-17 17:55:32 +00:00
Duncan Sands 1cba0a8e0a Add multithreading functions and shutdown to the C API. Patch by Moritz
Maxeiner.

llvm-svn: 175398
2013-02-17 16:35:51 +00:00
Hal Finkel 76e65e4542 BBVectorize: Fix an invalid reference bug
This fixes PR15289. This bug was introduced (recently) in r175215; collecting
all std::vector references for candidate pairs to delete at once is invalid
because subsequent lookups in the owning DenseMap could invalidate the
references.

bugpoint was able to reduce a useful test case. Unfortunately, because whether
or not this asserts depends on memory layout, this test case will sometimes
appear to produce valid output. Nevertheless, running under valgrind will
reveal the error.

llvm-svn: 175397
2013-02-17 15:59:26 +00:00
Benjamin Kramer de712b788b Make the visibility of LLVMPPCCompilationCallback work with GCC.
GCC warns about the attribute being ignored if it occurs after void*.
There seems to be some kind of incompatibility between clang and gcc here, but
I can't fathom who's right.

void* LLVM_LIBRARY_VISIBILITY foo(); // clang: hidden, gcc: default
LLVM_LIBRARY_VISIBILITY void *bar(); // clang: hidden, gcc: hidden
void LLVM_LIBRARY_VISIBILITY qux();  // clang: hidden, gcc: hidden

llvm-svn: 175394
2013-02-17 14:30:32 +00:00
Cameron Zwarich 2495596792 Remove use of reverse iterators in repairIntervalsInRange(). While they were
arguably better than forward iterators for this use case, they are confusing and
there are some implementation problems with reverse iterators and MI bundles.

llvm-svn: 175393
2013-02-17 11:09:00 +00:00
Cameron Zwarich 1286ef9c89 Use ArrayRef instead of a reference to a SmallVectorImpl.
llvm-svn: 175385
2013-02-17 03:48:23 +00:00
Cameron Zwarich ddeabf78a0 Fix a conversion from a forward iterator to a reverse iterator in
MachineBasicBlock::SplitCriticalEdge. Since this is an iterator rather than
an instr_iterator, the isBundled() check only passes if getFirstTerminator()
returned end() and the garbage memory happens to lean that way.

Multiple successors can be present without any terminator instructions in the
case of exception handling with a fallthrough.

llvm-svn: 175383
2013-02-17 01:45:04 +00:00
Cameron Zwarich bfebb41984 Add support for updating the LiveIntervals of registers used by 'exotic'
terminators that actually have register uses when splitting critical edges.

This commit also introduces a method repairIntervalsInRange() on LiveIntervals,
which allows for repairing LiveIntervals in a small range after an arbitrary
target hook modifies, inserts, and removes instructions. It's pretty limited
right now, but I hope to extend it to support all of the things that are done
by the convertToThreeAddress() target hooks.

llvm-svn: 175382
2013-02-17 00:10:44 +00:00
Bill Wendling 23242098e7 The transform is:
(or (bool?A:B),(bool?C:D)) --> (bool?(or A,C):(or B,D))

By the time the OR is visited, both the SELECTs have been visited and not
optimized and the OR itself hasn't been transformed so we do this transform in
the hopes that the new ORs will be optimized.

The transform is explicitly disabled for vector-selects until "codegen matures
to handle them better".

Patch by Muhammad Tauqir!

llvm-svn: 175380
2013-02-16 23:41:36 +00:00
Reed Kotler 61b474f97d Clean up mips16 td file in preparation for massive pseudo lowering work.
llvm-svn: 175379
2013-02-16 23:39:52 +00:00
Benjamin Kramer 6f37daccb8 GCC doesn't like ++ on enums.
llvm-svn: 175373
2013-02-16 19:22:28 +00:00
Renato Golin b2603ede95 Typo
llvm-svn: 175371
2013-02-16 19:14:59 +00:00
Benjamin Kramer 45e7d53cf4 Turn the enum attributes DenseSet in AttrBuilder into a set of bits.
Avoids malloc and is a lot denser. We lose iteration over target independent
attributes, but that's a strange interface anyways and didn't have any users
outside of AttrBuilder.

llvm-svn: 175370
2013-02-16 19:13:18 +00:00
Reed Kotler 188dad0eeb One more try to make this look nice. I have lots of pseudo lowering
as well as 16/32 bit variants to do and so I want this to look nice
when I do it. I've been experimenting with this. No new test cases
are needed.

llvm-svn: 175369
2013-02-16 19:04:29 +00:00
Benjamin Kramer ae526d106a Replace erase loop with std::remove_if.
This avoids unnecessary copies. No functionality change.

llvm-svn: 175367
2013-02-16 17:06:38 +00:00