Commit Graph

85786 Commits

Author SHA1 Message Date
Bill Wendling 7c2342467d Check that the operand of the GEP is not the GEP itself. This occurred during an LTO build of LLVM.
llvm-svn: 166157
2012-10-17 23:54:19 +00:00
Michael Liao 3ac8201ea4 Revert part of r166049 back and enable test case in r166125.
- Folding (trunc (concat ... X )) to (concat ... (trunc X) ...) is valid
  when '...' are all 'undef's.
- r166125 relies on this transformation.

llvm-svn: 166155
2012-10-17 23:45:54 +00:00
NAKAMURA Takumi 7857415785 LoopVectorize.cpp: Fix a warning. [-Wunused-variable]
llvm-svn: 166153
2012-10-17 23:40:15 +00:00
Michael Liao f630f4cadc Disable extract-concat test case temporarily
llvm-svn: 166141
2012-10-17 23:08:19 +00:00
Jakub Staszak 68e5dfddcb Remove redundant SetInsertPoint call.
llvm-svn: 166138
2012-10-17 23:06:37 +00:00
Michael Liao c87d98dbc8 Revert r166049
- In general, it's unsafe for this transformation.

llvm-svn: 166135
2012-10-17 22:41:15 +00:00
Reed Kotler 6743924a32 Add conditional branch instructions and their patterns.
llvm-svn: 166134
2012-10-17 22:29:54 +00:00
Roman Divacky 4955ec317c Fix some typos and wrong indenting.
llvm-svn: 166128
2012-10-17 21:07:35 +00:00
Michael Liao 7a442c8031 Teach DAG combine to fold (extract_subvec (concat v1, ..) i) to v_i
- If the extracted vector has the same type of all vectored being concatenated
  together, it should be simplified directly into v_i, where i is the index of
  the element being extracted.

llvm-svn: 166125
2012-10-17 20:48:33 +00:00
Jakob Stoklund Olesen 7a9f0c09de Switch MRI::UsedPhysRegs to a register unit bit vector.
This is a more compact, less redundant representation, and it avoids
scanning long lists of aliases for ARM D-registers, for example.

llvm-svn: 166124
2012-10-17 20:26:33 +00:00
Nadav Rotem 89a452a9a6 Update the release notes about how to enable the loop vectorizer.
llvm-svn: 166123
2012-10-17 19:49:21 +00:00
Evan Cheng 839fb650b2 Add a really faster pre-RA scheduler (-pre-RA-sched=linearize). It doesn't use
any scheduling heuristics nor does it build up any scheduling data structure
that other heuristics use. It essentially linearize by doing a DFA walk but
it does handle glues correctly.

IMPORTANT: it probably can't handle all the physical register dependencies so
it's not suitable for x86. It also doesn't deal with dbg_value nodes right now
so it's definitely is still WIP.

rdar://12474515

llvm-svn: 166122
2012-10-17 19:39:36 +00:00
Jakob Stoklund Olesen 0736442683 Merge MRI::isPhysRegOrOverlapUsed() into isPhysRegUsed().
All callers of these functions really want the isPhysRegOrOverlapUsed()
functionality which also checks aliases. For historical reasons, targets
without register aliases were calling isPhysRegUsed() instead.

Change isPhysRegUsed() to also check aliases, and switch all
isPhysRegOrOverlapUsed() callers to isPhysRegUsed().

llvm-svn: 166117
2012-10-17 18:44:18 +00:00
Nadav Rotem ec92817e05 Update the release notes about the store-merge dag optimization.
llvm-svn: 166116
2012-10-17 18:35:21 +00:00
Nadav Rotem d9779f15cf Update the release notes about the new TargetTransformInfo API changes.
llvm-svn: 166115
2012-10-17 18:33:50 +00:00
Nadav Rotem c260387050 Update the release notes about the new loop vectorizer.
llvm-svn: 166113
2012-10-17 18:30:09 +00:00
Nadav Rotem 6b94c2a09b Add a loop vectorizer.
llvm-svn: 166112
2012-10-17 18:25:06 +00:00
Jakob Stoklund Olesen a10c09804d Check for empty YMM use-def lists in X86VZeroUpper.
The previous MRI.isPhysRegUsed(YMM0) would also return true when the
function contains a call to a function that may clobber YMM0. That's
most of them.

Checking the use-def chains allows us to skip functions that don't
explicitly mention YMM registers.

llvm-svn: 166110
2012-10-17 17:52:35 +00:00
Anton Korobeynikov 0a69176ce0 Fix fallout from RegInfo => FrameLowering refactoring on MSP430.
Patch by Job Noorman!

llvm-svn: 166108
2012-10-17 17:37:11 +00:00
Andrew Trick 0b1d8d04b9 misched: Better handling of invalid latencies in the machine model
llvm-svn: 166107
2012-10-17 17:27:10 +00:00
Sean Silva 13c64c08c2 docs: Add link to integrated assembler HowTo
llvm-svn: 166106
2012-10-17 16:36:27 +00:00
Daniel Dunbar 511479ddb4 Support: Don't remove special files on signals.
- Similar to Path::eraseFromDisk(), we don't want LLVM to remove things like
   /dev/null, even if it has the permission.

llvm-svn: 166105
2012-10-17 16:30:54 +00:00
Kostya Serebryany 20343351be [asan] better debug diagnostics in asan compiler module
llvm-svn: 166102
2012-10-17 13:40:06 +00:00
Chandler Carruth 6fab42aa39 This just in, it is a *bad idea* to use 'udiv' on an offset of
a pointer. A very bad idea. Let's not do that. Fixes PR14105.

Note that this wasn't *that* glaring of an oversight. Originally, these
routines were only called on offsets within an alloca, which are
intrinsically positive. But over the evolution of the pass, they ended
up being called for arbitrary offsets, and things went downhill...

llvm-svn: 166095
2012-10-17 09:23:48 +00:00
Bill Wendling 003516b592 Marked this variable as 'used' so that LTO doesn't get rid of it.
llvm-svn: 166092
2012-10-17 08:08:06 +00:00
Chandler Carruth 40617f593e Fix a really annoying "bug" introduced in r165941. The change from that
revision makes no sense. We cannot use the address space of the *post
indexed* type to conclude anything about a *pre indexed* pointer type's
size. More importantly, this index can never be over a pointer. We are
indexing over arrays and vectors here.

Of course, I have no test case here. Neither did the original patch. =/

llvm-svn: 166091
2012-10-17 07:22:16 +00:00
Craig Topper 1958f04bda Remove LLVM_DELETED_FUNCTION from destructors that override non-deleted base class destructors. This isn't legal by the C++11 standard and clang now checks for it. Curiously gcc didn't catch this, possibly because of the template usage.
llvm-svn: 166089
2012-10-17 05:15:58 +00:00
Michael Liao cef9541dac Check SSSE3 instead of SSE4.1
- All shuffle insns required, especially PSHUB, are added in SSSE3.

llvm-svn: 166086
2012-10-17 03:59:18 +00:00
Michael Liao 6f7206132f Fix setjmp on models with non-Small code model nor non-Static relocation model
- MBB address is only valid as an immediate value in Small & Static
  code/relocation models. On other models, LEA is needed to load IP address of
  the restore MBB.
- A minor fix of MBB in MC lowering is added as well to enable target
  relocation flag being propagated into MC.

llvm-svn: 166084
2012-10-17 02:22:27 +00:00
Jakob Stoklund Olesen a2136be107 Use a SparseSet instead of a BitVector for UsedInInstr in RAFast.
This is just as fast, and it makes it possible to avoid leaking the
UsedPhysRegs BitVector implementation through
MachineRegisterInfo::addPhysRegsUsed().

llvm-svn: 166083
2012-10-17 01:37:59 +00:00
Eric Christopher 494109b055 Use a typedef to reduce some typing and reformat code accordingly.
llvm-svn: 166077
2012-10-16 23:46:25 +00:00
Eric Christopher 02509481f6 Variable name cleanup.
llvm-svn: 166076
2012-10-16 23:46:23 +00:00
Eric Christopher 3680f8826e Formatting and 80-col.
llvm-svn: 166075
2012-10-16 23:46:21 +00:00
Eric Christopher 587e153197 Spacing.
llvm-svn: 166074
2012-10-16 23:46:19 +00:00
Jakob Stoklund Olesen 4df59a9ff8 Avoid rematerializing a redef immediately after the old def.
PR14098 contains an example where we would rematerialize a MOV8ri
immediately after the original instruction:

  %vreg7:sub_8bit<def> = MOV8ri 9; GR32_ABCD:%vreg7
  %vreg22:sub_8bit<def> = MOV8ri 9; GR32_ABCD:%vreg7

Besides being pointless, it is also wrong since the original instruction
only redefines part of the register, and the value read by the new
instruction is wrong.

The problem was the LiveRangeEdit::allUsesAvailableAt() didn't
special-case OrigIdx == UseIdx and found the wrong SSA value.

llvm-svn: 166068
2012-10-16 22:51:58 +00:00
Jakob Stoklund Olesen 2043329e67 Revert r166046 "Switch back to the old coalescer for now to fix the 32 bit bit"
A fix for PR14098, including the test case is in the next commit.

llvm-svn: 166067
2012-10-16 22:51:55 +00:00
Michael Gottesman 02a1141e5a [InstCombine] Teach InstCombine how to handle an obfuscated splat.
An obfuscated splat is where the frontend poorly generates code for a splat
using several different shuffles to create the splat, i.e.,

  %A = load <4 x float>* %in_ptr, align 16
  %B = shufflevector <4 x float> %A, <4 x float> undef, <4 x i32> <i32 0, i32 0, i32 undef, i32 undef>
  %C = shufflevector <4 x float> %B, <4 x float> %A, <4 x i32> <i32 0, i32 1, i32 4, i32 undef>
  %D = shufflevector <4 x float> %C, <4 x float> %A, <4 x i32> <i32 0, i32 1, i32 2, i32 4>

llvm-svn: 166061
2012-10-16 21:29:38 +00:00
Chad Rosier e4ad2a0b96 [ms-inline asm] Add the helper function, isParseringInlineAsm(). To be used in a future commit.
llvm-svn: 166054
2012-10-16 20:16:20 +00:00
Jakub Staszak 8f46e914fb Simplify code. No functionality change.
llvm-svn: 166053
2012-10-16 19:52:32 +00:00
Michael Liao d6f3168a08 Check .rela instead of ELF64 for the compensation vaue resetting
llvm-svn: 166051
2012-10-16 19:49:51 +00:00
Jakub Staszak 25dcab1eaa 80-col fixup.
llvm-svn: 166050
2012-10-16 19:39:40 +00:00
Michael Liao 19006206a1 Teach DAG combine to fold (trunc (fptoXi x)) to (fptoXi x)
llvm-svn: 166049
2012-10-16 19:38:35 +00:00
Rafael Espindola b58be2c593 Switch back to the old coalescer for now to fix the 32 bit bit
llvm+clang+compiler-rt bootstrap.

llvm-svn: 166046
2012-10-16 19:34:06 +00:00
Jakub Staszak ba34fdb0e4 Simplify potentially quadratic behavior while erasing elements from std::vector.
llvm-svn: 166045
2012-10-16 19:32:31 +00:00
Bill Wendling 7b9eb5c64a And now we can call the other 'get' method from this one and not duplicate the code.
llvm-svn: 166037
2012-10-16 18:20:09 +00:00
Michael Liao 02ca34541e Support v8f32 to v8i8/vi816 conversion through custom lowering
- Add custom FP_TO_SINT on v8i16 (and v8i8 which is legalized as v8i16 due to
  vector element-wise widening) to reduce DAG combiner and its overhead added
  in X86 backend.

llvm-svn: 166036
2012-10-16 18:14:11 +00:00
Bill Wendling 53a6f63c26 Use the appropriate Attributes::get method to create an Attributes object.
llvm-svn: 166035
2012-10-16 18:06:06 +00:00
Owen Anderson 544284eb31 Speculative fix the mask constants to be of type uintptr_t. I don't know of any case where the old form was incorrect, but I'm more confident that such cases don't exist in this version.
llvm-svn: 166031
2012-10-16 17:10:33 +00:00
Dmitri Gribenko 610a86e6bf Fix function parameter spelling in comments. Caught by -Wdocumentation.
llvm-svn: 166024
2012-10-16 15:37:50 +00:00
Bill Schmidt 48081cad0d This patch addresses PR13949.
For the PowerPC 64-bit ELF Linux ABI, aggregates of size less than 8
bytes are to be passed in the low-order bits ("right-adjusted") of the
doubleword register or memory slot assigned to them.  A previous patch
addressed this for aggregates passed in registers.  However, small
aggregates passed in the overflow portion of the parameter save area are
still being passed left-adjusted.

The fix is made in PPCTargetLowering::LowerCall_Darwin_Or_64SVR4 on the
caller side, and in PPCTargetLowering::LowerFormalArguments_64SVR4 on
the callee side.  The main fix on the callee side simply extends
existing logic for 1- and 2-byte objects to 1- through 7-byte objects,
and correcting a constant left over from 32-bit code.  There is also a
fix to a bogus calculation of the offset to the following argument in
the parameter save area.

On the caller side, again a constant left over from 32-bit code is
fixed.  Additionally, some code for 1, 2, and 4-byte objects is
duplicated to handle the 3, 5, 6, and 7-byte objects for SVR4 only.  The
LowerCall_Darwin_Or_64SVR4 logic is getting fairly convoluted trying to
handle both ABIs, and I propose to separate this into two functions in a
future patch, at which time the duplication can be removed.

The patch adds a new test (structsinmem.ll) to demonstrate correct
passing of structures of all seven sizes.  Eight dummy parameters are
used to force these structures to be in the overflow portion of the
parameter save area.

As a side effect, this corrects the case when aggregates passed in
registers are saved into the first eight doublewords of the parameter
save area:  Previously they were stored left-justified, and now are
properly stored right-justified.  This requires changing the expected
output of existing test case structsinregs.ll.

llvm-svn: 166022
2012-10-16 13:30:53 +00:00