Commit Graph

118148 Commits

Author SHA1 Message Date
Colin LeMahieu
2ca8f0f5d6 [MC] Common symbols weren't being checked for redeclaration which allowed an assembly file to generate an assertion in setCommon(): !isCommon(). This change allows redeclaration as long as the size and alignment match exactly, otherwise report a fatal error.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239227 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-06 20:12:40 +00:00
Sanjoy Das
68081f41fa [LoopUnroll] Fix truncation bug in canUnrollCompletely.
Summary:
canUnrollCompletely takes `unsigned` values for `UnrolledCost` and
`RolledDynamicCost` but is passed in `uint64_t`s that are silently
truncated.  Because of this, when `UnrolledSize` is a large integer
that has a small remainder with UINT32_MAX, LLVM tries to completely
unroll loops with high trip counts.

Reviewers: mzolotukhin, chandlerc

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239218 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-06 05:24:10 +00:00
David Majnemer
e46e8af4d7 [CVP] Don't assume Constants of type i1 can be known to be true or false
CVP wants to analyze the condition operand of a select along an edge.
It succeeds in getting back a Constant but not a ConstantInt.  Instead,
it gets a ConstantExpr.  It then assumes that the Constant must be equal
to false because it isn't equal to true.

Instead, perform an additional comparison.

This fixes PR23752.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239217 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-06 04:56:51 +00:00
David Majnemer
b21b529990 [InstCombine] Don't miscompile select to poison
If we have (select a, b, c), it is sometimes valid to simplify this to a
single select operand.  However, doing so is only valid if the
computation doesn't inject poison into the computation.

It might be helpful to consider the following example:
  (select (icmp ne %i, INT_MAX), (add nsw %i, 1), INT_MIN)

The select is equivalent to (add %i, 1) but not (add nsw %i, 1).

Self hosting on x86_64 revealed that this occurs very, very rarely so
bailing out is hopefully pretty reasonable.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239215 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-06 02:30:43 +00:00
Rafael Espindola
dcb11d3206 Handle 16 bit PC relative relocations.
Fixes pr23771.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239214 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-06 02:29:56 +00:00
NAKAMURA Takumi
4fb638b527 TargetParser: Fix comments in enum(s) introduced in r239150. [-Wdocumentation]
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239211 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-06 01:41:35 +00:00
Craig Topper
d032911655 [TableGen] Change OpInit::getNumOperands and getOperand to use unsigned integers. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239210 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-06 01:34:04 +00:00
Craig Topper
32d99f93e4 [TableGen] Remove trailing whitespace, add space between 'if' and paren, other formatting fixes. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239209 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-06 01:34:01 +00:00
Craig Topper
8e29f136cf [TableGen] Remove unnecessary temporary. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239208 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-06 01:34:00 +00:00
Craig Topper
33d0763bd1 [TableGen] Fold variable declaration/initialization into if condition for a couple short lived variables. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239207 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-06 01:33:58 +00:00
Craig Topper
c052f54559 [TableGen] Remove unnecessary outer 'if' and merge it's conditions into the inner 'if's. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239206 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-06 01:33:55 +00:00
Craig Topper
77411bdfe3 [TableGen] Fold variable declarations with their assignments. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239205 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-06 00:44:45 +00:00
Craig Topper
02890a5cf3 [TableGen] Correct the documentation for 'foreach' in the Language Intro.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239204 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-06 00:44:42 +00:00
Frederic Riss
c7968ac7b5 [dsymutil] Fix misspelled CHECK line.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239200 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-05 23:46:18 +00:00
Frederic Riss
9ccf07fb89 [dsymutil] Add support for linking the debug_frame section.
Linking the debug frame section is actually very easy as we just have to
patch the start address in the FDE header and then copy the rest of the
FDE without even looking at it. The only small complexity comes from the
handling of the CIEs that we should unique across object file. This is
also really easy by using a StringMap keyed on the raw contents of the
CIE.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239198 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-05 23:06:11 +00:00
Akira Hatanaka
a37c524912 Move the code in TargetPassConfig::addPass that inserts machine printer pass to
the overloaded version of addPass which takes Pass*.

This change enables inserting the machine printer pass when the overloaded
version of addPass that takes Pass* is called to add a pass, instead of the
one which takes AnalysisID. I need this to prevent make-check tests from
failing when I commit another patch later.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239192 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-05 21:58:14 +00:00
Frederic Riss
7bef4c48d6 [dsymutil] Rename a variable to appease some bots.
Anyway having the type and the name of the member being the same
thing wasn't the wisest of the choices.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239190 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-05 21:21:57 +00:00
Frederic Riss
dfbf8971ca [dsymutil] Have the YAML deserialization rewrite the object address of symbols.
The main use of the YAML debug map format is for testing inside LLVM. If we have IR
files in the tests used to generate object files, then we obviously don't know the
addresses of the symbols inside the object files beforehand.

This change lets the YAML import lookup the addresses in the object files and rewrite
them. This will allow to have test that really don't need any binary input.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239189 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-05 21:12:07 +00:00
Frederic Riss
0f58c38ebd [dsymutil] Apply clang-format. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239186 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-05 20:27:07 +00:00
Frederic Riss
527bb619d1 [dsymutil] Out-line the YAML serialization code. NFC
It will get a bit bigger in an upcoming commit. No need to have all
of that in the header.

Also move parseYAMLDebugMap() to the same place as the serialization
code. This way it will be able to share a private Context object with
it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239185 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-05 20:27:04 +00:00
Renato Golin
b539fba9d7 Revert "[InstCombine] Rephrase fix to SimplifyWithOpReplaced"
This reverts commit r239141. This commit was an attempt to reintroduce
a previous patch that broke many self-hosting bots with clang timeouts,
but it still has slowdown issues, at least  on ARM, increasing the
compilation time (stage 2, clang's) by 5x.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239175 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-05 18:24:12 +00:00
Rafael Espindola
aa4466db93 Refactor padding writing into a helper function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239174 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-05 18:21:00 +00:00
Sanjoy Das
fffd691439 [InstCombine][NFC] Add a `break;` statement.
This change is NFC because both the ``break;`` and the fall through end
up returning immediately. However, this helps clarify intent and also
ensures correctness in case more ``case`` blocks are added later.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239172 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-05 18:04:46 +00:00
Sanjoy Das
46216f7f99 [InstCombine] Fix PR23751.
PR23751 was caused by a missing ``break;`` in r234388.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239171 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-05 18:04:42 +00:00
Peter Collingbourne
f5c04a9da7 Revert r238473, "Thumb2: Modify codegen for memcpy intrinsic to prefer LDM/STM."
as it caused miscompilations and assertion failures (PR23768,
http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20150601/280380.html).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239169 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-05 18:01:28 +00:00
Rafael Espindola
c1233a84b2 Save a map lookup. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239168 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-05 17:54:25 +00:00
Fiona Glaser
5a0d6b758c DAGCombiner: don't duplicate (fmul x, c) in visitFNEG if fneg is free
For targets with a free fneg, this fold is always a net loss if it
ends up duplicating the multiply, so definitely avoid it.

This might be true for some targets without a free fneg too, but
I'll leave that for future investigation.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239167 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-05 17:52:34 +00:00
Yaron Keren
485adcac20 Rangify more for loops in LegacyPassManager.cpp.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239166 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-05 17:48:47 +00:00
Duncan P. N. Exon Smith
cb66dc70e3 Remove stray semi-colon, NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239165 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-05 17:22:00 +00:00
Chandler Carruth
862b2ad204 [Unroll] Rework the naming and structure of the new unroll heuristics.
The new naming is (to me) much easier to understand. Here is a summary
of the new state of the world:

- '*Threshold' is the threshold for full unrolling. It is measured
  against the estimated unrolled cost as computed by getUserCost in TTI
  (or CodeMetrics, etc). We will exceed this threshold when unrolling
  loops where unrolling exposes a significant degree of simplification
  of the logic within the loop.
- '*PercentDynamicCostSavedThreshold' is the percentage of the loop's
  estimated dynamic execution cost which needs to be saved by unrolling
  to apply a discount to the estimated unrolled cost.
- '*DynamicCostSavingsDiscount' is the discount applied to the estimated
  unrolling cost when the dynamic savings are expected to be high.

When actually analyzing the loop, we now produce both an estimated
unrolled cost, and an estimated rolled cost. The rolled cost is notably
a dynamic estimate based on our analysis of the expected execution of
each iteration.

While we're still working to build up the infrastructure for making
these estimates, to me it is much more clear *how* to make them better
when they have reasonably descriptive names. For example, we may want to
apply estimated (from heuristics or profiles) dynamic execution weights
to the *dynamic* cost estimates. If we start doing that, we would also
need to track the static unrolled cost and the dynamic unrolled cost, as
only the latter could reasonably be weighted by profile information.

This patch is sadly not without functionality change for the new unroll
analysis logic. Buried in the heuristic management were several things
that surprised me. For example, we never subtracted the optimized
instruction count off when comparing against the unroll heursistics!
I don't know if this just got lost somewhere along the way or what, but
with the new accounting of things, this is much easier to keep track of
and we use the post-simplification cost estimate to compare to the
thresholds, and use the dynamic cost reduction ratio to select whether
we can exceed the baseline threshold.

The old values of these flags also don't necessarily make sense. My
impression is that none of these thresholds or discounts have been tuned
yet, and so they're just arbitrary placehold numbers. As such, I've not
bothered to adjust for the fact that this is now a discount and not
a tow-tier threshold model. We need to tune all these values once the
logic is ready to be enabled.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239164 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-05 17:01:43 +00:00
Frederic Riss
8a5883aabe [dsymutil] Handle the -oso-prepend-path option when the input is a YAML debug map
All the tests using a YAML debug map will need this.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239163 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-05 16:35:44 +00:00
Alexei Starovoitov
b6ebf678ac [bpf] rename triple names bpf_be -> bpfeb
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239162 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-05 16:11:14 +00:00
Colin LeMahieu
750b351b76 [Hexagon] Reapply r239097 with tests corrected for shuffling and duplexing.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239161 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-05 16:00:11 +00:00
Alexei Starovoitov
a8769fd4b2 Revert "Include BPF target in CMake builds."
This reverts commit r239035

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239159 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-05 15:32:38 +00:00
Benjamin Kramer
cdb8c729f2 [TargetParser] Properly attach functions of ARMTargetParser to the class
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239158 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-05 14:33:02 +00:00
Benjamin Kramer
474d2e0f05 [ARM] Make helper function static.
This one had a declaration but it differed from the definition so the
declaration was actually dead.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239157 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-05 14:32:54 +00:00
Yaron Keren
ed3a7f5f4c Rangify for loops in LegacyPassManager.cpp.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239155 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-05 14:15:07 +00:00
John Brawn
272d7fdf42 [ARM] Add support for -sp- FPUs and FPU none to TargetParser
These are added mainly for the benefit of clang, but this also means that they
are now allowed in .fpu directives and we emit the correct .fpu directive when
single-precision-only is used.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239151 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-05 13:31:19 +00:00
John Brawn
c1c9bc1df7 [ARM] Add knowledge of FPU subtarget features to TargetParser
Add getFPUFeatures to TargetParser, which gets the list of subtarget features
that are enabled/disabled for each FPU, and use it when handling the .fpu
directive.

No functional change in this commit, though clang will start behaving
differently once it starts using this.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239150 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-05 13:29:24 +00:00
Artyom Skrobov
b4435accd5 [ARMTargetParser] Follow-up for r239099: one case was missed
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239147 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-05 12:39:28 +00:00
Simon Pilgrim
841f3dbae8 [X86][AVX2] Added tests for v32i8 vector shifts
Currently still scalarized, but D9474 should remedy that.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239146 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-05 12:35:36 +00:00
Toma Tabacu
dbaee6dadd Revert "[mips] [IAS] Restore STI.FeatureBits in .set pop." (r239144).
This is breaking the Windows buildbots.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239145 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-05 12:19:27 +00:00
Toma Tabacu
b349e0f1f1 [mips] [IAS] Restore STI.FeatureBits in .set pop.
Summary:
Only restoring AvailableFeatures is not enough and will lead to buggy behaviour.
For example, if we have a feature enabled and we ".set pop", the next time we try
to ".set" that feature nothing will happen because the "!(STI.getFeatureBits()[Feature])"
check will be false, because we didn't restore STI.FeatureBits.

In order to fix this, we need to make MipsAssemblerOptions remember the STI.FeatureBits
instead of the AvailableFeatures and then regenerate AvailableFeatures each time we ".set pop".
This is because, AFAIK, there is no way to convert from AvailableFeatures back to STI.FeatureBits,
but the reverse is possible by using ComputeAvailableFeatures(STI.FeatureBits).

I also moved the updating of AssemblerOptions inside the "if" statement in
setFeatureBits() and clearFeatureBits(), as there is no reason to update if
nothing changes.

Reviewers: dsanders, mkuper

Reviewed By: dsanders

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239144 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-05 11:48:54 +00:00
David Majnemer
47dfcb7745 [LoopVectorize] Don't crash on zero-sized types in isInductionPHI
isInductionPHI wants to calculate the stride based on the pointee size.
However, this is not possible when the pointee is zero sized.

This fixes PR23763.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239143 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-05 10:52:40 +00:00
Andrea Di Biagio
406e5ea598 Simplify code; NFC.
Also, moved test cases from CodeGen/X86/fold-buildvector-bug.ll into
CodeGen/X86/buildvec-insertvec.ll and regenerated CHECK lines using
update_llc_test_checks.py.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239142 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-05 10:29:55 +00:00
David Majnemer
edbc0df974 [InstCombine] Rephrase fix to SimplifyWithOpReplaced
I don't have the IR which is causing the build bot breakage but I can
postulate as to why they are timing out:
1. SimplifyWithOpReplaced was stripping flags from the simplified value.
2. visitSelectInstWithICmp was overriding SimplifyWithOpReplaced because
   it's simplification wasn't correct.
3. InstCombine would revisit the add instruction and note that it can
   rederive the flags.
4. By modifying the value, we chose to revisit instructions which reuse
   the value.  One of the instructions is the original select, causing
   LLVM to never reach fixpoint.

Instead, strip the flags only when we are sure we are going to perform
the simplification.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239141 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-05 09:57:57 +00:00
Daniel Jasper
2a89c94df6 Revert "[InstCombine] Don't miscompile safe increment idiom"
This is breaking a lot of build bots and is causing very long-running
compiles (infinite loops)?

Likely, we shouldn't return nullptr?

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239139 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-05 09:31:20 +00:00
Simon Pilgrim
8beac08b74 [X86][SSE] Added tests for i8/i16 vector shifts
Currently still scalarized, but D9474 should remedy that.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239136 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-05 08:24:23 +00:00
Justin Bogner
0a64b6de98 InstrProf: Fix reading of consecutive 32 bit coverage maps
When we generate coverage data, we explicitly set each coverage map's
alignment to 8 (See InstrProfiling::lowerCoverageData), but when we
read the coverage data, we assume consecutive maps are exactly
adjacent. When we're dealing with 32 bit, maps can end on a 4 byte
boundary, causing us to think the padding is part of the next record.

Fix this by adjusting the buffer to an appropriately aligned address
between records.

This is pretty awkward to test, as it requires a binary with multiple
coverage maps to hit, so we'd need to check in multiple source files
and a binary blob as inputs.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239129 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-05 01:23:42 +00:00
Alexey Samsonov
85529a57b4 Revert "[Object, ELF] Fix segmentation fault in ELFFile::getSectionName()."
This reverts commit r239124.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239125 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-04 23:58:31 +00:00