platform/upstream/llvm.git
7 years ago[DAGCombine] Make sext(setcc) combine respect getBooleanContents
Michael Kuperstein [Mon, 1 Aug 2016 19:39:49 +0000 (19:39 +0000)]
[DAGCombine] Make sext(setcc) combine respect getBooleanContents

We used to combine "sext(setcc x, y, cc) -> (select (setcc x, y, cc), -1, 0)"
Instead, we should combine to (select (setcc x, y, cc), T, 0) where the value
of T is 1 or -1, depending on the type of the setcc, and getBooleanContents()
for the type if it is not i1.

This fixes PR28504.

llvm-svn: 277371

7 years ago[Hexagon] Generate vector printing instructions
Ron Lieberman [Mon, 1 Aug 2016 19:36:39 +0000 (19:36 +0000)]
[Hexagon]  Generate vector printing instructions

llvm-svn: 277370

7 years ago[ELF/ARM] Add support for R_ARM_TARGET1 relocation.
Davide Italiano [Mon, 1 Aug 2016 19:28:13 +0000 (19:28 +0000)]
[ELF/ARM] Add support for R_ARM_TARGET1 relocation.

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

llvm-svn: 277369

7 years agolibc++: test lock-free atomic alignment
JF Bastien [Mon, 1 Aug 2016 19:27:08 +0000 (19:27 +0000)]
libc++: test lock-free atomic alignment

Summary:
libc++ implements std::atomic<_Tp> using __atomic_base<_Tp> with
`mutable _Atomic(_Tp) __a_`. That member must be suitably aligned on
relevant ISAs for instructions such as cmpxchg to work properly, but
this alignment isn't checked anywhere. __atomic_base's implementation
relies on _Atomic doing "the right thing" since it's under the
compiler's control, and only the compiler knows about lock-freedom and
instruction generation. This test makes sure that the compiler isn't
breaking libc++'s expectations.

I'm looking at a few odd things in the C++ standard, and will have a few
other fixes around this area in the future.

This requires building with `-DLIBCXX_HAS_ATOMIC_LIB=True`, the test
marks the dependency as REQUIRES and won't be run without.

Reviewers: cfe-commits

Subscribers: EricWF, mclow.lists

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

llvm-svn: 277368

7 years ago[codeview] Skip injected class names in nested record emission
Reid Kleckner [Mon, 1 Aug 2016 18:56:13 +0000 (18:56 +0000)]
[codeview] Skip injected class names in nested record emission

We were already trying to do this, but our check wasn't quite right.

Fixes PR28790

llvm-svn: 277367

7 years ago[CFLAA] Remove modref queries from CFLAA.
George Burgess IV [Mon, 1 Aug 2016 18:47:28 +0000 (18:47 +0000)]
[CFLAA] Remove modref queries from CFLAA.

As it turns out, modref queries are broken with CFLAA. Specifically,
the data source we were using for determining modref behaviors
explicitly ignores operations on non-pointer values. So, it wouldn't
note e.g. storing an i32 to an i32* (or loading an i64 from an i64*).
It also ignores external function calls, rather than acting
conservatively for them.

(N.B. These operations, where necessary, *are* tracked by CFLAA; we just
use a different mechanism to do so. Said mechanism is relatively
imprecise, so it's unlikely that we can provide reasonably good modref
answers with it as implemented.)

Patch by Jia Chen.

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

llvm-svn: 277366

7 years ago[AArch64] Add support for Samsung Exynos M2 (NFC).
Evandro Menezes [Mon, 1 Aug 2016 18:39:55 +0000 (18:39 +0000)]
[AArch64] Add support for Samsung Exynos M2 (NFC).

llvm-svn: 277365

7 years ago[AArch64] Add support for Samsung Exynos M2 (NFC).
Evandro Menezes [Mon, 1 Aug 2016 18:39:45 +0000 (18:39 +0000)]
[AArch64] Add support for Samsung Exynos M2 (NFC).

llvm-svn: 277364

7 years agoUse 'unsigned long' to match the APIs of the MS bitscan intrinsics
Reid Kleckner [Mon, 1 Aug 2016 18:39:27 +0000 (18:39 +0000)]
Use 'unsigned long' to match the APIs of the MS bitscan intrinsics

We were getting warnings about how 'uint32_t*' is different from
'unsigned long*' even though they are effectively the same on Windows.

llvm-svn: 277363

7 years ago[CFLAA] Make CFLAnders more conservative with new Values.
George Burgess IV [Mon, 1 Aug 2016 18:27:33 +0000 (18:27 +0000)]
[CFLAA] Make CFLAnders more conservative with new Values.

Currently, CFLAnders assumes that values it hasn't seen don't alias
anything. This patch fixes that. Given that the only way for this to
happen is to query AA, rely on specific transformations happening, then
query AA again (looking for a specific set of queries), lit testing is a
bit difficult. If someone really wants a test, I'm happy to add one.

Patch by Jia Chen.

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

llvm-svn: 277362

7 years agoIncluded test for r277360.
David Majnemer [Mon, 1 Aug 2016 18:07:19 +0000 (18:07 +0000)]
Included test for r277360.

llvm-svn: 277361

7 years ago[Verifier] Resume instructions can only be in functions w/ a personality
David Majnemer [Mon, 1 Aug 2016 18:06:34 +0000 (18:06 +0000)]
[Verifier] Resume instructions can only be in functions w/ a personality

This fixes PR28799.

llvm-svn: 277360

7 years ago[asan] Remove unused #include (NFC)
Vedant Kumar [Mon, 1 Aug 2016 18:02:56 +0000 (18:02 +0000)]
[asan] Remove unused #include (NFC)

llvm-svn: 277359

7 years agoReplace MachineInstr* with MachineInstr& in TargetInstrInfo, NFC
Krzysztof Parzyszek [Mon, 1 Aug 2016 17:55:48 +0000 (17:55 +0000)]
Replace MachineInstr* with MachineInstr& in TargetInstrInfo, NFC

There were a few cases introduced with the modulo scheduler.

llvm-svn: 277358

7 years agoImprove shared_ptr dtor performance
Ben Craig [Mon, 1 Aug 2016 17:51:26 +0000 (17:51 +0000)]
Improve shared_ptr dtor performance

If the last destruction is uncontended, skip the atomic store on
__shared_weak_owners_. This shifts some costs from normal
shared_ptr usage to weak_ptr uses.

https://reviews.llvm.org/D22470

llvm-svn: 277357

7 years ago[clang-rename] handle overridden functions correctly
Kirill Bobyrev [Mon, 1 Aug 2016 17:15:57 +0000 (17:15 +0000)]
[clang-rename] handle overridden functions correctly

1. Renaming overridden functions only works for two levels of "overriding
   hierarchy". clang-rename should recursively add overridden methods.
2. Make use of forEachOverridden AST Matcher.
3. Fix two tests.

Reviewers: alexfh

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

llvm-svn: 277356

7 years ago[Hexagon] Check for offset overflow when reserving scavenging slots
Krzysztof Parzyszek [Mon, 1 Aug 2016 17:15:30 +0000 (17:15 +0000)]
[Hexagon] Check for offset overflow when reserving scavenging slots

Scavenging slots were only reserved when pseudo-instruction expansion in
frame lowering created new virtual registers. It is possible to still
need a scavenging slot even if no virtual registers were created, in cases
where the stack is large enough to overflow instruction offsets.

llvm-svn: 277355

7 years ago[clang-rename] revert r276836
Kirill Bobyrev [Mon, 1 Aug 2016 16:48:33 +0000 (16:48 +0000)]
[clang-rename] revert r276836

Revert r276836, which resulted in tests passing regardless of the actual tool
replacements.

llvm-svn: 277354

7 years ago[Parse] Let declarations follow labels in -fms-extensions mode
David Majnemer [Mon, 1 Aug 2016 16:39:29 +0000 (16:39 +0000)]
[Parse] Let declarations follow labels in -fms-extensions mode

MSVC permits declarations in these places as conforming extension (it is
a constraint violation otherwise).

This fixes PR28782.

llvm-svn: 277352

7 years ago[lldb] Delete dead, infinitely-recursive code (NFC)
Vedant Kumar [Mon, 1 Aug 2016 16:37:42 +0000 (16:37 +0000)]
[lldb] Delete dead, infinitely-recursive code (NFC)

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

llvm-svn: 277351

7 years ago[lldb][tsan] Perform one map lookup instead of two (NFC)
Vedant Kumar [Mon, 1 Aug 2016 16:37:37 +0000 (16:37 +0000)]
[lldb][tsan] Perform one map lookup instead of two (NFC)

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

llvm-svn: 277350

7 years agoAdd removed inline-assembly-comment test from r277146
Nirav Dave [Mon, 1 Aug 2016 15:36:10 +0000 (15:36 +0000)]
Add removed inline-assembly-comment test from r277146

llvm-svn: 277349

7 years ago[mips][fastisel] Correct argument lowering for (f64, f64, i32) and similar.
Daniel Sanders [Mon, 1 Aug 2016 15:32:51 +0000 (15:32 +0000)]
[mips][fastisel] Correct argument lowering for (f64, f64, i32) and similar.

Summary:
Allocating an AFGR64 shadows two GPR32's instead of just one.

This fixes an LNT regression detected by our internal buildbots.

Reviewers: sdardis

Subscribers: dsanders, sdardis, llvm-commits

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

llvm-svn: 277348

7 years ago[lldb][tsan] Avoid a string copy (NFC)
Vedant Kumar [Mon, 1 Aug 2016 15:15:49 +0000 (15:15 +0000)]
[lldb][tsan] Avoid a string copy (NFC)

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

llvm-svn: 277347

7 years ago[lldb] Ignore various test artifacts (NFCI)
Vedant Kumar [Mon, 1 Aug 2016 15:15:46 +0000 (15:15 +0000)]
[lldb] Ignore various test artifacts (NFCI)

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

llvm-svn: 277346

7 years ago[compiler-rt] Fix various typos in asan dll [NFC]
Etienne Bergeron [Mon, 1 Aug 2016 15:08:12 +0000 (15:08 +0000)]
[compiler-rt] Fix various typos in asan dll [NFC]

llvm-svn: 277345

7 years ago[AMDGPU] refactor DS instruction definitions. NFC.
Valery Pykhtin [Mon, 1 Aug 2016 14:21:30 +0000 (14:21 +0000)]
[AMDGPU] refactor DS instruction definitions. NFC.

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

llvm-svn: 277344

7 years ago[LLVM][MIPS] Fix FPU Size Based on Dynamic FR.
Nitesh Jain [Mon, 1 Aug 2016 13:45:51 +0000 (13:45 +0000)]
[LLVM][MIPS] Fix FPU Size Based on Dynamic FR.

Reviewers: jingham, clayborg

Subscribers: jaydeep, bhushan, mohit.bhakkad, slthakur, lldb-commits, emaste, nemanjai, labath, sdardis

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

llvm-svn: 277343

7 years agoMake RecursiveASTVisitor visit lambda capture initialization expressions
Martin Bohme [Mon, 1 Aug 2016 12:15:46 +0000 (12:15 +0000)]
Make RecursiveASTVisitor visit lambda capture initialization expressions

Summary:
Lambda capture initializations are part of the explicit source code and
therefore should be visited by default but, so far, RecursiveASTVisitor does not
visit them.

This appears to be an oversight. Because the lambda body needs custom handling
(calling TraverseLambdaBody()), the DEF_TRAVERSE_STMT for LambdaExpr sets
ShouldVisitChildren to false but then neglects to visit the lambda capture
initializations. This patch adds code to visit the expressions associated with
lambda capture initializations.

Reviewers: klimek

Subscribers: cfe-commits

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

llvm-svn: 277342

7 years ago[X86] Use implicit masking of SHLD/SHRD shift double instructions
Simon Pilgrim [Mon, 1 Aug 2016 12:11:43 +0000 (12:11 +0000)]
[X86] Use implicit masking of SHLD/SHRD shift double instructions

Similar to the regular shift instructions, SHLD/SHRD only use the bottom bits of the shift value

llvm-svn: 277341

7 years ago[clang-tidy] remove trailing whitespaces and retab
Kirill Bobyrev [Mon, 1 Aug 2016 12:06:18 +0000 (12:06 +0000)]
[clang-tidy] remove trailing whitespaces and retab

llvm-svn: 277340

7 years ago[clang-tidy] Prepare modernize-loop-convert for upcoming changes in D22566
Martin Bohme [Mon, 1 Aug 2016 11:29:17 +0000 (11:29 +0000)]
[clang-tidy] Prepare modernize-loop-convert for upcoming changes in D22566

Summary:
D22566 will change RecursiveASTVisitor so that it descends into the initialization expressions for lambda captures.

modernize-loop-convert needs to be prepared for this so that it does not interpret these initialization expressions as invalid uses of the loop variable. The change has no ill effects without D22566 in place, i.e. the change does not depend on D22566.

Reviewers: klimek

Subscribers: cfe-commits

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

llvm-svn: 277339

7 years ago[analyzer] Fix execution permissions for the scan-build-py scripts.
Artem Dergachev [Mon, 1 Aug 2016 10:55:59 +0000 (10:55 +0000)]
[analyzer] Fix execution permissions for the scan-build-py scripts.

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

llvm-svn: 277338

7 years agoFixed test check ordering issue on windows buildbots
Simon Pilgrim [Mon, 1 Aug 2016 10:40:15 +0000 (10:40 +0000)]
Fixed test check ordering issue on windows buildbots

llvm-svn: 277337

7 years agoChanges related to new implementation of tooling::Replacements as class.
Eric Liu [Mon, 1 Aug 2016 10:16:39 +0000 (10:16 +0000)]
Changes related to new implementation of tooling::Replacements as class.

Summary: See http://reviews.llvm.org/D21748 for details.

Reviewers: djasper, klimek

Subscribers: cfe-commits

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

llvm-svn: 277336

7 years agoImplement tooling::Replacements as a class.
Eric Liu [Mon, 1 Aug 2016 10:16:37 +0000 (10:16 +0000)]
Implement tooling::Replacements as a class.

Summary:
- Implement clang::tooling::Replacements as a class to provide interfaces to
  control how replacements for a single file are combined and provide guarantee
  on the order of replacements being applied.
- tooling::Replacements only contains replacements for the same file now.
  Use std::map<std::string, tooling::Replacements> to represent multi-file
  replacements.
- Error handling for the interface change will be improved in followup patches.

Reviewers: djasper, klimek

Subscribers: cfe-commits

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

llvm-svn: 277335

7 years agoAllow .exe extension to ld to fix test with mingw.
Yaron Keren [Mon, 1 Aug 2016 10:14:54 +0000 (10:14 +0000)]
Allow .exe extension to ld to fix test with mingw.

llvm-svn: 277334

7 years agoFixed MSVC out of range shift warning
Simon Pilgrim [Mon, 1 Aug 2016 09:40:38 +0000 (09:40 +0000)]
Fixed MSVC out of range shift warning

llvm-svn: 277333

7 years ago[SimplifyCFG] Fix nasty RAUW bug from r277325
James Molloy [Mon, 1 Aug 2016 09:34:48 +0000 (09:34 +0000)]
[SimplifyCFG] Fix nasty RAUW bug from r277325

Using RAUW was wrong here; if we have a switch transform such as:
  18 -> 6 then
  6 -> 0

If we use RAUW, while performing the second transform the  *transformed* 6
from the first will be also replaced, so we end up with:
  18 -> 0
  6 -> 0

Found by clang stage2 bootstrap; testcase added.

llvm-svn: 277332

7 years ago[AArch64] Return the correct size for TLSDESC_CALLSEQ
Diana Picus [Mon, 1 Aug 2016 08:38:49 +0000 (08:38 +0000)]
[AArch64] Return the correct size for TLSDESC_CALLSEQ

The branch relaxation pass is computing the wrong offsets because it assumes
TLSDESC_CALLSEQ eats up 4 bytes, when in fact it is lowered to an instruction
sequence taking up 16 bytes. This can become a problem in huge files with lots
of TLS accesses, as it may slowly move branch targets out of the range computed
by the branch relaxation pass.

Fixes PR24234 https://llvm.org/bugs/show_bug.cgi?id=24234

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

llvm-svn: 277331

7 years ago[AVX-512] Fix a test missed in r277327.
Craig Topper [Mon, 1 Aug 2016 08:15:30 +0000 (08:15 +0000)]
[AVX-512] Fix a test missed in r277327.

llvm-svn: 277330

7 years ago[SimplifyCFG] Try and pacify buildbots after r277325
James Molloy [Mon, 1 Aug 2016 08:09:55 +0000 (08:09 +0000)]
[SimplifyCFG] Try and pacify buildbots after r277325

It looks like the two independent parts of the rotate operation (a lshr and shl) are being reordered on some bots. Add CHECK-DAGs to account for this.

llvm-svn: 277329

7 years agoscan-build: Add an option to show the description in the list of defect
Sylvestre Ledru [Mon, 1 Aug 2016 08:04:45 +0000 (08:04 +0000)]
scan-build: Add an option to show the description in the list of defect

Summary:
This patch adds an option //--show-description// to add the defect description to the list of defect. This helps to get a better understanding of the defect without opening the page.

For example, this is used for Firefox:
https://people.mozilla.org/~sledru/reports/fx-scan-build/

Reviewers: rizsotto.mailinglist, zaks.anna

Subscribers: cfe-commits

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

llvm-svn: 277328

7 years ago[AVX-512] Fix duplicate column in AVX512 execution dependency table that was preventi...
Craig Topper [Mon, 1 Aug 2016 07:55:33 +0000 (07:55 +0000)]
[AVX-512] Fix duplicate column in AVX512 execution dependency table that was preventing VMOVDQU32/VMOVDQA32 from being recognized. Fix a bug in the code that stops execution dependency fix from turning operations on 32-bit integer element types into operations on 64-bit integer element types.

llvm-svn: 277327

7 years ago[X86] Regenerate a test to pick up shuffle comments that were added at some point.
Craig Topper [Mon, 1 Aug 2016 07:55:24 +0000 (07:55 +0000)]
[X86] Regenerate a test to pick up shuffle comments that were added at some point.

llvm-svn: 277326

7 years ago[SimplifyCFG] Range reduce switches
James Molloy [Mon, 1 Aug 2016 07:45:11 +0000 (07:45 +0000)]
[SimplifyCFG] Range reduce switches

If a switch is sparse and all the cases (once sorted) are in arithmetic progression, we can extract the common factor out of the switch and create a dense switch. For example:

    switch (i) {
    case 5: ...
    case 9: ...
    case 13: ...
    case 17: ...
    }

can become:

    if ( (i - 5) % 4 ) goto default;
    switch ((i - 5) / 4) {
    case 0: ...
    case 1: ...
    case 2: ...
    case 3: ...
    }

or even better:

   switch ( ROTR(i - 5, 2) {
   case 0: ...
   case 1: ...
   case 2: ...
   case 3: ...
   }

The division and remainder operations could be costly so we only do this if the factor is a power of two, and emit a right-rotate instead of a divide/remainder sequence. Dense switches can be lowered significantly better than sparse switches and can even be transformed into lookup tables.

llvm-svn: 277325

7 years ago[asan] Reduce flakiness of heavy recovery mode tests.
Maxim Ostapenko [Mon, 1 Aug 2016 07:24:36 +0000 (07:24 +0000)]
[asan] Reduce flakiness of heavy recovery mode tests.

When we run halt_on_error-torture.cc with 10 threads and 20 iterations with halt_on_error=false:suppress_equal_pcs=false, we write 200 reports to 10.txt file and sometimes have collisions.
We have CHECK-COLLISION check that greps 'AddressSanitizer: nested bug in the same thread, aborting' message in 10.txt, but it doesn't contain this line.
If I don't redirect stderr > 10.txt 'AddressSanitizer: nested bug in the same thread, aborting' is printed to my screen as expected.
Same happens for halt_on_error_suppress_equal_pcs.cc and halt_on_error-torture.cc. This happens because of kernel bug: https://lkml.org/lkml/2014/2/17/324
Furtunately, we can fix these tests by implicitly setting O_APPEND for opened files (use >> instead of > for stderr redirection).

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

llvm-svn: 277324

7 years ago[mips] Clang generates unaligned offset for MSA instruction st.d
Hrvoje Varga [Mon, 1 Aug 2016 06:46:20 +0000 (06:46 +0000)]
[mips] Clang generates unaligned offset for MSA instruction st.d
Differential Revision: https://reviews.llvm.org/D19475

llvm-svn: 277323

7 years ago[AArch64] Register passes so they can be run by llc
Diana Picus [Mon, 1 Aug 2016 05:56:57 +0000 (05:56 +0000)]
[AArch64] Register passes so they can be run by llc

Initialize all AArch64-specific passes in the TargetMachine so they can be run
by llc. This can lead to conflicts in opt with some command line options that
share the same name as the pass, so I took this opportunity to do some cleanups:
* rename all relevant command line options from "aarch64-blah" to
  "aarch64-enable-blah" and update the tests accordingly
* run clang-format on their declarations
* move all these declarations to a common place (the TargetMachine) as opposed
  to having them scattered around (AArch64BranchRelaxation and
  AArch64AddressTypePromotion were the only offenders)

llvm-svn: 277322

7 years ago[AVX-512] Teach X86InstrInfo::getLargestLegalSuperClass to inflate to FR32X/FR64X...
Craig Topper [Mon, 1 Aug 2016 05:31:50 +0000 (05:31 +0000)]
[AVX-512] Teach X86InstrInfo::getLargestLegalSuperClass to inflate to FR32X/FR64X if AVX512 is supported and VR128X/VR256X if VLX is supported.

Had to update a stack folding test to clobber the other 16 registers since this now made them get used instead of spilling.

llvm-svn: 277321

7 years ago[AVX512] Replace scalar fp arithmetic intrinsics with native IR in an AVX512 test...
Craig Topper [Mon, 1 Aug 2016 04:29:16 +0000 (04:29 +0000)]
[AVX512] Replace scalar fp arithmetic intrinsics with native IR in an AVX512 test. The intrinsics aren't lowered to AVX512 instructions.

The intrinsics really should be removed and autoupgraded.

llvm-svn: 277320

7 years ago[AVX-512] Use FR32X/FR64X/VR128X/VR256X register classes in addRegisterClass if AVX51...
Craig Topper [Mon, 1 Aug 2016 04:29:13 +0000 (04:29 +0000)]
[AVX-512] Use FR32X/FR64X/VR128X/VR256X register classes in addRegisterClass if AVX512(for FR32X/FR64) or VLX(for VR128X/VR256) is supported. This is a minimal requirement to be able to allocate all 32 registers.

llvm-svn: 277319

7 years ago[X86] Move mask register handling into the main switch of getLoadStoreRegOpcode....
Craig Topper [Mon, 1 Aug 2016 04:29:11 +0000 (04:29 +0000)]
[X86] Move mask register handling into the main switch of getLoadStoreRegOpcode. No functional change intended.

llvm-svn: 277318

7 years agoRevert r277313 and r277314.
Sean Silva [Mon, 1 Aug 2016 04:16:09 +0000 (04:16 +0000)]
Revert r277313 and r277314.

They seem to trigger an LSan failure:
http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-fast/builds/15140/steps/check-llvm%20asan/logs/stdio

Revert "Add the tests for r277313"

This reverts commit r277314.

Revert "CodeExtractor : Add ability to preserve profile data."

This reverts commit r277313.

llvm-svn: 277317

7 years agoMove this test to x86-specific directory.
Sean Silva [Mon, 1 Aug 2016 03:22:05 +0000 (03:22 +0000)]
Move this test to x86-specific directory.

No bots have yelled yet, but this test references an x86 intrinsic.
Also, it invokes llc on x86 IR.

Fixup to r277315.

llvm-svn: 277316

7 years agoFix - CodeExtractor : Inherit Target Dependent Attributes from the parent function.
Sean Silva [Mon, 1 Aug 2016 03:15:32 +0000 (03:15 +0000)]
Fix - CodeExtractor : Inherit Target Dependent Attributes from the parent function.

When extracting a set of blocks make sure to inherit all of the target
dependent attributes to make sure that the function will be valid for
lowering. One example is the "target-features" attribute for x86, if the
extracted region has functionality that relies on a specific feature it
will fail to be lowered.
This also allows for extracted functions to be valid for inlining, at
least back into the parent function, as the target attributes are tested
when inlining for compatibility.

Patch by River Riddle!

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

llvm-svn: 277315

7 years agoAdd the tests for r277313
Sean Silva [Mon, 1 Aug 2016 03:04:34 +0000 (03:04 +0000)]
Add the tests for r277313

Forgot to `git add` them.

llvm-svn: 277314

7 years agoCodeExtractor : Add ability to preserve profile data.
Sean Silva [Mon, 1 Aug 2016 02:59:26 +0000 (02:59 +0000)]
CodeExtractor : Add ability to preserve profile data.

Added ability to estimate the entry count of the extracted function and
the branch probabilities of the exit branches.

Patch by River Riddle!

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

llvm-svn: 277313

7 years agoFix a bug in lit var def: remove extra space
Xinliang David Li [Mon, 1 Aug 2016 01:54:40 +0000 (01:54 +0000)]
Fix a bug in lit var def: remove extra space

llvm-svn: 277312

7 years ago[X86][SSE] Regenerate frem tests
Simon Pilgrim [Sun, 31 Jul 2016 21:59:23 +0000 (21:59 +0000)]
[X86][SSE] Regenerate frem tests

llvm-svn: 277311

7 years ago[X86][SSE] Regenerate fpext tests
Simon Pilgrim [Sun, 31 Jul 2016 21:55:33 +0000 (21:55 +0000)]
[X86][SSE] Regenerate fpext tests

llvm-svn: 277310

7 years agoFix the MemorySSA updating API to enable people to create memory accesses before...
Daniel Berlin [Sun, 31 Jul 2016 21:08:20 +0000 (21:08 +0000)]
Fix the MemorySSA updating API to enable people to create memory accesses before removing old ones

llvm-svn: 277309

7 years agoComment fixes to MemorySSA.h
Daniel Berlin [Sun, 31 Jul 2016 21:08:10 +0000 (21:08 +0000)]
Comment fixes to MemorySSA.h

llvm-svn: 277308

7 years agoAdd more gcc compatibility names to clang's cpuid.h
Dimitry Andric [Sun, 31 Jul 2016 20:23:23 +0000 (20:23 +0000)]
Add more gcc compatibility names to clang's cpuid.h

Summary:
Some cpuid bit defines are named slightly different from how gcc's
cpuid.h calls them.

Define a few more compatibility names to appease software built for gcc:

* `bit_PCLMUL`      alias of `bit_PCLMULQDQ`
* `bit_SSE4_1`      alias of `bit_SSE41`
* `bit_SSE4_2`      alias of `bit_SSE42`
* `bit_AES`         alias of `bit_AESNI`
* `bit_CMPXCHG8B`   alias of `bit_CX8`

While here, add the misssing 29th bit, `bit_F16C` (which is how gcc
calls this bit).

Reviewers: joerg, rsmith

Subscribers: bruno, cfe-commits

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

llvm-svn: 277307

7 years ago[X86] Simplify code for determing GR or FR reg classes by querying for super classes...
Craig Topper [Sun, 31 Jul 2016 20:20:08 +0000 (20:20 +0000)]
[X86] Simplify code for determing GR or FR reg classes by querying for super classes instead of manually listing individual classes.

llvm-svn: 277306

7 years ago[AVX512] Always use EVEX encodings for 128/256-bit move instructions in getLoadStoreR...
Craig Topper [Sun, 31 Jul 2016 20:20:05 +0000 (20:20 +0000)]
[AVX512] Always use EVEX encodings for 128/256-bit move instructions in getLoadStoreRegOpcode if VLX is supported.

llvm-svn: 277305

7 years ago[AVX512] Add VLX packed move instructions to the execution dependency fix pass and...
Craig Topper [Sun, 31 Jul 2016 20:20:01 +0000 (20:20 +0000)]
[AVX512] Add VLX packed move instructions to the execution dependency fix pass and update tests.

llvm-svn: 277304

7 years ago[AVX512] Move FR32X/FR64X handling in getLoadStoreRegOpcode into the main switch...
Craig Topper [Sun, 31 Jul 2016 20:19:55 +0000 (20:19 +0000)]
[AVX512] Move FR32X/FR64X handling in getLoadStoreRegOpcode into the main switch. No functional change intended.

llvm-svn: 277303

7 years ago[AVX512] Stop treating VR512 specially in getLoadStoreRegOpcode and use the regular...
Craig Topper [Sun, 31 Jul 2016 20:19:53 +0000 (20:19 +0000)]
[AVX512] Stop treating VR512 specially in getLoadStoreRegOpcode and use the regular switch which already tried to handle it, but was unreachable. This has the added benefit of enabling aligned loads/stores if the stack is aligned.

llvm-svn: 277302

7 years ago[AVX512] Add X86::VR512RegClassID to X86RegisterInfo::getLargestLegalSuperClass.
Craig Topper [Sun, 31 Jul 2016 20:19:50 +0000 (20:19 +0000)]
[AVX512] Add X86::VR512RegClassID to X86RegisterInfo::getLargestLegalSuperClass.

llvm-svn: 277301

7 years agoFix ASan alloca_constant_size.cc test on FreeBSD.
Dimitry Andric [Sun, 31 Jul 2016 20:16:59 +0000 (20:16 +0000)]
Fix ASan alloca_constant_size.cc test on FreeBSD.

On FreeBSD <alloca.h> does not exist: alloca(3) is defined in <stdlib.h>
instead.

llvm-svn: 277300

7 years ago[X86] Improve 64-bit shifts on 32-bit targets (PR14593)
Simon Pilgrim [Sun, 31 Jul 2016 19:50:45 +0000 (19:50 +0000)]
[X86] Improve 64-bit shifts on 32-bit targets (PR14593)

As discussed on PR14593, this patch adds support for lowering to SHLD/SHRD from the patterns generated by DAGTypeLegalizer::ExpandShiftWithKnownAmountBit.

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

llvm-svn: 277299

7 years ago[COFF] Expose iterators for ImportAddressTableRVA
David Majnemer [Sun, 31 Jul 2016 19:40:02 +0000 (19:40 +0000)]
[COFF] Expose iterators for ImportAddressTableRVA

Patch by Bandzi Michal!

llvm-svn: 277298

7 years agoXFAIL one sanitizer symbolizer test for FreeBSD
Dimitry Andric [Sun, 31 Jul 2016 19:27:46 +0000 (19:27 +0000)]
XFAIL one sanitizer symbolizer test for FreeBSD

Summary:
Due to a QoI issuse in FreeBSD's libcxxrt-based demangler, one sanitizer
symbolizer test consistently appears to fail:

    Value of: DemangleSwiftAndCXX("foo")
      Actual: "float"
    Expected: "foo"

This is because libcxxrt's __cxa_demangle() incorrectly demangles the "foo"
identifier to "float".  It should return an error instead.

For now, XFAIL this particular test for FreeBSD, until we can fix libcxxrt
properly (which might take some time to coordinate with upstream).

Reviewers: rnk, zaks.anna, emaste

Subscribers: emaste, llvm-commits, kubabrecka

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

llvm-svn: 277297

7 years ago[COFF] Remove a duplicate import_directory_table_entry definition
David Majnemer [Sun, 31 Jul 2016 19:25:21 +0000 (19:25 +0000)]
[COFF] Remove a duplicate import_directory_table_entry definition

We had import_directory_table_entry and
coff_import_directory_table_entry, remove one.  Also, factor out the
logic which determins if a descriptor is a terminator.

llvm-svn: 277296

7 years ago[bugpoint] Add a -Os option
David Majnemer [Sun, 31 Jul 2016 19:25:16 +0000 (19:25 +0000)]
[bugpoint] Add a -Os option

llvm-svn: 277295

7 years ago[compiler-rt] Add support for interception redirect exports.
Etienne Bergeron [Sun, 31 Jul 2016 17:56:26 +0000 (17:56 +0000)]
[compiler-rt] Add support for interception redirect exports.

Summary:
On windows, an export can be redirected to an other DLL.
This patch is adding the required support to the internal
GetProcAddress implementation.

This case was encountered by instrumenting chromium (win 64-bits)
using this GN configuration:
```
is_component_build = true
is_debug = false
enable_nacl = false
is_clang = true
is_asan = true
clang_base_path = "d:\src\llvm\ninja64"
clang_use_chrome_plugins = false
clang_version = "4.0.0"
```

The operating system is win7 (x64).
Visual Studio: 2015 Professional

Reviewers: rnk

Subscribers: llvm-commits, chrisha

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

llvm-svn: 277294

7 years ago[X86] Add tests for the lowering SHLD/SHRD from manual pattern similar to those gener...
Simon Pilgrim [Sun, 31 Jul 2016 17:51:37 +0000 (17:51 +0000)]
[X86] Add tests for the lowering SHLD/SHRD from manual pattern similar to those generated by ExpandShiftWithKnownAmountBit

Test for add(v,v) as well as shl(v,1)

llvm-svn: 277293

7 years ago[AVX-512] Don't let ExeDependencyFix pass convert VPANDD/Q to VPANDPS/PD unless DQI...
Craig Topper [Sun, 31 Jul 2016 17:15:07 +0000 (17:15 +0000)]
[AVX-512] Don't let ExeDependencyFix pass convert VPANDD/Q to VPANDPS/PD unless DQI instructions are supported. Same for ANDN, OR, and XOR.

Thanks to Igor Breger for pointing out my mistake.

llvm-svn: 277292

7 years ago[X86] Add tests for the lowering SHLD/SHRD from manual patterns
Simon Pilgrim [Sun, 31 Jul 2016 17:11:49 +0000 (17:11 +0000)]
[X86] Add tests for the lowering SHLD/SHRD from manual patterns

As discussed on D23000

llvm-svn: 277291

7 years agoFixed "copy-paste" mistake from revision 255245.
Amjad Aboud [Sun, 31 Jul 2016 14:41:50 +0000 (14:41 +0000)]
Fixed "copy-paste" mistake from revision 255245.

llvm-svn: 277290

8 years agoAVX-512: Removed AssertZext node before TRUNCATE
Elena Demikhovsky [Sun, 31 Jul 2016 06:48:01 +0000 (06:48 +0000)]
AVX-512: Removed AssertZext node before TRUNCATE
Removed AssertZext node, which was inserted between X86ISD::SETCC and "truncate to i1".

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

llvm-svn: 277289

8 years ago[ADT] Add 'consume_front' and 'consume_back' methods to StringRef which
Chandler Carruth [Sun, 31 Jul 2016 02:19:13 +0000 (02:19 +0000)]
[ADT] Add 'consume_front' and 'consume_back' methods to StringRef which
are very handy when parsing text.

They are essentially a combination of startswith and a self-modifying
drop_front, or endswith and drop_back respectively.

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

llvm-svn: 277288

8 years ago[NFC] Rearrange an example-file so the c++14 specific example is on top.
Faisal Vali [Sun, 31 Jul 2016 01:19:17 +0000 (01:19 +0000)]
[NFC] Rearrange an example-file so the c++14 specific example is on top.

This makes it easier to add C++1z examples to the bottom, just before the #endif.

llvm-svn: 277287

8 years agoReapply r276069 with workaround for MSVC 2013
Hubert Tong [Sat, 30 Jul 2016 22:33:34 +0000 (22:33 +0000)]
Reapply r276069 with workaround for MSVC 2013

llvm-svn: 277286

8 years ago[HexagonConstPropagation] Remove dead code.
Davide Italiano [Sat, 30 Jul 2016 22:07:21 +0000 (22:07 +0000)]
[HexagonConstPropagation] Remove dead code.

llvm-svn: 277285

8 years ago[HexagonBitSimplify] Remove dead code.
Davide Italiano [Sat, 30 Jul 2016 22:07:18 +0000 (22:07 +0000)]
[HexagonBitSimplify] Remove dead code.

llvm-svn: 277284

8 years ago[ARMConstantIslandPass] Remove dead code.
Davide Italiano [Sat, 30 Jul 2016 22:07:15 +0000 (22:07 +0000)]
[ARMConstantIslandPass] Remove dead code.

llvm-svn: 277283

8 years ago[Support] Add doxygen @code tags to example code in Error comments.
Lang Hames [Sat, 30 Jul 2016 21:34:04 +0000 (21:34 +0000)]
[Support] Add doxygen @code tags to example code in Error comments.

llvm-svn: 277282

8 years ago[SLPVectorizer][X86] Added vXi8/vXi16 sitofp/uitofp tests
Simon Pilgrim [Sat, 30 Jul 2016 21:01:34 +0000 (21:01 +0000)]
[SLPVectorizer][X86] Added vXi8/vXi16 sitofp/uitofp tests

Dropped useless 2i32-2f32 test

llvm-svn: 277281

8 years agoStrip trailing whitespace
Simon Pilgrim [Sat, 30 Jul 2016 20:53:21 +0000 (20:53 +0000)]
Strip trailing whitespace

llvm-svn: 277280

8 years ago[X86] Use peekThroughOneUseBitcasts helper function
Simon Pilgrim [Sat, 30 Jul 2016 20:51:26 +0000 (20:51 +0000)]
[X86] Use peekThroughOneUseBitcasts helper function

llvm-svn: 277279

8 years ago[X86][SSE] Regenerate vshift tests
Simon Pilgrim [Sat, 30 Jul 2016 20:28:02 +0000 (20:28 +0000)]
[X86][SSE] Regenerate vshift tests

llvm-svn: 277278

8 years agoCorrecting some sphinx formatting issues so that the attribute documentation builds...
Aaron Ballman [Sat, 30 Jul 2016 20:20:03 +0000 (20:20 +0000)]
Correcting some sphinx formatting issues so that the attribute documentation builds again.

llvm-svn: 277277

8 years ago[Profile] Add a new test case
Xinliang David Li [Sat, 30 Jul 2016 20:12:00 +0000 (20:12 +0000)]
[Profile] Add a new test case

The end-end test checks that cs-profile counter update
is obtained as expected.

llvm-svn: 277276

8 years ago[SLPVectorizer][X86] Added SITOFP/UITOFP vectorization tests
Simon Pilgrim [Sat, 30 Jul 2016 18:43:30 +0000 (18:43 +0000)]
[SLPVectorizer][X86] Added SITOFP/UITOFP vectorization tests

llvm-svn: 277275

8 years ago[X86][AVX] Added signum example test functions from PR13248
Simon Pilgrim [Sat, 30 Jul 2016 16:29:19 +0000 (16:29 +0000)]
[X86][AVX] Added signum example test functions from PR13248

These are good examples of missed combine opportunities with zero/all bit vector compare results

llvm-svn: 277274

8 years ago[analyzer] Update APIs taking user-facing strings.
Devin Coughlin [Sat, 30 Jul 2016 16:16:51 +0000 (16:16 +0000)]
[analyzer] Update APIs taking user-facing strings.

Add new APIs that require localized strings and remove two APIs that were
incorrectly marked as requiring a user-facing string.

A patch by Kulpreet Chilana!

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

llvm-svn: 277273

8 years ago[X86][X87] Add vector arithmetic tests for targets with sse disabled
Simon Pilgrim [Sat, 30 Jul 2016 16:01:30 +0000 (16:01 +0000)]
[X86][X87] Add vector arithmetic tests for targets with sse disabled

To make sure the X86_64 target isn't doing anything stupid

llvm-svn: 277272

8 years ago[X86][SSE] Let 64-bit targets use the fast 2i32-2f32 UINT_TO_FP conversion as well...
Simon Pilgrim [Sat, 30 Jul 2016 14:06:59 +0000 (14:06 +0000)]
[X86][SSE] Let 64-bit targets use the fast 2i32-2f32 UINT_TO_FP conversion as well as 32-bit

The 2i32-2i64 legalization means that we can use the slightly quicker double bits + fptrunc approach for the same results

llvm-svn: 277271