platform/upstream/llvm.git
9 years agoMade macros from modules be injected before our
Sean Callanan [Thu, 30 Apr 2015 21:49:58 +0000 (21:49 +0000)]
Made macros from modules be injected before our
global convenience expression prefix.  Also ensured
that if macros are defined by the modules we don't
try to redefine them.  Finally cleaned up a bit of
code while I was in there.

<rdar://problem/20756642>

llvm-svn: 236266

9 years agoFix -Wpessimizing-move warning by remove the call to std::move.
Richard Trieu [Thu, 30 Apr 2015 21:47:28 +0000 (21:47 +0000)]
Fix -Wpessimizing-move warning by remove the call to std::move.

llvm-svn: 236265

9 years agoInstrProf: Make sure coverage propagates out of foreach loops correctly
Justin Bogner [Thu, 30 Apr 2015 21:31:02 +0000 (21:31 +0000)]
InstrProf: Make sure coverage propagates out of foreach loops correctly

llvm-svn: 236264

9 years agoFix comment in test. NFC.
Andrea Di Biagio [Thu, 30 Apr 2015 21:22:28 +0000 (21:22 +0000)]
Fix comment in test. NFC.

llvm-svn: 236262

9 years agoReplace unreachable code with llvm_unreachable.
Rafael Espindola [Thu, 30 Apr 2015 21:20:06 +0000 (21:20 +0000)]
Replace unreachable code with llvm_unreachable.

llvm-svn: 236261

9 years agoDon't create a MCSectionData when we don't have to.
Rafael Espindola [Thu, 30 Apr 2015 21:10:06 +0000 (21:10 +0000)]
Don't create a MCSectionData when we don't have to.

llvm-svn: 236260

9 years agoRemove the NullLog class introduced in r236174.
Zachary Turner [Thu, 30 Apr 2015 21:03:37 +0000 (21:03 +0000)]
Remove the NullLog class introduced in r236174.

Based on list discussions, a different approach is desired for
reducing the visual impact of logging statements on the
readability of the code.  Another mechanism will be added in
a followup patch, but for now, since NullLog is unreferenced,
this patch just removes it.

This patch does *not* remove the other half of r236174, which was
to delete some dead code surrounding logging flags.

llvm-svn: 236259

9 years agoFix for PR23103. Correctly propagate the 'IsUndef' flag to the register operands...
Andrea Di Biagio [Thu, 30 Apr 2015 21:03:29 +0000 (21:03 +0000)]
Fix for PR23103. Correctly propagate the 'IsUndef' flag to the register operands of a commuted instruction.

Revision 220239 exposed a latent bug in method
'TargetInstrInfo::commuteInstruction'. When commuting the operands of a machine
instruction, method 'commuteInstruction' didn't correctly propagate the
'IsUndef' flag to the register operands of the new (commuted) instruction.

Before this patch, the following instruction:
  %vreg4<def> = VADDSDrr  %vreg14, %vreg5<undef>; FR64:%vreg4,%vreg14,%vreg5

was wrongly converted by method 'commuteInstruction' into:
  %vreg4<def> = VADDSDrr  %vreg5, %vreg14<undef>; FR64:%vreg4,%vreg5,%vreg14

The correct instruction should have been:
  %vreg4<def> = VADDSDrr  %vreg5<undef>, %vreg14; FR64:%vreg4,%vreg5,%vreg14

This patch fixes the problem in method 'TargetInstrInfo::commuteInstruction'.
When swapping the operands of a machine instruction, we now make sure that
'IsUndef' flags are correctly set.
Added test case 'pr23103.ll'.

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

llvm-svn: 236258

9 years agoAvoid an extra loop over the sections.
Rafael Espindola [Thu, 30 Apr 2015 20:57:14 +0000 (20:57 +0000)]
Avoid an extra loop over the sections.

Add string to the section header string table as we add sections.

llvm-svn: 236257

9 years agoPR19691: initialize MacroDirective::DefInfo::IsPublic member in "invalid" state.
Richard Smith [Thu, 30 Apr 2015 20:53:28 +0000 (20:53 +0000)]
PR19691: initialize MacroDirective::DefInfo::IsPublic member in "invalid" state.

No functionality change; no-one inspects this field yet, and probably no-one
will ever inspect it in the "invalid" state, but ubsan could be unhappy about
this if such a DefInfo is copied.

llvm-svn: 236256

9 years agoMake the section table a member of ELFObjectWriter.
Rafael Espindola [Thu, 30 Apr 2015 20:53:27 +0000 (20:53 +0000)]
Make the section table a member of ELFObjectWriter.

This avoids passing it around and lets us build a small helper to add
a section to the table.

llvm-svn: 236255

9 years agoPR22354: Add a test that we emit copy-ctors for captures in generic lambdas.
Richard Smith [Thu, 30 Apr 2015 20:51:03 +0000 (20:51 +0000)]
PR22354: Add a test that we emit copy-ctors for captures in generic lambdas.

The bug was fixed by r235921.

llvm-svn: 236254

9 years agoNothing inherits from this, drop the protected:
Rafael Espindola [Thu, 30 Apr 2015 20:37:36 +0000 (20:37 +0000)]
Nothing inherits from this, drop the protected:

llvm-svn: 236253

9 years agoFor llvm-objdump, with the -archive-headers and -macho options, use the -non-verbose
Kevin Enderby [Thu, 30 Apr 2015 20:30:42 +0000 (20:30 +0000)]
For llvm-objdump, with the -archive-headers and -macho options, use the -non-verbose
option to print the archive headers using raw numeric values.  Also add the -archive-member-offsets
for use with these to also trigger printing of the offset of the archive member from the start
of the archive.

llvm-svn: 236252

9 years agoExhaustively test all triples in TripleTest.
Douglas Katzman [Thu, 30 Apr 2015 20:08:44 +0000 (20:08 +0000)]
Exhaustively test all triples in TripleTest.

Iteration over all permutations didn't really work,
due to evolution of the underlying enums.

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

llvm-svn: 236251

9 years agoMips: Remove dead declaration
Matt Arsenault [Thu, 30 Apr 2015 19:35:43 +0000 (19:35 +0000)]
Mips: Remove dead declaration

llvm-svn: 236250

9 years agoMachineVerifier: Don't crash if MachineOperand has no parent
Matt Arsenault [Thu, 30 Apr 2015 19:35:41 +0000 (19:35 +0000)]
MachineVerifier: Don't crash if MachineOperand has no parent

If you somehow added a MachineOperand to an instruction
that did not have the parent set, the verifier would
crash since it attempts to use the operand's parent.

llvm-svn: 236249

9 years agoDon't rewrite jumps to empty BBs to landing pads.
Pete Cooper [Thu, 30 Apr 2015 18:58:23 +0000 (18:58 +0000)]
Don't rewrite jumps to empty BBs to landing pads.

In the test case here, the 'unreachable' BB was removed by BranchFolding because its empty.

It then rewrote the jump from 'entry' to jump to its fallthrough, which was a landing pad.

This results in 'entry' jumping to 2 different landing pads, which fails the machine verifier.

rdar://problem/20750162

llvm-svn: 236248

9 years ago[ARM] Do not generate invalid encoding for stack adjust, even if this is just
Quentin Colombet [Thu, 30 Apr 2015 18:52:49 +0000 (18:52 +0000)]
[ARM] Do not generate invalid encoding for stack adjust, even if this is just
temporary.

Because of that:
1. The machine verifier was complaining on such code.
2. The generate code worked just because the thumb reduction size pass fixed the
opcode.

rdar://problem/20749824

llvm-svn: 236247

9 years agoFix the end location of init-capture annotations in ObjC++
Ben Langmuir [Thu, 30 Apr 2015 18:40:23 +0000 (18:40 +0000)]
Fix the end location of init-capture annotations in ObjC++

And thereby stop asserting.

In ObjC++ modes, we tentatively parse the lambda introducer twice: once
to disambiguate designators, which we also do in C++, and a second time
to disambiguate objc message expressions. During the second tentative
parse, the last cached token will be the annotation token we built in
the first parse. So use getLastLoc() to get the correct end location
for the rebuilt annotation.

llvm-svn: 236246

9 years agoAArch64: add BFC alias for the BFI/BFM instructions.
Tim Northover [Thu, 30 Apr 2015 18:28:58 +0000 (18:28 +0000)]
AArch64: add BFC alias for the BFI/BFM instructions.

Unlike 32-bit ARM, AArch64 can use wzr/xzr to implement this without the need
for a separate instruction.

rdar://18679590

llvm-svn: 236245

9 years agoAdd a note about permitting default member initializers
Reid Kleckner [Thu, 30 Apr 2015 18:17:12 +0000 (18:17 +0000)]
Add a note about permitting default member initializers

Use them in WinEHPrepare so that we can spot any toolchain bugs that
come up.

llvm-svn: 236244

9 years agoRemove some leftover debugging code.
David Majnemer [Thu, 30 Apr 2015 18:16:38 +0000 (18:16 +0000)]
Remove some leftover debugging code.

llvm-svn: 236243

9 years agoDon't warn about use of deprecated API when the containing context is unavailable.
Jordan Rose [Thu, 30 Apr 2015 17:20:35 +0000 (17:20 +0000)]
Don't warn about use of deprecated API when the containing context is unavailable.

This probably won't come up much, but it seems tidier.

Related to rdar://problem/20713550

llvm-svn: 236242

9 years agoBatch up access-related diagnostics on enum constants until the whole enum is parsed.
Jordan Rose [Thu, 30 Apr 2015 17:20:30 +0000 (17:20 +0000)]
Batch up access-related diagnostics on enum constants until the whole enum is parsed.

That way we can take any trailing availability attributes into account.

rdar://problem/20713550

llvm-svn: 236241

9 years agoReinstate revisions r234755, r234759, r234760
Jan Vesely [Thu, 30 Apr 2015 17:15:56 +0000 (17:15 +0000)]
Reinstate revisions r234755, r234759, r234760

changes:
  Don't apply on hexagon and NVPTX since they no longer claim to support UADDO/USUBO
  Add location to getConstant
  Drop comment about the ops being turned into expand

llvm-svn: 236240

9 years ago[MS ABI] Correctly make paths through covariant virtual bases
David Majnemer [Thu, 30 Apr 2015 17:15:48 +0000 (17:15 +0000)]
[MS ABI] Correctly make paths through covariant virtual bases

There can be multiple virtual bases which are on the path to a vfptr
when one vbase virtually inherits from another.  We should prefer the
most derived virtual base which covariantly overrides a method in the
vfptr class;  if we do not lengthen the path this way, we will end up
with too few vftable entries.

This fixes PR21073.

llvm-svn: 236239

9 years ago[AST] Fix some typos
David Majnemer [Thu, 30 Apr 2015 17:15:46 +0000 (17:15 +0000)]
[AST] Fix some typos

llvm-svn: 236238

9 years agoMove equality function for AliasAnalysis::Location from DenseMapInfo to Location...
Daniel Berlin [Thu, 30 Apr 2015 16:15:07 +0000 (16:15 +0000)]
Move equality function for AliasAnalysis::Location from DenseMapInfo to Location struct so it can be used in other types of maps

llvm-svn: 236237

9 years agoMark LWG#2387 as complete. No code changes needed
Marshall Clow [Thu, 30 Apr 2015 15:19:44 +0000 (15:19 +0000)]
Mark LWG#2387 as complete. No code changes needed

llvm-svn: 236236

9 years agoWrite sections mostly in one pass.
Rafael Espindola [Thu, 30 Apr 2015 14:21:49 +0000 (14:21 +0000)]
Write sections mostly in one pass.

During ELF writing, there is no need to further relax the sections, so we
should not be creating fragments. This patch avoids doing so in all cases
but debug section compression (that is next).

Also, the ELF format is fairly simple to write. We can do a single pass over
the sections to write them out and compute the section header table.

llvm-svn: 236235

9 years agoSilencing an "enumeral and non-enumeral type in conditional expression" warning;...
Aaron Ballman [Thu, 30 Apr 2015 14:03:12 +0000 (14:03 +0000)]
Silencing an "enumeral and non-enumeral type in conditional expression" warning; NFC.

llvm-svn: 236234

9 years agoDon't check for offsets in tests where it is not relevant.
Rafael Espindola [Thu, 30 Apr 2015 13:57:06 +0000 (13:57 +0000)]
Don't check for offsets in tests where it is not relevant.

llvm-svn: 236233

9 years agoFix private constructor for ScaledNumber.
Diego Novillo [Thu, 30 Apr 2015 13:22:48 +0000 (13:22 +0000)]
Fix private constructor for ScaledNumber.

Summary:
The private constructor for ScaledNumber was using uint64_t instead of
DigitsT. This was preventing instantiations of ScaledNumber with
anything other than uint64_t types.

In implementing the tests, I ran into another issue. Operators >>= and
<<= did not have variants for accepting other ScaledNumber as the shift
argument. This is expected by the SCALED_NUMBER_BOP.

It makes no sense to allow shifting a ScaledNumber by another
ScaledNumber, so the patch includes two new templates for shifting
ScaledNumbers.

Reviewers: dexonsmith

Subscribers: llvm-commits

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

llvm-svn: 236232

9 years agoFix Process::ResumeSynchronous which waits a process even in case of error
Ilia K [Thu, 30 Apr 2015 13:10:32 +0000 (13:10 +0000)]
Fix Process::ResumeSynchronous which waits a process even in case of error

llvm-svn: 236231

9 years agoCheck the entire content of the comdat group.
Rafael Espindola [Thu, 30 Apr 2015 13:08:09 +0000 (13:08 +0000)]
Check the entire content of the comdat group.

llvm-svn: 236230

9 years agoFix MiLibraryLoadedTestCase.test_lldbmi_library_loaded test on Linux (MI)
Ilia K [Thu, 30 Apr 2015 12:37:05 +0000 (12:37 +0000)]
Fix MiLibraryLoadedTestCase.test_lldbmi_library_loaded test on Linux (MI)

llvm-svn: 236229

9 years agoUse \d+ pattern instead of hard-coded line number in MiBreakTestCase (MI)
Ilia K [Thu, 30 Apr 2015 12:28:26 +0000 (12:28 +0000)]
Use \d+ pattern instead of hard-coded line number in MiBreakTestCase (MI)

llvm-svn: 236228

9 years agoFix typo in comment. NFC.
Diego Novillo [Thu, 30 Apr 2015 12:27:51 +0000 (12:27 +0000)]
Fix typo in comment. NFC.

llvm-svn: 236227

9 years agoEnabling two watchpoint tests on linux
Pavel Labath [Thu, 30 Apr 2015 11:28:06 +0000 (11:28 +0000)]
Enabling two watchpoint tests on linux

After recent changes, these tests should be stable. Please let me know if you still see failures.

llvm-svn: 236226

9 years agoRework =shlibs-added/=shlibs-removed
Ilia K [Thu, 30 Apr 2015 11:08:31 +0000 (11:08 +0000)]
Rework =shlibs-added/=shlibs-removed

Summary:
This patch includes the following:
* Rename =shlibs-added/=shlibs-removed to standard =library-loaded/=library-unloaded
* Remove redundant fields
* Add extra symbols-loaded/symbols-path and loaded_addr fields
* Rename CMICmnMIOutOfBandRecord::eOutOfBand_TargetModulesLoaded/eOutOfBand_TargetModulesUnloaded to CMICmnMIOutOfBandRecord::eOutOfBand_TargetModuleLoaded/eOutOfBand_TargetModuleUnloaded

Test Plan: ./dotest.py -v --executable $BUILDDIR/bin/lldb tools/lldb-mi/

Reviewers: jasonmolenda, jingham, abidh

Reviewed By: abidh

Subscribers: lldb-commits, jingham, jasonmolenda, abidh

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

llvm-svn: 236225

9 years agoAdd expectedFailureLinux to TestProcessAttach
Pavel Labath [Thu, 30 Apr 2015 11:00:15 +0000 (11:00 +0000)]
Add expectedFailureLinux to TestProcessAttach

The test is skipped anyway due to timeout, but adding XFAIL improves grepability.

llvm-svn: 236224

9 years ago[mips] Sorted instructions in mips64r6 disassembly tests. NFC.
Daniel Sanders [Thu, 30 Apr 2015 10:52:42 +0000 (10:52 +0000)]
[mips] Sorted instructions in mips64r6 disassembly tests. NFC.

llvm-svn: 236223

9 years agoFix typo in Core/Log
Pavel Labath [Thu, 30 Apr 2015 10:47:56 +0000 (10:47 +0000)]
Fix typo in Core/Log

llvm-svn: 236222

9 years ago[mips][mips64r6] Sorted instructions in test. NFC.
Daniel Sanders [Thu, 30 Apr 2015 10:23:48 +0000 (10:23 +0000)]
[mips][mips64r6] Sorted instructions in test. NFC.

llvm-svn: 236221

9 years ago[mips][msa] Rename main check prefix to 'ALL' in basic operations tests. NFC
Daniel Sanders [Thu, 30 Apr 2015 09:57:37 +0000 (09:57 +0000)]
[mips][msa] Rename main check prefix to 'ALL' in basic operations tests. NFC

Summary:
The majority of the checks are subtarget independent. The few that aren't
will be corrected shortly.

Reviewers: vkalintiris

Reviewed By: vkalintiris

Subscribers: llvm-commits

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

llvm-svn: 236220

9 years ago[mips][msa] Use CHECK-LABEL where missing, and remove checks matching the .size direc...
Daniel Sanders [Thu, 30 Apr 2015 09:56:30 +0000 (09:56 +0000)]
[mips][msa] Use CHECK-LABEL where missing, and remove checks matching the .size directive. NFC.

Summary:

Reviewers: vkalintiris

Reviewed By: vkalintiris

Subscribers: llvm-commits

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

llvm-svn: 236219

9 years agoAVX-512: Added AVX-512 intrinsics and tests
Elena Demikhovsky [Thu, 30 Apr 2015 09:24:29 +0000 (09:24 +0000)]
AVX-512: Added AVX-512 intrinsics and tests
by Asaf Badouh (asaf.badouh@intel.com)

llvm-svn: 236218

9 years agoclang-format: Don't merge short else blocks.
Daniel Jasper [Thu, 30 Apr 2015 09:24:17 +0000 (09:24 +0000)]
clang-format: Don't merge short else blocks.

Before (with the appropriate flags settings):
  if (a) {
    f();
  } else { g(); }

Before (with other appropriate flags settings):
  if (a) { f(); } else {
    g();
  }

After:
  if (a) {
    f();
  } else {
    g();
  }

llvm-svn: 236217

9 years ago[mips] Add missing signext attributes to MSA basic operations tests. NFC.
Daniel Sanders [Thu, 30 Apr 2015 09:24:09 +0000 (09:24 +0000)]
[mips] Add missing signext attributes to MSA basic operations tests. NFC.

Summary:
This doesn't make much difference to MIPS32, but it will simplify a
MIPS64r6 bugfix which will follow shortly by removing unnecessary
sign-extension of parameters.

Reviewers: vkalintiris

Reviewed By: vkalintiris

Subscribers: llvm-commits

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

llvm-svn: 236216

9 years agoAdd convenient overloads for CreateInsertElement and CreateExtractElement methods...
Pawel Bylica [Thu, 30 Apr 2015 09:01:22 +0000 (09:01 +0000)]
Add convenient overloads for CreateInsertElement and CreateExtractElement methods in IRBuilder

Summary:
This pathc add convenient overloads for CreateInsertElement and CreateExtractElement methods in IRBuilder
where vector index can be uint64_t instead of Value*.

Test Plan: Unit test included.

Reviewers: majnemer

Reviewed By: majnemer

Subscribers: majnemer, llvm-commits

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

llvm-svn: 236214

9 years agoSilence unused warning in non-assert builds.
Daniel Jasper [Thu, 30 Apr 2015 09:01:21 +0000 (09:01 +0000)]
Silence unused warning in non-assert builds.

llvm-svn: 236213

9 years agoInline local variable to silence unused warning.
Daniel Jasper [Thu, 30 Apr 2015 08:51:13 +0000 (08:51 +0000)]
Inline local variable to silence unused warning.

llvm-svn: 236212

9 years agoMasked gather and scatter - added DAGCombine visitors
Elena Demikhovsky [Thu, 30 Apr 2015 08:38:48 +0000 (08:38 +0000)]
Masked gather and scatter - added DAGCombine visitors
and AVX-512 instruction selection patterns.
All other patches, including tests will follow.

http://reviews.llvm.org/D7665

llvm-svn: 236211

9 years ago[OPENMP] Mark test as not compatible with MS Windows.
Alexey Bataev [Thu, 30 Apr 2015 08:35:10 +0000 (08:35 +0000)]
[OPENMP] Mark test as not compatible with MS Windows.

llvm-svn: 236210

9 years ago[SSE] Fix for MUL v16i8 on pre-SSE41 targets (PR23369).
Simon Pilgrim [Thu, 30 Apr 2015 08:23:16 +0000 (08:23 +0000)]
[SSE] Fix for MUL v16i8 on pre-SSE41 targets (PR23369).

Sign extension of i8 to i16 was placing the unpacked bytes in the lower byte instead of the upper byte.

llvm-svn: 236209

9 years agoAdd -data-info-line command (MI)
Ilia K [Thu, 30 Apr 2015 07:14:24 +0000 (07:14 +0000)]
Add -data-info-line command (MI)

Summary: Add -data-info-line command + test

Test Plan: ./dotest.py -v --executable $BUILDDIR/bin/lldb tools/lldb-mi/

Reviewers: abidh

Reviewed By: abidh

Subscribers: lldb-commits, abidh

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

llvm-svn: 236208

9 years ago[OPENMP] Codegen for 'private' clause in 'task' directive.
Alexey Bataev [Thu, 30 Apr 2015 06:51:57 +0000 (06:51 +0000)]
[OPENMP] Codegen for 'private' clause in 'task' directive.

For tasks codegen for private/firstprivate variables are different rather than for other directives.

1. Build an internal structure of privates for each private variable:
struct .kmp_privates_t. {
  Ty1 var1;
  ...
  Tyn varn;
};
2. Add a new field to kmp_task_t type with list of privates.
struct kmp_task_t {
  void *              shareds;
  kmp_routine_entry_t routine;
  kmp_int32           part_id;
  kmp_routine_entry_t destructors;
  .kmp_privates_t.    privates;
};
3. Create a function with destructors calls for all privates after end of task region.
kmp_int32 .omp_task_destructor.(kmp_int32 gtid, kmp_task_t *tt) {
  ~Destructor(&tt->privates.var1);
  ...
  ~Destructor(&tt->privates.varn);
  return 0;
}
4. Perform default initialization of all private fields (no initialization for POD data, default constructor calls for classes) + provide address of a destructor function after kmpc_omp_task_alloc() and before kmpc_omp_task() calls.
kmp_task_t *new_task = __kmpc_omp_task_alloc(ident_t *, kmp_int32 gtid, kmp_int32 flags, size_t sizeof_kmp_task_t, size_t sizeof_shareds, kmp_routine_entry_t *task_entry);

DefaultConstructor(new_task->privates.var1);
new_task->shareds.var1_ref = &new_task->privates.var1;
...
DefaultConstructor(new_task->privates.varn);
new_task->shareds.varn_ref = &new_task->privates.varn;

new_task->destructors = .omp_task_destructor.;
kmp_int32 __kmpc_omp_task(ident_t *, kmp_int32 gtid, kmp_task_t *new_task)

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

llvm-svn: 236207

9 years ago[TableGen] Cleanup formatting by moving operators from beginning of line to end of...
Craig Topper [Thu, 30 Apr 2015 05:54:22 +0000 (05:54 +0000)]
[TableGen] Cleanup formatting by moving operators from beginning of line to end of previous line. NFC

llvm-svn: 236206

9 years ago[TableGen] Used range-based for loop. NFC.
Craig Topper [Thu, 30 Apr 2015 05:54:20 +0000 (05:54 +0000)]
[TableGen] Used range-based for loop. NFC.

llvm-svn: 236205

9 years ago[TableGen] Merge a variable assignment and a return to drop curly braces. Fold an...
Craig Topper [Thu, 30 Apr 2015 05:12:52 +0000 (05:12 +0000)]
[TableGen] Merge a variable assignment and a return to drop curly braces. Fold an assignment into an if. Use auto on the result of a couple dyn_casts. NFC

llvm-svn: 236204

9 years ago[InstCombine] Add new rule for MIN(MAX(~A, ~B), ~C) et. al.
Sanjoy Das [Thu, 30 Apr 2015 04:56:04 +0000 (04:56 +0000)]
[InstCombine] Add new rule for MIN(MAX(~A, ~B), ~C) et. al.

Summary:
Optimizing these well are especially interesting for IRCE since it
"clamps" values by generating this sort of pattern through SCEV
expressions.

Depends on D9352.

Reviewers: majnemer

Subscribers: llvm-commits

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

llvm-svn: 236203

9 years ago[InstCombine] Add a new formula for SMIN.
Sanjoy Das [Thu, 30 Apr 2015 04:56:00 +0000 (04:56 +0000)]
[InstCombine] Add a new formula for SMIN.

Summary:
After this change `MatchSelectPattern` recognizes the following form
of SMIN:

  Y >s C ? ~Y : ~C == ~Y <s ~C ? ~Y : ~C = SMIN(~Y, ~C)

Reviewers: majnemer

Subscribers: llvm-commits

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

llvm-svn: 236202

9 years ago[OPENMP] Allow to use global variables as lcv in loop-based directives.
Alexey Bataev [Thu, 30 Apr 2015 04:23:23 +0000 (04:23 +0000)]
[OPENMP] Allow to use global variables as lcv in loop-based directives.

For proper codegen we need to capture variable in the OpenMP region. In loop-based directives loop control variables are private by default and they must be captured in this region. There was a problem with capturing of globals, used as lcv, as they was not marked as private by default.
Differential Revision: http://reviews.llvm.org/D9336

llvm-svn: 236201

9 years agoDon't overflow GCTable
Filipe Cabecinhas [Thu, 30 Apr 2015 04:09:41 +0000 (04:09 +0000)]
Don't overflow GCTable

Summary: Bug found with AFL fuzz.

Reviewers: rafael, dexonsmith

Subscribers: llvm-commits

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

llvm-svn: 236200

9 years agoSemantically revert r236031, which is not a good idea for in-order targets.
Owen Anderson [Thu, 30 Apr 2015 04:06:32 +0000 (04:06 +0000)]
Semantically revert r236031, which is not a good idea for in-order targets.

At the least it should be guarded by some kind of target hook.
It also introduced catastrophic compile time and code quality
regressions on some out of tree targets (test case still being
reduced/sanitized).

Sanjay agreed with reverting this patch until these issues can be
resolved.

llvm-svn: 236199

9 years ago[OPENMP] Fixed codegen for 'copyprivate' clause.
Alexey Bataev [Thu, 30 Apr 2015 03:47:32 +0000 (03:47 +0000)]
[OPENMP] Fixed codegen for 'copyprivate' clause.

Fixed initialization of 'single' region completion + changed type of the third argument of __kmpc_copyprivate() runtime function to size_t.

llvm-svn: 236198

9 years agoRemove dead code: a MacroDirective can't be imported or ambiguous any more.
Richard Smith [Thu, 30 Apr 2015 02:16:23 +0000 (02:16 +0000)]
Remove dead code: a MacroDirective can't be imported or ambiguous any more.

llvm-svn: 236197

9 years agoXFAIL test/CodeGen/Generic/MachineBranchProb.ll on Hexagon (PR23377)
Hans Wennborg [Thu, 30 Apr 2015 01:59:04 +0000 (01:59 +0000)]
XFAIL test/CodeGen/Generic/MachineBranchProb.ll on Hexagon (PR23377)

llvm-svn: 236196

9 years ago[UBSan] Make stacktrace-matching CHECK-lines in tests Linux-specific.
Alexey Samsonov [Thu, 30 Apr 2015 01:21:57 +0000 (01:21 +0000)]
[UBSan] Make stacktrace-matching CHECK-lines in tests Linux-specific.

Darwin doesn't yet allow to print stack trace, as it lacks the slow
unwinder. This is one more attempt to fix vptr.cpp on Mac OS X.

llvm-svn: 236195

9 years agoRemove XFAIL now that this test passes (fixed by r236184).
Richard Smith [Thu, 30 Apr 2015 01:15:19 +0000 (01:15 +0000)]
Remove XFAIL now that this test passes (fixed by r236184).

llvm-svn: 236194

9 years agoMake sure Op->getType() is a PointerType before we cast<> it.
Filipe Cabecinhas [Thu, 30 Apr 2015 01:13:31 +0000 (01:13 +0000)]
Make sure Op->getType() is a PointerType before we cast<> it.

Bug found with AFL fuzz.

llvm-svn: 236193

9 years agoSwitch lowering: use profile info to build weight-balanced binary search trees
Hans Wennborg [Thu, 30 Apr 2015 00:57:37 +0000 (00:57 +0000)]
Switch lowering: use profile info to build weight-balanced binary search trees

This will cause hot nodes to appear closer to the root.

The literature says building the tree like this makes it a near-optimal (in
terms of search time given key frequencies) binary search tree. In LLVM's case,
we can do up to 3 comparisons in each leaf node, so it might be better to opt
for lower tree height in some cases; that's something to look into in the
future.

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

llvm-svn: 236192

9 years agoFix use of uninitialized variable, found by ubsan selfhost.
Richard Smith [Thu, 30 Apr 2015 00:57:08 +0000 (00:57 +0000)]
Fix use of uninitialized variable, found by ubsan selfhost.

llvm-svn: 236191

9 years agoMake sure we don't resize(0) when we get a fwdref with Idx == UINT_MAX
Filipe Cabecinhas [Thu, 30 Apr 2015 00:52:42 +0000 (00:52 +0000)]
Make sure we don't resize(0) when we get a fwdref with Idx == UINT_MAX

Make it an error instead.

Bug found with AFL fuzz.

llvm-svn: 236190

9 years agoStore relocations in a map from MCSectionELF.
Rafael Espindola [Thu, 30 Apr 2015 00:45:46 +0000 (00:45 +0000)]
Store relocations in a map from MCSectionELF.

Saves finding the MCSectionData just to do a map lookup.

llvm-svn: 236189

9 years agoUse a more reliable method to determine whether
Sean Callanan [Thu, 30 Apr 2015 00:44:21 +0000 (00:44 +0000)]
Use a more reliable method to determine whether
a FileID corresponds to a real file or to a
memory buffer.  The old method didn't work when
Clang was built Release, which meant it wasn't
a very good method at all.

llvm-svn: 236188

9 years agoWrite relocations directly to the output stream. NFC.
Rafael Espindola [Thu, 30 Apr 2015 00:30:40 +0000 (00:30 +0000)]
Write relocations directly to the output stream. NFC.

llvm-svn: 236187

9 years agoFlip r236172 testcase RUN option ordering for BSD sed(1). NFC.
Ahmed Bougacha [Thu, 30 Apr 2015 00:07:34 +0000 (00:07 +0000)]
Flip r236172 testcase RUN option ordering for BSD sed(1). NFC.

llvm-svn: 236186

9 years agoAdd CMAKE_EXECUTABLE_SUFFIX to build with Android toolchain on Windows.
Chaoren Lin [Wed, 29 Apr 2015 23:59:22 +0000 (23:59 +0000)]
Add CMAKE_EXECUTABLE_SUFFIX to build with Android toolchain on Windows.

Reviewers: vharron, zturner, flackr

Subscribers: tberghammer, lldb-commits

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

llvm-svn: 236185

9 years agoUpdate clang/test/CodeGenCXX/copy-constructor-synthesis-2.cpp to pass for targeting...
NAKAMURA Takumi [Wed, 29 Apr 2015 23:55:46 +0000 (23:55 +0000)]
Update clang/test/CodeGenCXX/copy-constructor-synthesis-2.cpp to pass for targeting i686.

r236155 missed the suffix in "@llvm.memcpy.p0i8.p0i8.i32".

llvm-svn: 236184

9 years agoChange x86 CMOVE_F to read it source, not write it.
Pete Cooper [Wed, 29 Apr 2015 23:51:33 +0000 (23:51 +0000)]
Change x86 CMOVE_F to read it source, not write it.

This was breaking sqlite with the machine verifier because operand 0 was a def according to tablegen, but didn't have the 'isDef' flag set.

Looking at the ISA, its clear that this operand is a source as writing to st(0) is implicit.  So move the operand to the correct place in the td file.

rdar://problem/20751584

llvm-svn: 236183

9 years agoFix build after Clang API change in r236176.
Richard Smith [Wed, 29 Apr 2015 23:46:48 +0000 (23:46 +0000)]
Fix build after Clang API change in r236176.

llvm-svn: 236182

9 years agoAdd an assert to get information on buildbot failure.
Richard Smith [Wed, 29 Apr 2015 23:40:48 +0000 (23:40 +0000)]
Add an assert to get information on buildbot failure.

llvm-svn: 236181

9 years agoFix doxygen comment typo. NFC
Jonathan Roelofs [Wed, 29 Apr 2015 23:33:32 +0000 (23:33 +0000)]
Fix doxygen comment typo. NFC

llvm-svn: 236180

9 years agoPropagate a terrible hack to the sparc target feature handling code
Eric Christopher [Wed, 29 Apr 2015 23:32:17 +0000 (23:32 +0000)]
Propagate a terrible hack to the sparc target feature handling code
by erasing the soft-float target feature if the rest of the front
end added it because of defaults or the soft float option.

Add some testing for some of the targets that implement this hack.

llvm-svn: 236179

9 years agoFix unused variable warning.
Richard Smith [Wed, 29 Apr 2015 23:26:13 +0000 (23:26 +0000)]
Fix unused variable warning.

llvm-svn: 236178

9 years agoFix build broken by r236174.
Zachary Turner [Wed, 29 Apr 2015 23:24:12 +0000 (23:24 +0000)]
Fix build broken by r236174.

Apparently va_list is literally a char* on Windows.

llvm-svn: 236177

9 years ago[modules] Stop trying to fake up a linear MacroDirective history.
Richard Smith [Wed, 29 Apr 2015 23:20:19 +0000 (23:20 +0000)]
[modules] Stop trying to fake up a linear MacroDirective history.

Modules builds fundamentally have a non-linear macro history. In the interest
of better source fidelity, represent the macro definition information
faithfully: we have a linear macro directive history within each module, and at
any point we have a unique "latest" local macro directive and a collection of
visible imported directives. This also removes the attendent complexity of
attempting to create a correct MacroDirective history (which we got wrong
in the general case).

No functionality change intended.

llvm-svn: 236176

9 years ago[opaque pointer type] Store the value type of an alloca
David Blaikie [Wed, 29 Apr 2015 23:00:35 +0000 (23:00 +0000)]
[opaque pointer type] Store the value type of an alloca

llvm-svn: 236175

9 years agoIntroduce a NullLog class, which ignores all messages.
Zachary Turner [Wed, 29 Apr 2015 22:55:28 +0000 (22:55 +0000)]
Introduce a NullLog class, which ignores all messages.

The purpose of this class is so that GetLogIfAllCategoriesSet
can always return an instance of some class, whether it be a real
logging class or a "null" class, which ignores messages.  Code
that is littered with if statements that only log if the pointer
is non-null can get very unwieldy very quickly, so this should
help code readability in such circumstances.

Since I'm in this code anyway, I'm also deleting the
PrintfWithFlags methods, as well as all the flags, since they
appear to be dead code that have been superceded by newer
mechanisms and all the flags are simply ignored.

llvm-svn: 236174

9 years agoXFAIL Hexagon until more codegen in place.
Rick Foos [Wed, 29 Apr 2015 22:54:40 +0000 (22:54 +0000)]
XFAIL Hexagon until more codegen in place.

Summary:
Hexagon is being updated, but there is not enough to pass these tests.
These sections are now on top of Colin's list.

Test Plan: Ran changes on hexagon-build-03.

Reviewers: colinl, rfoos

Reviewed By: rfoos

Subscribers: cfe-commits

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

llvm-svn: 236173

9 years ago[WinEH] Start EH preparation for 32-bit x86, it uses no arguments
Reid Kleckner [Wed, 29 Apr 2015 22:49:54 +0000 (22:49 +0000)]
[WinEH] Start EH preparation for 32-bit x86, it uses no arguments

32-bit x86 MSVC-style exceptions are functionaly similar to 64-bit, but
they take no arguments. Instead, they implicitly use the value of EBP
passed in by the caller as a pointer to the parent's frame. In LLVM, we
can represent this as llvm.frameaddress(1), and feed that into all of
our calls to llvm.framerecover.

The next steps are:
- Add an alloca to the fs:00 linked list of handlers
- Add something like llvm.sjlj.lsda or generalize it to store in the
  alloca
- Move state number calculation to WinEHPrepare, arrange for
  FunctionLoweringInfo to call it
- Use the state numbers to insert explicit loads and stores in the IR

llvm-svn: 236172

9 years agogeneralize binop reassociation; NFC
Sanjay Patel [Wed, 29 Apr 2015 22:30:02 +0000 (22:30 +0000)]
generalize binop reassociation; NFC

Move the fold introduced in r236031:
http://reviews.llvm.org/rL236031

to its own helper function, so we can use it for other binops.

This is a preliminary step before partially solving:
https://llvm.org/bugs/show_bug.cgi?id=21768
https://llvm.org/bugs/show_bug.cgi?id=23116

llvm-svn: 236171

9 years agoDon't force a vendor check in ProcessMachCore::CanDebug() -- if this
Jason Molenda [Wed, 29 Apr 2015 22:17:45 +0000 (22:17 +0000)]
Don't force a vendor check in ProcessMachCore::CanDebug() -- if this
is a Mach-O file and it is a Mach-O core file, activate the
ProcessMachCore plugin.
<rdar://problem/20739989>

llvm-svn: 236170

9 years agoUpdate to build sysv-arm/sysv-arm64/sblanguageinfo/registercontextlinux_arm64.
Jason Molenda [Wed, 29 Apr 2015 22:16:19 +0000 (22:16 +0000)]
Update to build sysv-arm/sysv-arm64/sblanguageinfo/registercontextlinux_arm64.

llvm-svn: 236169

9 years agoprofile: Use unique directory for tests that write default profile file
Justin Bogner [Wed, 29 Apr 2015 21:56:35 +0000 (21:56 +0000)]
profile: Use unique directory for tests that write default profile file

Fix a couple of new tests that were reverted because they were causing
intermittent test failures since they were writing the same default
"default.profraw" file. Fixed by creating a unique directory and
running tests in that directory.

Patch by Teresa Johnson. Thanks!

llvm-svn: 236168

9 years agoRevert r236128, LLVM isn't falling back in the right way
Reid Kleckner [Wed, 29 Apr 2015 21:55:21 +0000 (21:55 +0000)]
Revert r236128, LLVM isn't falling back in the right way

llvm-svn: 236167

9 years agoRun StatepointLowering.{cpp,h} through clang-format.
Pat Gavlin [Wed, 29 Apr 2015 21:52:45 +0000 (21:52 +0000)]
Run StatepointLowering.{cpp,h} through clang-format.

llvm-svn: 236166

9 years ago[UBSan] Disable vptr.cpp on Darwin again.
Alexey Samsonov [Wed, 29 Apr 2015 21:51:23 +0000 (21:51 +0000)]
[UBSan] Disable vptr.cpp on Darwin again.

llvm-svn: 236165