Commit Graph

76594 Commits

Author SHA1 Message Date
Duncan P. N. Exon Smith d40af00e66 Support: Add dwarf::getLanguage()
llvm-svn: 228458
2015-02-06 22:55:13 +00:00
Duncan P. N. Exon Smith 0317944b1a Support: Rewrite dwarf::LanguageString(), NFC
llvm-svn: 228457
2015-02-06 22:53:19 +00:00
Duncan P. N. Exon Smith af677ebb41 IR: Allow 32-bits for lines in debug location
Remove unnecessary restriction of 24-bits for line numbers in
`MDLocation`.

The rest of the debug info schema (with the exception of local
variables) uses 32-bits for line numbers.  As I introduce the
specialized nodes, it makes sense to canonicalize on one size or the
other.

llvm-svn: 228455
2015-02-06 22:50:13 +00:00
Sanjay Patel 3d982214b0 use local variables; NFC
llvm-svn: 228452
2015-02-06 22:43:52 +00:00
Duncan P. N. Exon Smith 4031beb10a Support: Stop stringifying DW_LANG_{lo,hi}_user
llvm-svn: 228451
2015-02-06 22:34:48 +00:00
Duncan P. N. Exon Smith a81f7e1a63 AsmParser: Use DW_TAG_hi_user instead of magic constant, NFC
llvm-svn: 228448
2015-02-06 22:29:35 +00:00
Duncan P. N. Exon Smith c6da7f1c74 AsmWriter: Extract writeTag(), NFC
llvm-svn: 228447
2015-02-06 22:28:05 +00:00
Duncan P. N. Exon Smith 61a0933007 AsmWriter: Extract writeMetadataAsOperand(), NFC
llvm-svn: 228446
2015-02-06 22:27:22 +00:00
Evgeniy Stepanov 4e12057760 [msan] Fix "missing origin" in atomic store.
An atomic store always make the target location fully initialized (in the
current implementation). It should not store origin. Initialized memory can't
have meaningful origin, and, due to origin granularity (4 bytes) there is a
chance that this extra store would overwrite meaningfull origin for an adjacent
location.

llvm-svn: 228444
2015-02-06 21:47:39 +00:00
Cameron Esfahani f0bf1947b7 Test commit to see if it triggers an email to llvm-commits. No change.
llvm-svn: 228442
2015-02-06 21:33:08 +00:00
Zachary Turner 8022f24fe8 Try to fix Makefile build for LLVMDebugInfoPDB.
llvm-svn: 228437
2015-02-06 20:42:03 +00:00
Zachary Turner 0e9e66330a Resubmit "Create lib/DebugInfo/PDB" (r228428)
This change resubmits the patch that broke the build, this time
without unittests.  The unittests will be submitted separately
after the problem has been addressed:

--Original Commit Message--

Create lib/DebugInfo/PDB.

This patch creates a platform-independent interface to a PDB reader.
There is currently no implementation of this interface, which will
be provided in future patches.  This defines the basic object model
which any implementation must conform to.

Reviewed by: David Blaikie
Differential Revision: http://reviews.llvm.org/D7356

llvm-svn: 228435
2015-02-06 20:30:52 +00:00
Michael Zolotukhin 7af83c1f39 Use estimated number of optimized insns in unroll-threshold computation.
If complete-unroll could help us to optimize away N% of instructions, we
might want to do this even if the final size would exceed loop-unroll
threshold. However, we don't want to unroll huge loop, and we are add
AbsoluteThreshold to avoid that - this threshold will never be crossed,
even if we expect to optimize 99% instructions after that.

llvm-svn: 228434
2015-02-06 20:20:40 +00:00
Michael Zolotukhin 4e8598eee3 [InstSimplify] Add SimplifyFPBinOp function.
It is a variation of SimplifyBinOp, but it takes into account
FastMathFlags.

It is needed in inliner and loop-unroller to accurately predict the
transformation's outcome (previously we dropped the flags and were too
conservative in some cases).

Example:
float foo(float *a, float b) {
 float r;
 if (a[1] * b)
   r = /* a lot of expensive computations */;
 else
   r = 1;
 return r;
}
float boo(float *a) {
 return foo(a, 0.0);
}

Without this patch, we don't inline 'foo' into 'boo'.

llvm-svn: 228432
2015-02-06 20:02:51 +00:00
Zachary Turner 8c89a82c88 Revert "Create lib/DebugInfo/PDB."
This reverts commit 21028, as it is causing failures in LLVMConfig.

llvm-svn: 228431
2015-02-06 20:00:18 +00:00
Kostya Serebryany db4d645714 [fuzzer] move default sanitizer options to a separate file
llvm-svn: 228429
2015-02-06 19:52:07 +00:00
Zachary Turner 079ba9224f Create lib/DebugInfo/PDB.
This patch creates a platform-independent interface to a PDB reader.
There is currently no implementation of this interface, which will
be provided in future patches.  This defines the basic object model
which any implementation must conform to.

Reviewed by: David Blaikie
Differential Revision: http://reviews.llvm.org/D7356

llvm-svn: 228428
2015-02-06 19:44:09 +00:00
Lang Hames 8a6f35546b [Orc] Move SectionMemoryManager's implementation from MCJIT to ExecutionEngine.
This is a more sensible home for SectionMemoryManager, and allows the implementation
to be shared between Orc and MCJIT.

llvm-svn: 228427
2015-02-06 19:36:40 +00:00
Quentin Colombet a8cb36ea43 [LiveIntervalAnalysis] Speed up creation of live ranges for physical registers
by using a segment set.

The patch addresses a compile-time performance regression in the LiveIntervals
analysis pass (see http://llvm.org/bugs/show_bug.cgi?id=18580). This regression
is especially critical when compiling long functions. Our analysis had shown
that the most of time is taken for generation of live intervals for physical
registers. Insertions in the middle of the array of live ranges cause quadratic
algorithmic complexity, which is apparently the main reason for the slow-down. 

Overview of changes:
- The patch introduces an additional std::set<Segment>* member in LiveRange for
  storing segments in the phase of initial creation. The set is used if this
  member is not NULL, otherwise everything works the old way. 
- The set of operations on LiveRange used during initial creation (i.e. used by
  createDeadDefs and extendToUses) have been reimplemented to use the segment
  set if it is available.
- After a live range is created the contents of the set are flushed to the
  segment vector, because the set is not as efficient as the vector for the
  later uses of the live range. After the flushing, the set is deleted and
  cannot be used again.
- The set is only for live ranges computed in
  LiveIntervalAnalysis::computeLiveInRegUnits() and getRegUnit() but not in
  computeVirtRegs(), because I did not bring any performance benefits to
  computeVirtRegs() and for some examples even brought a slow down.

Patch by Vaidas Gasiunas <vaidas.gasiunas@sap.com>

Differential Revision: http://reviews.llvm.org/D6013

llvm-svn: 228421
2015-02-06 18:42:41 +00:00
Adam Nemet 7206d7a5d2 [LV] Move addRuntimeCheck to LoopAccessAnalysis
This will allow it to be shared with the new Loop Distribution pass.

getFirstInst is currently duplicated across LoopVectorize.cpp and
LoopAccessAnalysis.cpp.  This is a short-term work-around until we figure out
a better solution.

NFC.  (The code moved is adjusted a bit for the name of the Loop member and
that PtrRtCheck is now a reference rather than a pointer.)

llvm-svn: 228418
2015-02-06 18:31:04 +00:00
Reid Kleckner 526ec29370 Don't dllexport declarations
Fixes PR22488

llvm-svn: 228411
2015-02-06 17:59:49 +00:00
Benjamin Kramer 970eac40bf Make helper functions/classes/globals static. NFC.
llvm-svn: 228410
2015-02-06 17:51:54 +00:00
Matthias Braun 2e404597f4 InstCombine: Combine select sequences into a single select
Normalize
select(C0, select(C1, a, b), b) -> select((C0 & C1), a, b)
select(C0, a, select(C1, a, b)) -> select((C0 | C1), a, b)

This normal form may enable further combines on the And/Or and shortens
paths for the values. Many targets prefer the other but can go back
easily in CodeGen.

Differential Revision: http://reviews.llvm.org/D7399

llvm-svn: 228409
2015-02-06 17:49:36 +00:00
Matthias Braun 7dc96dea0a LiveInterval: Fix SubRange memory leak.
llvm-svn: 228405
2015-02-06 17:28:47 +00:00
Benjamin Kramer 69b4ad29af AArch64PromoteConstant: Modernize and resolve some Use<->User confusion.
NFC.

llvm-svn: 228399
2015-02-06 14:43:55 +00:00
Benjamin Kramer 39f76acb5c IRCE: Demote template to ArrayRef and SmallVector to array.
NFC.

llvm-svn: 228398
2015-02-06 14:43:49 +00:00
Chad Rosier 92c1f363f4 Whitespace.
llvm-svn: 228397
2015-02-06 14:14:41 +00:00
Arnaud A. de Grandmaison 77f62d45ef [PBQP] Fix comment wording. NFC
llvm-svn: 228390
2015-02-06 11:28:16 +00:00
Michel Danzer d89a557f33 R600/SI: Don't enable WQM for V_INTERP_* instructions v2
Doesn't seem necessary anymore. I think this was mostly compensating for
not enabling WQM for texture sampling instructions.

v2: Add test coverage
Reviewed-by: Tom Stellard <tom@stellard.net>
llvm-svn: 228373
2015-02-06 02:51:25 +00:00
Michel Danzer 494391ba47 R600/SI: Also enable WQM for image opcodes which calculate LOD v3
If whole quad mode isn't enabled for these, the level of detail is
calculated incorrectly for pixels along diagonal triangle edges, causing
artifacts.

v2: Use a TSFlag instead of lots of switch cases
v3: Add test coverage

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=88642
Reviewed-by: Tom Stellard <tom@stellard.net>
llvm-svn: 228372
2015-02-06 02:51:20 +00:00
Ramkumar Ramachandra 8378ac3684 Introduce print-memderefs to test isDereferenceablePointer
Since testing the function indirectly is tricky, introduce a direct
print-memderefs pass, in the same spirit as print-memdeps, which prints
dereferenceability information matched by FileCheck.

Differential Revision: http://reviews.llvm.org/D7075

llvm-svn: 228369
2015-02-06 01:46:42 +00:00
Daniel Jasper 4bb224decb Small cleanup of MachineLICM.cpp
Specifically:
- Calculate the loop pre-header once at the stat of HoistOutOfLoop, so:
  - We don't-DFS walk the MachineDomTree if we aren't going to do anything
  - Don't call getCurPreheader for each Scope
- Don't needlessly use a do-while loop
- Use early exit for Scopes.size() == 0

No functional changes intended.

llvm-svn: 228350
2015-02-05 22:39:46 +00:00
Colin LeMahieu 6e3e62fd13 [Hexagon] Renaming v4 compare-and-jump instructions.
llvm-svn: 228349
2015-02-05 22:03:32 +00:00
Colin LeMahieu 6b3aac8ad9 [Hexagon] Deleting unused patterns.
llvm-svn: 228348
2015-02-05 21:43:56 +00:00
Colin LeMahieu de68b66b4d [Hexagon] Simplifying and formatting several patterns. Changing a pattern multiply to be expanded.
llvm-svn: 228347
2015-02-05 21:13:25 +00:00
Colin LeMahieu 99c5ce1ce4 [Hexagon] Factoring a class out of some store patterns, deleting unused definitions and reformatting some patterns.
llvm-svn: 228345
2015-02-05 20:38:58 +00:00
Colin LeMahieu d40bb5353d [Hexagon] Factoring out a class for immediate transfers and cleaning up formatting.
llvm-svn: 228343
2015-02-05 20:08:52 +00:00
Alexey Samsonov 19763c48df [ASan] Enable -asan-stack-dynamic-alloca by default.
By default, store all local variables in dynamic alloca instead of
static one. It reduces the stack space usage in use-after-return mode
(dynamic alloca will not be called if the local variables are stored
in a fake stack), and improves the debug info quality for local
variables (they will not be described relatively to %rbp/%rsp, which
are assumed to be clobbered by function calls).

llvm-svn: 228336
2015-02-05 19:39:20 +00:00
Eric Christopher 24f3f65196 Remove the use of getSubtarget in the creation of the X86
PassManager instance. In one case we can make the determination
from the Triple, in the other (execution dependency pass) the
pass will avoid running if we don't have any code that uses that
register class so go ahead and add it to the pipeline.

llvm-svn: 228334
2015-02-05 19:27:04 +00:00
Eric Christopher d361ff8282 Use cached subtargets inside X86FixupLEAs.
llvm-svn: 228333
2015-02-05 19:27:01 +00:00
Eric Christopher d7dec666cc Migrate the X86 AsmPrinter away from using the subtarget when
dealing with module level emission. Currently this is using
the Triple to determine, but eventually the logic should
probably migrate to TLOF.

llvm-svn: 228332
2015-02-05 19:06:45 +00:00
Sylvestre Ledru 9be0b77f3f Fix an incorrect identifier
Summary:
EIEIO is not a correct declaration and breaks the build under Debian HURD.
Instead, E_IEIO is used.

//
http://www.gnu.org/software/libc/manual/html_node/Reserved-Names.html
Some additional classes of identifier names are reserved for future
extensions to the C language or the POSIX.1 environment. While using
these names for your own purposes right now might not cause a problem,
they do raise the possibility of conflict with future versions of the C
or POSIX standards, so you should avoid these names.
...
Names beginning with a capital ‘E’ followed a digit or uppercase letter
may be used for additional error code names. See Error Reporting.//

Reported here:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=776965
And patch wrote by Svante Signell 
With this patch, LLVM, Clang & LLDB build under Debian HURD:
https://buildd.debian.org/status/fetch.php?pkg=llvm-toolchain-3.6&arch=hurd-i386&ver=1%3A3.6~%2Brc2-2&stamp=1423040039

Reviewers: hfinkel

Reviewed By: hfinkel

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D7437

llvm-svn: 228331
2015-02-05 18:57:02 +00:00
Colin LeMahieu b882f2b5cf [Hexagon] Renaming Y2_barrier. Fixing issues where doubleword variants of instructions can't be newvalue producers.
llvm-svn: 228330
2015-02-05 18:56:28 +00:00
Hal Finkel c9dd02066c [PowerPC] Prepare loops for pre-increment loads/stores
PowerPC supports pre-increment load/store instructions (except for Altivec/VSX
vector load/stores). Using these on embedded cores can be very important, but
most loops are not naturally set up to use them. We can often change that,
however, by placing loops into a non-canonical form. Generically, this means
transforming loops like this:

  for (int i = 0; i < n; ++i)
    array[i] = c;

to look like this:

  T *p = array[-1];
  for (int i = 0; i < n; ++i)
    *++p = c;

the key point is that addresses accessed are pulled into dedicated PHIs and
"pre-decremented" in the loop preheader. This allows the use of pre-increment
load/store instructions without loop peeling.

A target-specific late IR-level pass (running post-LSR), PPCLoopPreIncPrep, is
introduced to perform this transformation. I've used this code out-of-tree for
generating code for the PPC A2 for over a year. Somewhat to my surprise,
running the test suite + externals on a P7 with this transformation enabled
showed no performance regressions, and one speedup:

External/SPEC/CINT2006/483.xalancbmk/483.xalancbmk
	-2.32514% +/- 1.03736%

So I'm going to enable it on everything for now. I was surprised by this
because, on the POWER cores, these pre-increment load/store instructions are
cracked (and, thus, harder to schedule effectively). But seeing no regressions,
and feeling that it is generally easier to split instructions apart late than
it is to combine them late, this might be the better approach regardless.

In the future, we might want to integrate this functionality into LSR (but
currently LSR does not create new PHI nodes, so (for that and other reasons)
significant work would need to be done).

llvm-svn: 228328
2015-02-05 18:43:00 +00:00
Hal Finkel 65d1cbf9df [PowerPC] Generate pre-increment floating-point ld/st instructions
PowerPC supports pre-increment floating-point load/store instructions, both r+r
and r+i, and we had patterns for them, but they were not marked as legal. Mark
them as legal (and add a test case).

llvm-svn: 228327
2015-02-05 18:42:53 +00:00
Colin LeMahieu 27d50073b3 [Hexagon] Renaming A2_subri, A2_andir, A2_orir. Fixing formatting.
llvm-svn: 228326
2015-02-05 18:38:08 +00:00
Ahmed Bougacha e892d13d90 [CodeGen] Add hook/combine to form vector extloads, enabled on X86.
The combine that forms extloads used to be disabled on vector types,
because "None of the supported targets knows how to perform load and
sign extend on vectors in one instruction."

That's not entirely true, since at least SSE4.1 X86 knows how to do
those sextloads/zextloads (with PMOVS/ZX).
But there are several aspects to getting this right.
First, vector extloads are controlled by a profitability callback.
For instance, on ARM, several instructions have folded extload forms,
so it's not always beneficial to create an extload node (and trying to
match extloads is a whole 'nother can of worms).

The interesting optimization enables folding of s/zextloads to illegal
(splittable) vector types, expanding them into smaller legal extloads.

It's not ideal (it introduces some legalization-like behavior in the
combine) but it's better than the obvious alternative: form illegal
extloads, and later try to split them up.  If you do that, you might
generate extloads that can't be split up, but have a valid ext+load
expansion.  At vector-op legalization time, it's too late to generate
this kind of code, so you end up forced to scalarize. It's better to
just avoid creating egregiously illegal nodes.

This optimization is enabled unconditionally on X86.

Note that the splitting combine is happy with "custom" extloads. As
is, this bypasses the actual custom lowering, and just unrolls the
extload. But from what I've seen, this is still much better than the
current custom lowering, which does some kind of unrolling at the end
anyway (see for instance load_sext_4i8_to_4i64 on SSE2, and the added
FIXME).

Also note that the existing combine that forms extloads is now also
enabled on legal vectors.  This doesn't have a big effect on X86
(because sext+load is usually combined to sext_inreg+aextload).
On ARM it fires on some rare occasions; that's for a separate commit.

Differential Revision: http://reviews.llvm.org/D6904

llvm-svn: 228325
2015-02-05 18:31:02 +00:00
Andrew Trick 7fc4583eda X86 ABI fix for return values > 24 bytes.
The return value's address must be returned in %rax.
i.e. the callee needs to copy the sret argument (%rdi)
into the return value (%rax).

This probably won't manifest as a bug when the caller is LLVM-compiled
code. But it is an ABI guarantee and tools expect it.

llvm-svn: 228321
2015-02-05 18:09:05 +00:00
Colin LeMahieu f297dbed48 [Hexagon] Renaming A2_addi and formatting.
llvm-svn: 228318
2015-02-05 17:49:13 +00:00
Sanjay Patel 67667bcdc4 move fold comments to the corresponding fold; NFC
llvm-svn: 228317
2015-02-05 17:33:59 +00:00
Colin LeMahieu a66cf6f2df [Hexagon] Since decoding conflicts have been resolved, isCodeGenOnly = 0 by default and remove explicitly setting it.
llvm-svn: 228316
2015-02-05 17:32:17 +00:00
Hans Wennborg 8b4dbdf15d LowerSwitch: Use ConstantInt for CaseRange::{Low,High}
Case values are always ConstantInt. This allows us to remove
a bunch of casts. NFC.

llvm-svn: 228312
2015-02-05 16:58:10 +00:00
Hans Wennborg 8c82fbcb73 LowerSwitch: remove default args from CaseRange ctor; NFC
llvm-svn: 228311
2015-02-05 16:50:27 +00:00
Tom Stellard eea3f70432 R600/SI: Fix bug in TTI loop unrolling preferences
We should be setting UnrollingPreferences::MaxCount to MAX_UINT instead
of UnrollingPreferences::Count.

Count is a 'forced unrolling factor', while MaxCount sets an upper
limit to the unrolling factor.

Setting Count to MAX_UINT was causing the loop in the testcase to be
unrolled 15 times, when it only had a maximum of 4 iterations.

llvm-svn: 228303
2015-02-05 15:32:18 +00:00
Tom Stellard 0f29de78e6 R600/SI: Fix bug from insertion of llvm.SI.end.cf into loop headers
The llvm.SI.end.cf intrinsic is used to mark the end of if-then blocks,
if-then-else blocks, and loops.  It is responsible for updating the
exec mask to re-enable threads that had been masked during the preceding
control flow block.  For example:

s_mov_b64 exec, 0x3                 ; Initial exec mask
s_mov_b64 s[0:1], exec              ; Saved exec mask
v_cmpx_gt_u32 exec, s[2:3], v0, 0   ; llvm.SI.if
do_stuff()
s_or_b64 exec, exec, s[0:1]         ; llvm.SI.end.cf

The bug fixed by this patch was one where the llvm.SI.end.cf intrinsic
was being inserted into the header of loops.  This would happen when
an if block terminated in a loop header and we would end up with
code like this:

s_mov_b64 exec, 0x3                 ; Initial exec mask
s_mov_b64 s[0:1], exec              ; Saved exec mask
v_cmpx_gt_u32 exec, s[2:3], v0, 0   ; llvm.SI.if
do_stuff()

LOOP:                       ; Start of loop header
s_or_b64 exec, exec, s[0:1] ; llvm.SI.end.cf <-BUG: The exec mask has the
                              same value at the beginning of each loop
			      iteration.
do_stuff();
s_cbranch_execnz LOOP

The fix is to create a new basic block before the loop and insert the
llvm.SI.end.cf there.  This way the exec mask is restored before the
start of the loop instead of at the beginning of each iteration.

llvm-svn: 228302
2015-02-05 15:32:15 +00:00
Bill Schmidt 433b1c3aae [PowerPC] Implement the vclz instructions for PWR8
Patch by Kit Barton.

Add the vector count leading zeros instruction for byte, halfword,
word, and doubleword sizes.  This is a fairly straightforward addition
after the changes made for vpopcnt:

 1. Add the correct definitions for the various instructions in
    PPCInstrAltivec.td
 2. Make the CTLZ operation legal on vector types when using P8Altivec
    in PPCISelLowering.cpp 

Test Plan

Created new test case in test/CodeGen/PowerPC/vec_clz.ll to check the
instructions are being generated when the CTLZ operation is used in
LLVM.

Check the encoding and decoding in test/MC/PowerPC/ppc_encoding_vmx.s
and test/Disassembler/PowerPC/ppc_encoding_vmx.txt respectively.

llvm-svn: 228301
2015-02-05 15:24:47 +00:00
Rafael Espindola f8d662aa4b Add a FIXME.
Thanks to Eric for the suggestion.

llvm-svn: 228300
2015-02-05 14:57:47 +00:00
Aaron Ballman 94d4d33a38 Removing an unused variable warning I accidentally introduced with my last warning fix; NFC.
llvm-svn: 228295
2015-02-05 13:52:42 +00:00
Aaron Ballman 1b072b340b Silencing an MSVC warning about a switch statement with no cases; NFC.
llvm-svn: 228294
2015-02-05 13:40:04 +00:00
Bruno Cardoso Lopes ab9ae87623 [X86][MMX] Handle i32->mmx conversion using movd
Implement a BITCAST dag combine to transform i32->mmx conversion patterns
into a X86 specific node (MMX_MOVW2D) and guarantee that moves between
i32 and x86mmx are better handled, i.e., don't use store-load to do the
conversion..

llvm-svn: 228293
2015-02-05 13:23:07 +00:00
Bruno Cardoso Lopes e446aefcfe [X86][MMX] Move MMX DAG node to proper file
llvm-svn: 228291
2015-02-05 13:22:50 +00:00
Michael Kuperstein d2b6fdbc31 Teach isDereferenceablePointer() to look through bitcast constant expressions.
This fixes a LICM regression due to the new load+store pair canonicalization.

Differential Revision: http://reviews.llvm.org/D7411

llvm-svn: 228284
2015-02-05 09:15:37 +00:00
Craig Topper 0857a1da0c [X86] Add xrstors/xsavec/xsaves/clflushopt/clwb/pcommit instructions
llvm-svn: 228283
2015-02-05 08:51:06 +00:00
Craig Topper a898c2d737 [X86] Remove two feature flags that covered sets of instructions that have no patterns or intrinsics. Since we don't check feature flags in the assembler parser for any instruction sets, these flags don't provide any value. This frees up 2 of the fully utilized feature flags.
llvm-svn: 228282
2015-02-05 08:51:02 +00:00
Matt Arsenault abd271b4e8 R600/SI: Fix i64 truncate to i1
llvm-svn: 228273
2015-02-05 06:05:13 +00:00
Larisse Voufo bc9f12e7bc Disable enumeral mismatch warning when compiling llvm with gcc.
Tested with gcc 4.9.2.
Compiling with -Werror was producing:
.../llvm/lib/Target/X86/X86ISelLowering.cpp: In function 'llvm::SDValue lowerVectorShuffleAsBitMask(llvm::SDLoc, llvm::MVT, llvm::SDValue, llvm::SDValue, llvm::ArrayRef<int>, llvm::SelectionDAG&)':
.../llvm/lib/Target/X86/X86ISelLowering.cpp:7771:40: error: enumeral mismatch in conditional expression: 'llvm::X86ISD::NodeType' vs 'llvm::ISD::NodeType' [-Werror=enum-compare]
   V = DAG.getNode(VT.isFloatingPoint() ? X86ISD::FAND : ISD::AND, DL, VT, V,
                                        ^

llvm-svn: 228271
2015-02-05 04:54:51 +00:00
Michael Zolotukhin a9aadd2903 Implement new heuristic for complete loop unrolling.
Complete loop unrolling can make some loads constant, thus enabling a
lot of other optimizations. To catch such cases, we look for loads that
might become constants and estimate number of instructions that would be
simplified or become dead after substitution.

Example:
Suppose we have:
int a[] = {0, 1, 0};
v = 0;
for (i = 0; i < 3; i ++)
  v += b[i]*a[i];

If we completely unroll the loop, we would get:
v = b[0]*a[0] + b[1]*a[1] + b[2]*a[2]

Which then will be simplified to:
v = b[0]* 0 + b[1]* 1 + b[2]* 0

And finally:
v = b[1]

llvm-svn: 228265
2015-02-05 02:34:00 +00:00
Cameron Esfahani 17177d1e84 Value soft float calls as more expensive in the inliner.
Summary: When evaluating floating point instructions in the inliner, ask the TTI whether it is an expensive operation.  By default, it's not an expensive operation.  This keeps the default behavior the same as before.  The ARM TTI has been updated to return back TCC_Expensive for targets which don't have hardware floating point.

Reviewers: chandlerc, echristo

Reviewed By: echristo

Subscribers: t.p.northover, aemerson, llvm-commits

Differential Revision: http://reviews.llvm.org/D6936

llvm-svn: 228263
2015-02-05 02:09:33 +00:00
Reid Kleckner 9ccec06623 Try to fix the build in MCValue.cpp
llvm-svn: 228256
2015-02-05 01:23:14 +00:00
Sean Silva 32f24c49d2 Fixup.
Didn't see these calls in my release build locally when testing.

llvm-svn: 228254
2015-02-05 01:13:47 +00:00
Sean Silva 0e1fe184c8 [MC] Remove various unused MCAsmInfo parameters.
llvm-svn: 228244
2015-02-05 00:58:51 +00:00
Duncan P. N. Exon Smith 9c26d80c18 IR: Rename 'operator ==()' to 'isKeyOf()', NFC
`isKeyOf()` is a clearer name than overloading `operator==()`.

llvm-svn: 228242
2015-02-05 00:51:35 +00:00
Colin LeMahieu ceebe8659b [Hexagon] Deleting unused instructions and adding isCodeGenOnly to some defs.
llvm-svn: 228238
2015-02-05 00:10:16 +00:00
Colin LeMahieu 9cb9078ccf [Hexagon] Updating load extend to i64 patterns.
llvm-svn: 228237
2015-02-04 23:55:16 +00:00
Kostya Serebryany 92e0476c67 [fuzzer] add flag prefer_small_during_initial_shuffle, be a bit more verbose
llvm-svn: 228235
2015-02-04 23:42:42 +00:00
Colin LeMahieu 712d5c393b [Hexagon] Cleaning up i1 load and extension patterns.
llvm-svn: 228232
2015-02-04 23:27:48 +00:00
Colin LeMahieu 90a91bbf43 [Hexagon] Simplifying more load and store patterns and using new addressing patterns.
llvm-svn: 228231
2015-02-04 23:23:16 +00:00
Tom Stellard f6afc80cc0 R600/SI: Enable subreg liveness by default
llvm-svn: 228228
2015-02-04 23:14:18 +00:00
Colin LeMahieu ad13d4e8a6 [Hexagon] Simplifying some load and store patterns.
llvm-svn: 228227
2015-02-04 23:10:21 +00:00
Duncan P. N. Exon Smith 9c93dc6453 AsmParser: Split out LineField, NFC
Split out `LineField`, which restricts the legal line numbers.  This
will make it easier to be consistent between different node parsers.

llvm-svn: 228226
2015-02-04 22:59:18 +00:00
Colin LeMahieu 68292c96da [Hexagon] Converting absolute-address load patterns to use AddrGP.
llvm-svn: 228225
2015-02-04 22:54:51 +00:00
Colin LeMahieu 8bf5de10c3 [Hexagon] Converting atomic store/load to use AddrGP addressing.
llvm-svn: 228223
2015-02-04 22:40:36 +00:00
Colin LeMahieu 5149135369 [Hexagon] Simplifying some store patterns. Adding AddrGP addressing forms.
llvm-svn: 228220
2015-02-04 22:36:28 +00:00
Kostya Serebryany 33f866922a [fuzzer] add -runs=N to limit the number of runs per session. Also, make sure we do some mutations w/o cross over.
llvm-svn: 228214
2015-02-04 22:20:09 +00:00
Duncan P. N. Exon Smith 2f09c46f80 Fix GCC error caused by r228211
llvm-svn: 228213
2015-02-04 22:13:28 +00:00
Duncan P. N. Exon Smith 8af6cfcdb2 IR: Reduce boilerplate in DenseMapInfo overrides, NFC
Minimize the boilerplate required for the `MDNode` subclass
`DenseMapInfo<>` overrides in `LLVMContextImpl`.

llvm-svn: 228212
2015-02-04 22:08:30 +00:00
Duncan P. N. Exon Smith 077c0318dc AsmParser: Move MDField details to source file, NFC
Move all the types of `MDField` to an anonymous namespace in the source
file.  This also eliminates the duplication of `ParseMDField()`
declarations in the header for each new field type.

llvm-svn: 228211
2015-02-04 22:05:21 +00:00
Duncan P. N. Exon Smith fad631a90c AsmParser: Simplify assertion, NFC
llvm-svn: 228209
2015-02-04 22:02:18 +00:00
Duncan P. N. Exon Smith 7a968781a6 AsmParser: Remove dead code, NFC
This condition is checked in the generic `ParseMDField()`.

llvm-svn: 228208
2015-02-04 22:00:59 +00:00
Duncan P. N. Exon Smith 39b10c2cbb AsmParser: Simplify MDUnsignedField
We only need `uint64_t` for storage.

llvm-svn: 228205
2015-02-04 21:57:52 +00:00
Duncan P. N. Exon Smith 6b7b680efd IR: Initialize MDNode abbreviations en masse, NFC
llvm-svn: 228203
2015-02-04 21:54:12 +00:00
Duncan P. N. Exon Smith 104e402610 IR: Define MDNode uniquing sets automatically, NFC
llvm-svn: 228200
2015-02-04 21:46:12 +00:00
Rafael Espindola a092f17580 Don' try to make sections in comdats SHF_MERGE.
Parts of llvm were not expecting it and we wouldn't print
the entity size of the section.

Given what comdats are used for, having SHF_MERGE sections would be
just a small improvement, so just disable it for now.

Fixes pr22463.

llvm-svn: 228196
2015-02-04 21:27:24 +00:00
Tom Stellard 33e64c66ac R600/SI: Expand misaligned 16-bit memory accesses
llvm-svn: 228190
2015-02-04 20:49:52 +00:00
Tom Stellard c7e448c92e R600/SI: Make more store operations legal
v2i32, i32, trunc i32 to i16, and truc i32 to i8 stores are legal for
all address spaces.  We had marked them as custom in order to lower
them for the private address space, but this is no longer necessary.

This enables lowering of misaligned stores of these types in the
DAGLegalizer.

llvm-svn: 228189
2015-02-04 20:49:51 +00:00
Tom Stellard 096b8c1e6d R600: Don't promote i64 stores to v2i32 during DAG legalization
We take care of this during instruction selection now.  This
fixes a potential infinite loop when lowering misaligned stores.

llvm-svn: 228188
2015-02-04 20:49:49 +00:00
Tom Stellard 080209d573 StructurizeCFG: Remove obsolete fix for loop backedge detection
This is no longer needed now that we are using a reverse post-order
traversal.

llvm-svn: 228187
2015-02-04 20:49:47 +00:00
Tom Stellard 071ec90b68 StructurizeCFG: Use a reverse post-order traversal
We were previously doing a post-order traversal and operating on the
list in reverse, however this would occasionaly cause backedges for
loops to be visited before some of the other blocks in the loop.

We know use a reverse post-order traversal, which avoids this issue.

The reverse post-order traversal is not completely ideal, so we need
to manually fixup the list to ensure that inner loop backedges are
visited before outer loop backedges.

llvm-svn: 228186
2015-02-04 20:49:44 +00:00
Colin LeMahieu 987b0943c8 [Hexagon] Adding selection for GlobalAddress and converting [z/i]ext load patterns to make use of them.
llvm-svn: 228184
2015-02-04 20:38:01 +00:00
Duncan P. N. Exon Smith 920df5c1bb Utils: Resolve cycles under distinct MDNodes
Track unresolved nodes under distinct `MDNode`s during `MapMetadata()`,
and resolve them at the end.  Previously, these cycles wouldn't get
resolved.

llvm-svn: 228180
2015-02-04 19:44:34 +00:00