139328 Commits

Author SHA1 Message Date
Matthew Simpson
e7491dd00b [LV] Use getScalarizationOverhead in memory instruction costs (NFC)
This patch refactors the cost estimation of scalarized loads and stores to
reuse getScalarizationOverhead for the cost of the extractelement and
insertelement instructions we might create. The existing code accounted for
this cost, but it was functionally equivalent to the helper function.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283364 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-05 19:11:54 +00:00
Sanjay Patel
5e827ba37b fix documentation comments; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283361 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-05 18:51:12 +00:00
Rafael Espindola
c55049e9d6 Allow the caller to pass in the hash.
If the caller already has the hash we don't have to compute it. This
will be used in lld.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283359 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-05 18:46:21 +00:00
Reid Kleckner
4c9fcf5a1c Improve DEBUG_VALUE assembly comments for spilled bitpieces
Previously we would give up when we saw the bitpiece DWARF expression
and print "[complex expression]" when actually we handled bitpiece
expressions outside the loop.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283355 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-05 18:36:02 +00:00
Matthew Simpson
a0848c8d1b [LV] Add helper function for predicated block probability (NFC)
The cost model has to estimate the probability of executing predicated blocks.
However, we currently always assume predicated blocks have a 50% chance of
executing (this value is hardcoded in several places throughout the code).
Since we always use the same value, this patch adds a helper function for
getting this uniform probability. The function simplifies some comments and
makes our assumptions more clear. In the future, we may want to extend this
with actual block probability information if it's available.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283354 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-05 18:30:36 +00:00
Simon Dardis
27b0f61456 [mips][ias] fix li macro when values are negated with ~
The integrated assembler evaluates the expressions such as ~0x80000000 to
0xffffffff7fffffff early in the parsing process. This patch adds compatibility
with gas so that li loads the expected value (0x7fffffff) in those cases. This
only occurs iff all the upper 32bits are set and maintains existing checks by
not truncating the result down to 32 bits if any of the the upper bits are not
set.

Reviewers: dsanders, zoran.jovanovic

Differential Review: https://reviews.llvm.org/D23399


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283353 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-05 18:26:19 +00:00
Matthew Simpson
1c0756957b [LV] Add isScalarWithPredication helper function (NFC)
This patch adds a single helper function for checking if an instruction will be
scalarized with predication. Such instructions include conditional stores and
instructions that may divide by zero. Existing checks have been updated to use
the new function.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283350 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-05 17:52:34 +00:00
Anna Zaks
92d577bd41 Revert "[asan] LLVM: Switch to using dynamic shadow offset on iOS"
This reverts commit abe77a118615cd90b0d7f127e4797096afa2b394.

Revert as these changes broke a Chromium buildbot.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283348 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-05 17:42:02 +00:00
Bjorn Pettersson
17676e0feb [DAG] Teach computeKnownBits and ComputeNumSignBits in SelectionDAG to look through EXTRACT_VECTOR_ELT.
Summary: Both computeKnownBits and ComputeNumSignBits can now do a simple
look-through of EXTRACT_VECTOR_ELT. It will compute the result based
on the known bits (or known sign bits) for the vector that the element
is extracted from.

Reviewers: bogner, tstellarAMD, mkuper

Subscribers: wdng, RKSimon, jyknight, llvm-commits, nhaehnle

Differential Revision: https://reviews.llvm.org/D25007

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283347 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-05 17:40:27 +00:00
Bjorn Pettersson
54f81efe2c Test commit permission. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283346 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-05 17:22:11 +00:00
Zachary Turner
e53904ebe7 Fix build due to comparison of std::pairs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283342 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-05 17:04:36 +00:00
Zachary Turner
5844b06a17 Add llvm::enumerate() range adapter.
This allows you to enumerate over a range using a range-based
for while the return type contains the index of the enumeration.

Differential revision: https://reviews.llvm.org/D25124

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283337 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-05 16:54:09 +00:00
Rafael Espindola
b53fb3cabe Don't pass null to memcpy. Should fix the asan bots.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283336 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-05 16:33:03 +00:00
Simon Dardis
e16f30e703 Recommit: "[mips] Add rsqrt, recip for MIPS"
Add rsqrt.[ds], recip.[ds] for MIPS. Correct the microMIPS definitions for
architecture support and register usage.

Reviewers: vkalintiris, zoran.jovanoic

Differential Review: https://reviews.llvm.org/D24499



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283334 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-05 16:11:01 +00:00
Hans Wennborg
8e07f287bb Revert r282920 "X86: Allow conditional tail calls in Win64 "leaf" functions (PR26302)"
This is suspected to cause a miscompile in Chromium. Reverting while
investigating.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283329 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-05 15:39:27 +00:00
Simon Dardis
20d3d702f5 Revert "[mips] Add rsqrt, recip for MIPS"
This reverts commit r282485 which contain two patches instead of
one.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283327 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-05 15:28:33 +00:00
Douglas Katzman
8bebbdc0d0 [X86] Don't randomly encode %rip where illegal
Differential Revision: https://reviews.llvm.org/D25112

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283326 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-05 15:23:35 +00:00
James Molloy
71beb002a1 [Thumb] Don't try and emit LDRH/LDRB from the constant pool
This is not a valid encoding - these instructions cannot do PC-relative addressing.

The underlying problem here is of whitelist in ARMISelDAGToDAG that unwraps ARMISD::Wrappers during addressing-mode selection. This didn't realise TargetConstantPool was actually possible, so didn't handle it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283323 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-05 14:52:13 +00:00
Douglas Katzman
471e2909de [X86] Fix some tests that didn't assert anything
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283322 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-05 14:46:14 +00:00
Oren Ben Simhon
83acfbfcaf Test commit permission
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283319 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-05 14:12:41 +00:00
Oren Ben Simhon
464fb841a0 Test commit permission
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283318 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-05 13:48:33 +00:00
Dylan McKay
3beccae0ab [AVR] Don't select 'MOVW' instructions when they are not supported
We have a subtarget feature which we were ignoring, which was causing us
to generate unsupported instructions for some older chips.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283317 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-05 13:38:29 +00:00
Dylan McKay
3d6fe50568 [AVR] Add AVRRegisterInfo::splitReg function
No tests are included just yet - this is used from the pseudo
instruction expander pass, which hasn't been pulled in-tree yet.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283316 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-05 13:27:30 +00:00
Krzysztof Parzyszek
c29dc70bea Fix machine operand traversal in ScheduleDAGInstrs::fixupKills
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283315 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-05 13:15:06 +00:00
Dylan McKay
27025b7f3c [AVR] Update return type of dynamic alloca pass
It was recently changed from 'const char*' to StringRef

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283312 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-05 12:32:24 +00:00
Dylan McKay
3aff1d4e47 [AVR] Add the AVR frame lowering code
Summary: This allows AVR to lower frames into assembly code.

Reviewers: arsenm, kparzysz

Subscribers: japaric, wdng, beanz, mgorny

Differential Revision: https://reviews.llvm.org/D25032

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283311 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-05 11:48:56 +00:00
Dylan McKay
83aed6980d [AVR] Split all of the AVR device definitions into a separate file
We have ~500 lines of subtarget feature definitions, they don't belong
in our main TableGen file.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283310 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-05 10:28:45 +00:00
Dylan McKay
fac3438f5e [AVR] Enable the instruction printer in the target definition
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283309 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-05 10:23:38 +00:00
Dylan McKay
59cb8c3411 [AVR] Add definitions for the ATTiny102 and ATtiny104 chips
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283308 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-05 10:20:33 +00:00
Mehdi Amini
f9bb6bcf37 Re-commit "Use StringRef in Support/Darf APIs (NFC)"
This reverts commit r283285 and re-commit r283275 with
a fix for format("%s", Str); where Str is a StringRef.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283298 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-05 05:59:29 +00:00
Dylan McKay
bad1f71e1f [AVR] Add the machine code backend
Summary:
This adds the AVR machine code backend (`AVRAsmBackend.cpp`). This will
allow us to generate machine code from assembled AVR instructions.

Reviewers: arsenm, kparzysz

Subscribers: modocache, japaric, wdng, beanz, mgorny

Differential Revision: https://reviews.llvm.org/D25029

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283297 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-05 05:30:19 +00:00
Dean Michael Berris
f6b865d41a [Support][CommandLine] Add cl::getRegisteredSubcommands()
This should allow users of the library to get a range to iterate through
all the subcommands that are registered to the global parser. This
allows users to define subcommands in libraries that self-register to
have dispatch done at a different stage (like main). It allows for
writing code like the following:

    for (auto *S : cl::getRegisteredSubcommands()) {
      if (*S) {
	// Dispatch on S->getName().
      }
    }

This change also contains tests that show this usage pattern.

Reviewers: zturner, dblaikie, echristo

Subscribers: llvm-commits, mehdi_amini

Differential Revision: https://reviews.llvm.org/D24489

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283296 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-05 05:20:08 +00:00
Mehdi Amini
6f45c30387 Blind attempt to fix windows build after r283290 - Use StringRef in StringSaver API (NFC)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283294 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-05 01:41:11 +00:00
Mehdi Amini
33a6ab06c9 Use StringRef in ARMConstantPool APIs (NFC)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283293 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-05 01:41:06 +00:00
Kyle Butt
d03fefcc5e Revert "Codegen: Tail-duplicate during placement."
This reverts commit 062ace9764953e9769142c1099281a345f9b6bdc.

Issue with loop info and block removal revealed by polly.
I have a fix for this issue already in another patch, I'll re-roll this
together with that fix, and a test case.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283292 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-05 01:39:29 +00:00
Mehdi Amini
bc4286d9e7 Use StringRef in FastISel API (NFC)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283291 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-05 01:37:29 +00:00
Mehdi Amini
1455db37f5 Use StringRef in StringSaver API (NFC)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283290 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-05 01:32:41 +00:00
Mehdi Amini
ba066c0ba6 Use StringRef in ARCRuntimeEntryPoints APIs (NFC)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283288 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-05 01:15:04 +00:00
Kostya Serebryany
d4d50f6f47 [libFuzzer] add ShrinkValueProfileTest, move code around, NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283286 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-05 01:09:40 +00:00
Mehdi Amini
ef350f2eb3 Revert "Re-commit "Use StringRef in Support/Darf APIs (NFC)""
One test seems randomly broken: DebugInfo/X86/gnu-public-names.ll

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283285 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-05 01:04:02 +00:00
Mehdi Amini
3eff5cdfd3 Use StringRef in MCSectionMachO (NFC)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283284 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-05 01:02:34 +00:00
Mehdi Amini
280c2a6355 Use StringRef in DarwinAsmParser (NFC)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283283 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-05 01:02:22 +00:00
Michael Zolotukhin
c95d4ff692 [LoopDistribute] Fix a typo in the pass name.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283282 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-05 00:44:52 +00:00
Mehdi Amini
a2df9c87e9 Re-commit "Use StringRef in Support/Darf APIs (NFC)"
This reverts commit r283278 and re-commit r283275 with
the update to fix the build on the LLDB side.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283281 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-05 00:37:18 +00:00
Kostya Serebryany
d277734b71 [libFuzzer] clear the corpus elements if they are evicted (i.e. smaller elements with proper coverage are found). Make sure we never try to mutate empty element. Print the corpus size in bytes in the status lines
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283279 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-05 00:25:17 +00:00
Mehdi Amini
c441cc0af2 Revert "Use StringRef in Support/Darf APIs (NFC)"
This reverts commit r283275, it broke LLDB Android debug server.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283278 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-05 00:21:14 +00:00
Mehdi Amini
e57a377e09 Use StringRef instead of raw pointers in ARMBuildAttrs (NFC)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283277 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-05 00:15:18 +00:00
Mehdi Amini
ba4c13cb88 Use StringRef in Support/Darf APIs (NFC)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283275 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-04 23:55:40 +00:00
Kyle Butt
062ace9764 Codegen: Tail-duplicate during placement.
The tail duplication pass uses an assumed layout when making duplication
decisions. This is fine, but passes up duplication opportunities that
may arise when blocks are outlined. Because we want the updated CFG to
affect subsequent placement decisions, this change must occur during
placement.

In order to achieve this goal, TailDuplicationPass is split into a
utility class, TailDuplicator, and the pass itself. The pass delegates
nearly everything to the TailDuplicator object, except for looping over
the blocks in a function. This allows the same code to be used for tail
duplication in both places.

This change, in concert with outlining optional branches, allows
triangle shaped code to perform much better, esepecially when the
taken/untaken branches are correlated, as it creates a second spine when
the tests are small enough.

Issue from previous rollback fixed, and a new test was added for that
case as well.

Differential revision: https://reviews.llvm.org/D18226

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283274 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-04 23:54:18 +00:00
Mehdi Amini
d0bf4476a9 Use StringRef in TableGen (NFC)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283273 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-04 23:47:33 +00:00