OSDN Git Service

android-x86/external-llvm.git
8 years ago[RuntimeDyld] Plumb Error/Expected through the internals of RuntimeDyld.
Lang Hames [Wed, 27 Apr 2016 20:24:48 +0000 (20:24 +0000)]
[RuntimeDyld] Plumb Error/Expected through the internals of RuntimeDyld.

Also replaces a number of calls to report_fatal_error with Error returns.

The plumbing will make it easier to return errors originating in libObject.

Replacing report_fatal_errors with Error returns will give JIT clients the
opportunity to recover gracefully when the JIT is unable to produce/relocate
code, as well as providing meaningful error messages that can be used to file
bug reports.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267776 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoFix build failure under NDEBUG.
Than McIntosh [Wed, 27 Apr 2016 20:07:02 +0000 (20:07 +0000)]
Fix build failure under NDEBUG.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267774 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[X86]: Quit promoting 16 bit loads to 32 bit.
Kevin B. Smith [Wed, 27 Apr 2016 19:58:03 +0000 (19:58 +0000)]
[X86]: Quit promoting 16 bit loads to 32 bit.
Differential Revision: http://reviews.llvm.org/D19592

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267773 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[libFuzzer] disable leak detection if we have tried it for 1000 times w/o finding...
Kostya Serebryany [Wed, 27 Apr 2016 19:52:56 +0000 (19:52 +0000)]
[libFuzzer] disable leak detection if we have tried it for 1000 times w/o finding a leak [part 2]

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267771 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[libFuzzer] disable leak detection if we have tried it for 1000 times w/o finding...
Kostya Serebryany [Wed, 27 Apr 2016 19:52:34 +0000 (19:52 +0000)]
[libFuzzer] disable leak detection if we have tried it for 1000 times w/o finding a leak

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267770 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoAdd optimization bisect opt-in calls for PowerPC passes
Andrew Kaylor [Wed, 27 Apr 2016 19:39:32 +0000 (19:39 +0000)]
Add optimization bisect opt-in calls for PowerPC passes

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267769 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[CodeGenPrepare] Don't sink a cast past its user
David Majnemer [Wed, 27 Apr 2016 19:36:38 +0000 (19:36 +0000)]
[CodeGenPrepare] Don't sink a cast past its user

The sink cast machinery is supposed to sink casts as close to their user
as possible.  However, an EH pad is the first instruction in it's basic
block.  Don't sink if the user is an EH pad.

This fixes PR27536.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267767 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoRefactor debugging code, NFC.
Than McIntosh [Wed, 27 Apr 2016 19:26:25 +0000 (19:26 +0000)]
Refactor debugging code, NFC.

Summary:
Refactor debugging routines to reduce code duplication. Remove a couple
of #include's that were not needed. Don't require MachineDominator as a
prereq for this pass (not needed).

These changes split off from http://reviews.llvm.org/D18827.

Reviewers: wmi, gbiv, qcolombet

Subscribers: llvm-commits, davidxl, jevinskie

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267766 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[NVPTX] Run NVVMReflect at the beginning of IR passes.
Justin Lebar [Wed, 27 Apr 2016 19:13:37 +0000 (19:13 +0000)]
[NVPTX] Run NVVMReflect at the beginning of IR passes.

Summary:
Currently the NVVMReflect pass is run at the beginning of our backend
passes.  But really, it should be run as early as possible, as it's
simply resolving an "if" statement in code.  So copy it into
TargetMachine::addEarlyAsPossiblePasses.

We still run it at the beginning of the backend passes, since it's
needed for correctness when lowering to nvptx.

(Specifically, NVVMReflect changes each call to the __nvvm_reflect
function or llvm.nvvm.reflect intrinsic into an integer constant, based
on the pass's configuration.  Clearly we miss many optimization
opportunities if we perform this transformation at the beginning of
codegen.)

Reviewers: rnk

Subscribers: tra, llvm-commits, jholewinski

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267765 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoAdd TargetMachine::addEarlyAsPossiblePasses, and call it from opt.
Justin Lebar [Wed, 27 Apr 2016 19:08:24 +0000 (19:08 +0000)]
Add TargetMachine::addEarlyAsPossiblePasses, and call it from opt.

Summary:
This is a hook to allow TargetMachine to install passes at the
EP_EarlyAsPossible PassManagerBuilder extension point.

Reviewers: chandlerc

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267763 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[LIR] Set attributes on memset_pattern16.
Ahmed Bougacha [Wed, 27 Apr 2016 19:04:50 +0000 (19:04 +0000)]
[LIR] Set attributes on memset_pattern16.

"inferattrs" will deduce the attribute, but it will be too late for
many optimizations. Set it ourselves when creating the call.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267762 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[LIR] Reuse variable. NFCI.
Ahmed Bougacha [Wed, 27 Apr 2016 19:04:46 +0000 (19:04 +0000)]
[LIR] Reuse variable. NFCI.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267761 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[InferAttrs] Mark memset_pattern16 params nocapture.
Ahmed Bougacha [Wed, 27 Apr 2016 19:04:43 +0000 (19:04 +0000)]
[InferAttrs] Mark memset_pattern16 params nocapture.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267760 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[TLI] Unify LibFunc attribute inference. NFCI.
Ahmed Bougacha [Wed, 27 Apr 2016 19:04:40 +0000 (19:04 +0000)]
[TLI] Unify LibFunc attribute inference. NFCI.

Now the pass is just a tiny wrapper around the util. This lets us reuse
the logic elsewhere (done here for BuildLibCalls) instead of duplicating
it.

The next step is to have something like getOrInsertLibFunc that also
sets the attributes.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267759 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[TLI] Unify LibFunc signature checking. NFCI.
Ahmed Bougacha [Wed, 27 Apr 2016 19:04:35 +0000 (19:04 +0000)]
[TLI] Unify LibFunc signature checking. NFCI.

I tried to be as close as possible to the strongest check that
existed before; cleaning these up properly is left for future work.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267758 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[TLI] Fix indentation. NFC.
Ahmed Bougacha [Wed, 27 Apr 2016 19:04:29 +0000 (19:04 +0000)]
[TLI] Fix indentation. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267757 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoClean up to avoid compiler warnings for casting away const qualifiers.
Sjoerd Meijer [Wed, 27 Apr 2016 18:35:02 +0000 (18:35 +0000)]
Clean up to avoid compiler warnings for casting away const qualifiers.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267753 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoRevert "[AMDGPU][llvm-mc] Add support of TTMP quads. Rework M0 exclusion for SMRD."
Chad Rosier [Wed, 27 Apr 2016 18:29:11 +0000 (18:29 +0000)]
Revert "[AMDGPU][llvm-mc] Add support of TTMP quads. Rework M0 exclusion for SMRD."

This reverts commit r267733 due to a -Werror,-Wunused-function error.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267752 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[LV] Reallow positive-stride interleaved load groups with gaps
Matthew Simpson [Wed, 27 Apr 2016 18:21:36 +0000 (18:21 +0000)]
[LV] Reallow positive-stride interleaved load groups with gaps

We previously disallowed interleaved load groups that may cause us to
speculatively access memory out-of-bounds (r261331). We did this by ensuring
each load group had an access corresponding to the first and last member.
Instead of bailing out for these interleaved groups, this patch enables us to
peel off the last vector iteration, ensuring that we execute at least one
iteration of the scalar remainder loop. This solution was proposed in the
review of the previous patch.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267751 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[SLPVectorizer] Refactor where MinVecRegSize and MaxVecRegSize live.
Arch D. Robison [Wed, 27 Apr 2016 17:46:25 +0000 (17:46 +0000)]
[SLPVectorizer] Refactor where MinVecRegSize and MaxVecRegSize live.

This is the first of two commits for extending SLP Vectorizer to deal with aggregates.
This commit merely refactors existing logic.

http://reviews.llvm.org/D14185

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267748 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[DAGCombiner] Follow coding convention for function name (NFC)
Gerolf Hoflehner [Wed, 27 Apr 2016 17:27:16 +0000 (17:27 +0000)]
[DAGCombiner] Follow coding convention for function name (NFC)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267745 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[Mips] Add support for llvm.thread.pointer intrinsic.
Marcin Koscielnicki [Wed, 27 Apr 2016 17:21:49 +0000 (17:21 +0000)]
[Mips] Add support for llvm.thread.pointer intrinsic.

This will be used to implement __builtin_thread_pointer in clang.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267743 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[InstCombine] Sharpended test case in pr21210.ll
Gerolf Hoflehner [Wed, 27 Apr 2016 17:19:54 +0000 (17:19 +0000)]
[InstCombine] Sharpended  test case in  pr21210.ll

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267742 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoSilence a -Wdangling-else
Reid Kleckner [Wed, 27 Apr 2016 16:46:33 +0000 (16:46 +0000)]
Silence a -Wdangling-else

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267737 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoAdd parentheses to silence buildbot warning
Matthew Simpson [Wed, 27 Apr 2016 16:25:04 +0000 (16:25 +0000)]
Add parentheses to silence buildbot warning

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267734 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[AMDGPU][llvm-mc] Add support of TTMP quads. Rework M0 exclusion for SMRD.
Artem Tamazov [Wed, 27 Apr 2016 16:20:23 +0000 (16:20 +0000)]
[AMDGPU][llvm-mc] Add support of TTMP quads. Rework M0 exclusion for SMRD.

Added support of TTMP quads.
Reworked M0 exclusion machinery for SMRD and similar instructions
to enable usage of TTMP registers in those instructions as destinations.
Tests added.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267733 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[PDB] Fix function names for private symbols in PDBs
Reid Kleckner [Wed, 27 Apr 2016 16:10:29 +0000 (16:10 +0000)]
[PDB] Fix function names for private symbols in PDBs

Summary:
llvm-symbolizer wants to get linkage names of functions for historical
reasons. Linkage names are only recorded in the PDB for public symbols,
and the linkage name is apparently stored separately in some "public
symbol" record. We had a workaround in PDBContext which would look for
such symbols when the user requested linkage names.

However, when given an address that was truly in a private function and
public funciton, we would accidentally find nearby public symbols and
return those function names. The fix is to look for both function
symbols and public symbols and only prefer the public symbol name if the
addresses of the symbols agree.

Fixes PR27492

Reviewers: zturner

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267732 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoAMDGPU/SI: Add llvm.amdgcn.s.waitcnt.all intrinsic
Nicolai Haehnle [Wed, 27 Apr 2016 15:46:01 +0000 (15:46 +0000)]
AMDGPU/SI: Add llvm.amdgcn.s.waitcnt.all intrinsic

Summary:
So it appears that to guarantee some of the ordering requirements of a GLSL
memoryBarrier() executed in the shader, we need to emit an s_waitcnt.

(We can't use an s_barrier, because memoryBarrier() may appear anywhere in
the shader, in particular it may appear in non-uniform control flow.)

Reviewers: arsenm, mareko, tstellarAMD

Subscribers: arsenm, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267729 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[TTI] Add hook for vector extract with extension
Matthew Simpson [Wed, 27 Apr 2016 15:20:21 +0000 (15:20 +0000)]
[TTI] Add hook for vector extract with extension

This change adds a new hook for estimating the cost of vector extracts followed
by zero- and sign-extensions. The motivating example for this change is the
SMOV and UMOV instructions on AArch64. These instructions move data from vector
to general purpose registers while performing the corresponding extension
(sign-extend for SMOV and zero-extend for UMOV) at the same time. For these
operations, TargetTransformInfo can assume the extensions are free and only
report the cost of the vector extract. The SLP vectorizer has been updated to
make use of the new hook.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267725 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[AMDGPU][llvm-mc] s_getreg/setreg* - Support symbolic names of hardware registers.
Artem Tamazov [Wed, 27 Apr 2016 15:17:03 +0000 (15:17 +0000)]
[AMDGPU][llvm-mc] s_getreg/setreg* - Support symbolic names of hardware registers.

Possibility to specify code of hardware register kept.
Disassemble to symbolic name, if name is known.
Tests updated/added.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267724 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoRevert r267649, it caused PR27539.
Nico Weber [Wed, 27 Apr 2016 15:16:54 +0000 (15:16 +0000)]
Revert r267649, it caused PR27539.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267723 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoRemove size 1 from check as that isn't part of what the test is meant to be testing.
Kristof Beyls [Wed, 27 Apr 2016 15:03:09 +0000 (15:03 +0000)]
Remove size 1 from check as that isn't part of what the test is meant to be testing.

This test also runs on e.g. ARM-native builds when the X86 backend is also
built.  This test produces code for the default instruction set, even though it
is in a "X86" sub-directory. Given that this test doesn't seem to be testing
anything architecture-specific, it seems it's best to adapt the check to not
check for an architecture-dependent value (the size of the function), rather
than hard-code the test to target x86.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267722 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[ThinLTO] Refine fix to avoid renaming of uses in inline assembly.
Teresa Johnson [Wed, 27 Apr 2016 14:19:38 +0000 (14:19 +0000)]
[ThinLTO] Refine fix to avoid renaming of uses in inline assembly.

Summary:
Refine the workaround from r266877 that attempts to prevent
renaming of locals in inline assembly, so that in addition to looking
for a llvm.used local value, that there is at least one inline assembly
call in the module. Otherwise, debug functions added to the llvm.used
can block importing/exporting unnecessarily.

Reviewers: joker.eph

Subscribers: llvm-commits, joker.eph

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267717 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[ThinLTO] Use valueid instead of bitcode offsets in combined index file
Teresa Johnson [Wed, 27 Apr 2016 13:28:35 +0000 (13:28 +0000)]
[ThinLTO] Use valueid instead of bitcode offsets in combined index file

Summary:
With the removal of support for lazy parsing of combined index summary
records (e.g. r267344), we no longer need to include the summary record
bitcode offset in the VST entries for definitions. Change the combined
index format to be similar to the per-module index format in using value
ids to cross-reference from the summary record to the VST entry (rather
than the summary record bitcode offset to cross-reference in the other
direction).

The visible changes are:
1) Add the value id to the combined summary records
2) Remove the summary offset from the combined VST records, which has
the following effects:
- No longer need the VST_CODE_COMBINED_GVDEFENTRY record, as all
  combined index VST entries now only contain the value id and
  corresponding GUID.
- No longer have duplicate VST entries in the case where there are
  multiple definitions of a symbol (e.g. weak/linkonce), as they all
  have the same value id and GUID.

An implication of #2 above is that in order to hook up an alias to the
correct aliasee based on the value id of the aliasee recorded in the
combined index alias record, we need to scan the entries in the index
for that GUID to find the one from the same module (i.e. the case where
there are multiple entries for the aliasee). But the reader no longer
has to maintain a special map to hook up the alias/aliasee.

Reviewers: joker.eph

Subscribers: joker.eph, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267712 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoNFC. Introduce Value::getPointerDerferecnceableBytes
Artur Pilipenko [Wed, 27 Apr 2016 12:51:01 +0000 (12:51 +0000)]
NFC. Introduce Value::getPointerDerferecnceableBytes

Extract a part of isDereferenceableAndAlignedPointer functionality to Value::getPointerDerferecnceableBytes. Currently it's a NFC, but in future I'm going to accumulate all the logic about value dereferenceability in this function similarly to Value::getPointerAlignment function (D16144).

Reviewed By: reames

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267708 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[InstCombine][SSE] Regenerated vector shift tests
Simon Pilgrim [Wed, 27 Apr 2016 12:04:44 +0000 (12:04 +0000)]
[InstCombine][SSE] Regenerated vector shift tests

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267699 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[mips][microMIPS] Add CodeGen support for SUBU16, SUB, SUBU, DSUB and DSUBU instructions
Zlatko Buljan [Wed, 27 Apr 2016 11:31:44 +0000 (11:31 +0000)]
[mips][microMIPS] Add CodeGen support for SUBU16, SUB, SUBU, DSUB and DSUBU instructions
Differential Revision: http://reviews.llvm.org/D16676

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267694 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[mips][microMIPS] Add CodeGen support for SLL16, SRL16, SLL, SLLV, SRA, SRAV, SRL...
Zlatko Buljan [Wed, 27 Apr 2016 11:02:23 +0000 (11:02 +0000)]
[mips][microMIPS] Add CodeGen support for SLL16, SRL16, SLL, SLLV, SRA, SRAV, SRL and SRLV instructions
Differential Revision: http://reviews.llvm.org/D17989

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267693 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoisSafeToLoadUnconditionally support queries without a context
Artur Pilipenko [Wed, 27 Apr 2016 11:00:48 +0000 (11:00 +0000)]
isSafeToLoadUnconditionally support queries without a context

This is required to use this function from isSafeToSpeculativelyExecute

Reviewed By: hfinkel

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267692 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoUse DL preferred alignment for alloca in Value::getPointerAlignment
Artur Pilipenko [Wed, 27 Apr 2016 10:42:29 +0000 (10:42 +0000)]
Use DL preferred alignment for alloca in Value::getPointerAlignment

Teach Value::getPointerAlignment that allocas with no explicit alignment are aligned to preferred alignment of the allocated type.

Reviewed By: hfinkel

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267689 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[InstCombine][SSE] Added DemandedBits tests for MOVMSK instructions
Simon Pilgrim [Wed, 27 Apr 2016 09:53:09 +0000 (09:53 +0000)]
[InstCombine][SSE] Added DemandedBits tests for MOVMSK instructions

MOVMSK zeros the upper bits of the gpr - we should be able to use this.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267686 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoFixed sphinx warning from r267672
Adam Nemet [Wed, 27 Apr 2016 05:59:51 +0000 (05:59 +0000)]
Fixed sphinx warning from r267672

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267675 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[LoopDist] Add llvm.loop.distribute.enable loop metadata
Adam Nemet [Wed, 27 Apr 2016 05:28:18 +0000 (05:28 +0000)]
[LoopDist] Add llvm.loop.distribute.enable loop metadata

Summary:
D19403 adds a new pragma for loop distribution.  This change adds
support for the corresponding metadata that the pragma is translated to
by the FE.

As part of this I had to rethink the flag -enable-loop-distribute.  My
goal was to be backward compatible with the existing behavior:

  A1. pass is off by default from the optimization pipeline
  unless -enable-loop-distribute is specified

  A2. pass is on when invoked directly from opt (e.g. for unit-testing)

The new pragma/metadata overrides these defaults so the new behavior is:

  B1. A1 + enable distribution for individual loop with the pragma/metadata

  B2. A2 + disable distribution for individual loop with the pragma/metadata

The default value whether the pass is on or off comes from the initiator
of the pass.  From the PassManagerBuilder the default is off, from opt
it's on.

I moved -enable-loop-distribute under the pass.  If the flag is
specified it overrides the default from above.

Then the pragma/metadata can further modifies this per loop.

As a side-effect, we can now also use -enable-loop-distribute=0 from opt
to emulate the default from the optimization pipeline.  So to be precise
this is the new behavior:

  C1. pass is off by default from the optimization pipeline
  unless -enable-loop-distribute or the pragma/metadata enables it

  C2. pass is on when invoked directly from opt
  unless -enable-loop-distribute=0 or the pragma/metadata disables it

Reviewers: hfinkel

Subscribers: joker.eph, mzolotukhin, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267672 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[Cloning] cloneLoopWithPreheader(): add assert to ensure no sub-loops
Vaivaswatha Nagaraj [Wed, 27 Apr 2016 05:25:09 +0000 (05:25 +0000)]
[Cloning] cloneLoopWithPreheader(): add assert to ensure no sub-loops

Summary:
cloneLoopWithPreheader() does not update LoopInfo for sub-loop of
the original loop being cloned. Add assert to ensure no sub-loops for loop being cloned.

Reviewers: anemet, ashutosh.nema, hfinkel

Subscribers: mzolotukhin, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267671 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[Support][X86] Add a few more Intel model numbers to getHostCPUName for airmont and...
Craig Topper [Wed, 27 Apr 2016 05:17:00 +0000 (05:17 +0000)]
[Support][X86] Add a few more Intel model numbers to getHostCPUName for airmont and knl.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267670 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[Support][X86] Change the case values in the Intel family 6 code to hex so its easier...
Craig Topper [Wed, 27 Apr 2016 05:16:58 +0000 (05:16 +0000)]
[Support][X86] Change the case values in the Intel family 6 code to hex so its easier to compare with Intel's docs. NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267669 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoRevert "Support "preserving" the summary information when using setModule() API in...
Mehdi Amini [Wed, 27 Apr 2016 05:11:44 +0000 (05:11 +0000)]
Revert "Support "preserving" the summary information when using setModule() API in LTOCodeGenerator"

This reverts commit r267665.
ASAN shows that there is a use of undefined value.

From: Mehdi Amini <mehdi.amini@apple.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267668 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[Support][X86] Add a couple more Broadwell CPU models numbers to getHostCPUName.
Craig Topper [Wed, 27 Apr 2016 04:40:03 +0000 (04:40 +0000)]
[Support][X86] Add a couple more Broadwell CPU models numbers to getHostCPUName.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267666 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoSupport "preserving" the summary information when using setModule() API in LTOCodeGen...
Mehdi Amini [Wed, 27 Apr 2016 04:24:10 +0000 (04:24 +0000)]
Support "preserving" the summary information when using setModule() API in LTOCodeGenerator

Another attempt at r267655...

From: Mehdi Amini <mehdi.amini@apple.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267665 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoRevert "Support "preserving" the summary information when using setModule() API in...
Mehdi Amini [Wed, 27 Apr 2016 03:34:28 +0000 (03:34 +0000)]
Revert "Support "preserving" the summary information when using setModule() API in LTOCodeGenerator"

This reverts commit r267657, r267656, and r267655.
The test does not pass on multiple bots, I'm unsure why yet but let's unbreak them.

From: Mehdi Amini <mehdi.amini@apple.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267664 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoThe patch fixes PR27392.
Evgeny Stupachenko [Wed, 27 Apr 2016 03:04:54 +0000 (03:04 +0000)]
The patch fixes PR27392.
Summary:
 It is incorrect to compare TripCount (which is BECount + 1)
  with extraiters (or Count) to check if we should enter unrolled
  loop or not, because TripCount can potentially overflow
  (when BECount is max unsigned integer).
 While comparing BECount with (Count - 1) is overflow safe and
  therefore correct.

Reviewer: hfinkel

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

From: Evgeny Stupachenko <evstupac@gmail.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267662 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[LVI] Delete stale and misleading comment.
Philip Reames [Wed, 27 Apr 2016 03:03:15 +0000 (03:03 +0000)]
[LVI] Delete stale and misleading comment.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267661 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[ppc64] fix bug in prologue that mfocrf's cr operand should be explict state instead...
Chuang-Yu Cheng [Wed, 27 Apr 2016 02:59:28 +0000 (02:59 +0000)]
[ppc64] fix bug in prologue that mfocrf's cr operand should be explict state instead of implicit

This fixes PR27414

Reviewers: kbarton mgrang tjablin

http://reviews.llvm.org/D19255

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267660 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[X86] Set AddPristinesAndCSRs to FixupBW LivePhysRegs. NFC.
Ahmed Bougacha [Wed, 27 Apr 2016 01:51:38 +0000 (01:51 +0000)]
[X86] Set AddPristinesAndCSRs to FixupBW LivePhysRegs. NFC.

We run after PEI, so we need to AddPristinesAndCSRs.
In practice, that makes no difference here, because we only ask about
liveness of super-registers of defined GR8/GR16 registers, so they
can't be pristine. Still, it's the correct thing to do.

Thanks to Quentin for noticing!

Follow-up to r267495.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267658 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoFix the test from r267656: Support "preserving" the summary information when using...
Mehdi Amini [Wed, 27 Apr 2016 01:49:11 +0000 (01:49 +0000)]
Fix the test from r267656: Support "preserving" the summary information when using setModule() API in LTOCodeGenerator

From: Mehdi Amini <mehdi.amini@apple.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267657 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoAdd a test for r267655: Support "preserving" the summary information when using setMo...
Mehdi Amini [Wed, 27 Apr 2016 01:47:46 +0000 (01:47 +0000)]
Add a test for r267655: Support "preserving" the summary information when using setModule() API in LTOCodeGenerator

From: Mehdi Amini <mehdi.amini@apple.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267656 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoSupport "preserving" the summary information when using setModule() API in LTOCodeGen...
Mehdi Amini [Wed, 27 Apr 2016 01:46:48 +0000 (01:46 +0000)]
Support "preserving" the summary information when using setModule() API in LTOCodeGenerator

From: Mehdi Amini <mehdi.amini@apple.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267655 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoFix typo in comment; NFC
Sanjoy Das [Wed, 27 Apr 2016 01:44:31 +0000 (01:44 +0000)]
Fix typo in comment; NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267653 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[X86] Don't assume that MMX extractelts are from index 0.
Ahmed Bougacha [Wed, 27 Apr 2016 01:35:29 +0000 (01:35 +0000)]
[X86] Don't assume that MMX extractelts are from index 0.

It's probably the case for all 3 MMX users out there, but with
hand-crafted IR, you can trigger selection failures. Fix that.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267652 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[X86] Re-enable MMX i32 extractelt combine.
Ahmed Bougacha [Wed, 27 Apr 2016 01:35:25 +0000 (01:35 +0000)]
[X86] Re-enable MMX i32 extractelt combine.

This effectively adds back the extractelt combine removed by r262358:
the direct case can still occur (because x86_mmx is special, see
r262446), but it's the indirect case that's now superseded by the
generic combine.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267651 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoDetects the SAD pattern on X86 so that much better code will be emitted once the...
Cong Hou [Wed, 27 Apr 2016 01:29:18 +0000 (01:29 +0000)]
Detects the SAD pattern on X86 so that much better code will be emitted once the pattern is matched.

Differential revision: http://reviews.llvm.org/D14840

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267649 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[LVI] Add a comment explaining a subtle piece of code
Philip Reames [Wed, 27 Apr 2016 01:02:25 +0000 (01:02 +0000)]
[LVI] Add a comment explaining a subtle piece of code

Or at least, I didn't understand the implications the first several times I read it it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267648 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[Docs] Try to clarify the concept of domains for noalias scope
Adam Nemet [Wed, 27 Apr 2016 00:52:48 +0000 (00:52 +0000)]
[Docs] Try to clarify the concept of domains for noalias scope

Summary:
This tries to anchor down the concept of domains a bit better.  I had
trouble initially relating this to anything.  Also talking to David
Majnemer on IRC suggested that I wasn't the only one.

Reviewers: hfinkel

Subscribers: llvm-commits, majnemer

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267647 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoThinLTO: do not promote GlobalVariable that have a specific section.
Mehdi Amini [Wed, 27 Apr 2016 00:32:13 +0000 (00:32 +0000)]
ThinLTO: do not promote GlobalVariable that have a specific section.

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

From: Mehdi Amini <mehdi.amini@apple.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267646 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoSLSR: Use UnknownAddressSpace instead of 0 for pure arithmetic.
Matt Arsenault [Wed, 27 Apr 2016 00:32:09 +0000 (00:32 +0000)]
SLSR: Use UnknownAddressSpace instead of 0 for pure arithmetic.

In the case where isLegalAddressingMode is used for cases
not related to addressing modes, such as pure adds and muls,
it should not be using address space 0. LSR already passes -1
as the address space in these cases.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267645 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoLTOCodeGenerator: turns linkonce(_odr) into weak_(odr) when present "MustPreserve...
Mehdi Amini [Wed, 27 Apr 2016 00:32:02 +0000 (00:32 +0000)]
LTOCodeGenerator: turns linkonce(_odr) into weak_(odr) when present "MustPreserve" set

Summary:
If the linker requested to preserve a linkonce function, we should
honor this even if we drop all uses.

Reviewers: dexonsmith

Subscribers: llvm-commits, joker.eph

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

From: Mehdi Amini <mehdi.amini@apple.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267644 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[LoopDist] Split main class. NFC
Adam Nemet [Wed, 27 Apr 2016 00:31:03 +0000 (00:31 +0000)]
[LoopDist] Split main class. NFC

This splits out the per-loop functionality from the Pass class.

With this the fact whether the loop is forced-distribute with the new
metadata/pragma can be cached in the per-loop class rather than passed
around.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267643 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[LVI] Reduce compile time by lazily scanning blocks if needed
Philip Reames [Wed, 27 Apr 2016 00:30:55 +0000 (00:30 +0000)]
[LVI] Reduce compile time by lazily scanning blocks if needed

When encountering a non-local pointer, LVI would eagerly scan the block for dereferences of the given object to prove the pointer to be non null.  That's all well and good, but *then* we'd go recurse through our input blocks.  As a result, we could end up scanning each and every block we traverse, even if the final definition was obviously non null or we found a constant value somewhere up the chain.  The previous code papered over this by using the isKnownNonNull routine from value tracking.  This made the duplication less painful in the common case.

Instead, we know do the block scan only *after* we've gotten the recursive results back.  This lets us stop scanning individual blocks as soon as we've determined it to be non-null in any predecessor block and use our usual merge rules to propagate that information cheaply through successor blocks.  For a pointer which can be found non-null, this does strictly less work and sometimes substaintially so.

Note that the case where we *can't* prove something non-null is still the really expensive case.  We end up scanning each and every block looking for a dereference and never end up finding one.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267642 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[MachineInstrBundle] Actually set the PartialDeadDef flag only when the register
Quentin Colombet [Wed, 27 Apr 2016 00:16:29 +0000 (00:16 +0000)]
[MachineInstrBundle] Actually set the PartialDeadDef flag only when the register
is defined!

The users were checking the proper thing (Defined + PartialDeadDef), but the
information may have been wrong for other use cases, so fix that.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267641 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[MachineInstrBundle] Update the comment for PhysRegInfo::DeadDef.
Quentin Colombet [Tue, 26 Apr 2016 23:55:41 +0000 (23:55 +0000)]
[MachineInstrBundle] Update the comment for PhysRegInfo::DeadDef.

I missed read the comment when I commited r267621 and thought the
comment did not need update. Matthias kindly proved me wrong.
Fixing that.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267638 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoAdd optimization bisect opt-in calls for SystemZ passes
Andrew Kaylor [Tue, 26 Apr 2016 23:49:41 +0000 (23:49 +0000)]
Add optimization bisect opt-in calls for SystemZ passes

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267636 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoAdd optimization bisect opt-in calls for NVPTX passes
Andrew Kaylor [Tue, 26 Apr 2016 23:44:31 +0000 (23:44 +0000)]
Add optimization bisect opt-in calls for NVPTX passes

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267635 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[X86] Make sure it is safe to clobber EFLAGS, if need be, when choosing
Quentin Colombet [Tue, 26 Apr 2016 23:44:14 +0000 (23:44 +0000)]
[X86] Make sure it is safe to clobber EFLAGS, if need be, when choosing
the prologue.

Do not use basic blocks that have EFLAGS live-in as prologue if we need
to realign the stack. Realigning the stack uses AND instruction and this
clobbers EFLAGS.

An other alternative would have been to save and restore EFLAGS around
the stack realignment code, but this is likely inefficient.

Fixes PR27531.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267634 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoPM: Port Reassociate to the new pass manager
Justin Bogner [Tue, 26 Apr 2016 23:39:29 +0000 (23:39 +0000)]
PM: Port Reassociate to the new pass manager

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267631 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[X86] Replace -mcpu with -mattr in several tests
Mitch Bodart [Tue, 26 Apr 2016 23:36:38 +0000 (23:36 +0000)]
[X86] Replace -mcpu with -mattr in several tests
Differential Revision: http://reviews.llvm.org/D19568

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267629 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoReassociate: Convert another functor into a lambda. NFC
Justin Bogner [Tue, 26 Apr 2016 23:32:00 +0000 (23:32 +0000)]
Reassociate: Convert another functor into a lambda. NFC

Also move the explanatory comment with it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267628 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[LVI] Cut short search if we know we can't return a useful result
Philip Reames [Tue, 26 Apr 2016 23:27:33 +0000 (23:27 +0000)]
[LVI] Cut short search if we know we can't return a useful result

Previously we were recursing on our operands for unary and binary operators regardless of whether we knew how to reason about the operator in question.  This has the effect of doing a potentially large amount of work, only to throw it away.  By checking whether the operation is one LVI can handle, we can cut short the search and return the (overdefined) answer more quickly.  The quality of the results produced should not change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267626 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[SimplifyCFG] propagate branch metadata when creating select
Sanjay Patel [Tue, 26 Apr 2016 23:15:48 +0000 (23:15 +0000)]
[SimplifyCFG] propagate branch metadata when creating select

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267624 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[X86] Teach the expansion of copy instructions how to do proper liveness.
Quentin Colombet [Tue, 26 Apr 2016 23:14:32 +0000 (23:14 +0000)]
[X86] Teach the expansion of copy instructions how to do proper liveness.

When the simple analysis provided by MachineBasicBlock::computeRegisterLiveness
fails, fall back on the LivePhysReg utility.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267623 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[MachineBasicBlock] Take advantage of the partially dead information.
Quentin Colombet [Tue, 26 Apr 2016 23:14:29 +0000 (23:14 +0000)]
[MachineBasicBlock] Take advantage of the partially dead information.

Thanks to that information we wouldn't lie on a register being live whereas it
is not.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267622 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[MachineInstrBundle] Improvement the recognition of dead definitions.
Quentin Colombet [Tue, 26 Apr 2016 23:14:24 +0000 (23:14 +0000)]
[MachineInstrBundle] Improvement the recognition of dead definitions.

Now, it is possible to know that partial definitions are dead definitions and
recognize that clobbered registers are also dead.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267621 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[LVI] Apply transfer rule for overdefine inputs for binary operators
Philip Reames [Tue, 26 Apr 2016 23:10:35 +0000 (23:10 +0000)]
[LVI] Apply transfer rule for overdefine inputs for binary operators

As pointed out by John Regehr over in http://reviews.llvm.org/D19485, LVI was being incredibly stupid about applying its transfer rules.  Rather than gathering local facts from the expression itself, it was simply giving up entirely if one of the inputs was overdefined.  This greatly impacts the precision of the overall analysis and makes it far more fragile as well.

This patch builds on 267609 which did the same thing for unary casts.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267620 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[NVPTX] Fix some usages of CodeGenOpt::None.
Jingyue Wu [Tue, 26 Apr 2016 22:59:25 +0000 (22:59 +0000)]
[NVPTX] Fix some usages of CodeGenOpt::None.

NVPTXLowerKernelArgs is required for correctness, so it should not be guarded
by CodeGenOpt::None.

NVPTXPeephole is optimization only, so it should be skipped when
CodeGenOpt::None.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267619 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[LVI] A better fix for the assertion error introduced by 267609
Philip Reames [Tue, 26 Apr 2016 22:52:30 +0000 (22:52 +0000)]
[LVI] A better fix for the assertion error introduced by 267609

Essentially, I was using the wrong size function.  For types which were sized, but not primitive, I wasn't getting a useful size for the operand and failed an assert.  I fixed this, and also added a guard that the input is a sized type.  Test case is for the original mistake.  I'm not sure how to actually exercise the sized type check.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267618 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[LVI] Speculative fix for assertion seen in clang bots
Philip Reames [Tue, 26 Apr 2016 22:31:53 +0000 (22:31 +0000)]
[LVI] Speculative fix for assertion seen in clang bots

I'll clean this up and add a test case shortly.  I want to make sure this does actually fix the bots; if not, I'll revert.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267617 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[LowerExpectIntrinsic] make default likely/unlikely ratio bigger
Sanjay Patel [Tue, 26 Apr 2016 22:23:38 +0000 (22:23 +0000)]
[LowerExpectIntrinsic] make default likely/unlikely ratio bigger

We need the default ratio to be sufficiently large that it triggers transforms
based on block frequency info (BFI) and plays well with the recently introduced
BranchProbability used by CGP.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267615 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoReassociate: Simplify using lambdas. NFC
Justin Bogner [Tue, 26 Apr 2016 22:22:18 +0000 (22:22 +0000)]
Reassociate: Simplify using lambdas. NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267614 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[LVI] Infer local facts from unary expressions
Philip Reames [Tue, 26 Apr 2016 21:48:16 +0000 (21:48 +0000)]
[LVI] Infer local facts from unary expressions

As pointed out by John Regehr over in http://reviews.llvm.org/D19485, LVI was being incredibly stupid about applying its transfer rules. Rather than gathering local facts from the expression itself, it was simply giving up entirely if one of the inputs was overdefined. This greatly impacts the precision of the overall analysis and makes it far more fragile as well.

This patch implements only the unary operation case. Once this is in, I'll implement the same for the binary operations.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267609 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoOptimization bisect support in X86-specific passes
Andrew Kaylor [Tue, 26 Apr 2016 21:44:24 +0000 (21:44 +0000)]
Optimization bisect support in X86-specific passes

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267608 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[CodeGen] Add getBuildVector and getSplatBuildVector helpers. NFCI.
Ahmed Bougacha [Tue, 26 Apr 2016 21:15:30 +0000 (21:15 +0000)]
[CodeGen] Add getBuildVector and getSplatBuildVector helpers. NFCI.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267606 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoRevert "[SimplifyLibCalls] sprintf doesn't copy null bytes"
David Majnemer [Tue, 26 Apr 2016 21:04:47 +0000 (21:04 +0000)]
Revert "[SimplifyLibCalls] sprintf doesn't copy null bytes"

The destination buffer that sprintf uses is restrict qualified, we do
not need to worry about derived pointers referenced via format
specifiers.

This reverts commit r267580.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267605 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoTry to get ResponseFile.ll passing on Windows after r267556.
Nico Weber [Tue, 26 Apr 2016 20:32:51 +0000 (20:32 +0000)]
Try to get ResponseFile.ll passing on Windows after r267556.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267599 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoRemove more unused variables.
Zachary Turner [Tue, 26 Apr 2016 20:32:35 +0000 (20:32 +0000)]
Remove more unused variables.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267598 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoMasked Store in Loop Vectorizer - bugfix
Elena Demikhovsky [Tue, 26 Apr 2016 20:18:04 +0000 (20:18 +0000)]
Masked Store in Loop Vectorizer - bugfix

Fixed a bug in loop vectorization with conditional store.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267597 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoPM: Port Internalize to the new pass manager
Justin Bogner [Tue, 26 Apr 2016 20:15:52 +0000 (20:15 +0000)]
PM: Port Internalize to the new pass manager

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267596 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[llvm-pdbdump] Fix version reading on big endian systems.
Zachary Turner [Tue, 26 Apr 2016 19:48:18 +0000 (19:48 +0000)]
[llvm-pdbdump] Fix version reading on big endian systems.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267595 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoAdd optimization bisect opt-in calls for Hexagon passes
Andrew Kaylor [Tue, 26 Apr 2016 19:46:28 +0000 (19:46 +0000)]
Add optimization bisect opt-in calls for Hexagon passes

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267593 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoFix warnings and -Werror build on clang.
Zachary Turner [Tue, 26 Apr 2016 19:24:10 +0000 (19:24 +0000)]
Fix warnings and -Werror build on clang.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267589 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoParse and dump PDB DBI Stream Header Information
Zachary Turner [Tue, 26 Apr 2016 18:42:34 +0000 (18:42 +0000)]
Parse and dump PDB DBI Stream Header Information

The DBI stream contains a lot of bookkeeping information for other
streams. In particular it contains information about section contributions
and linked modules. This patch is a first attempt at parsing some of the
information out of the DBI stream. It currently only parses and dumps the
headers of the DBI stream, so none of the module data or section
contribution data is pulled out.

This is just a proof of concept that we understand the basic properties of
the DBI stream's metadata, and followup patches will try to extract more
detailed information out.

Differential Revision: http://reviews.llvm.org/D19500
Reviewed By: majnemer, ruiu

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267585 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[Tail duplication] Handle source registers with subregisters
Krzysztof Parzyszek [Tue, 26 Apr 2016 18:36:34 +0000 (18:36 +0000)]
[Tail duplication] Handle source registers with subregisters

When a block is tail-duplicated, the PHI nodes from that block are
replaced with appropriate COPY instructions. When those PHI nodes
contained use operands with subregisters, the subregisters were
dropped from the COPY instructions, resulting in incorrect code.

Keep track of the subregister information and use this information
when remapping instructions from the duplicated block.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267583 91177308-0d34-0410-b5e6-96231b3b80d8