OSDN Git Service
Kostya Serebryany [Fri, 24 Mar 2017 21:09:16 +0000 (21:09 +0000)]
[libFuzzer] honor -exact_artifact_path for all intermediate files during crash minimization (https://github.com/google/oss-fuzz/issues/250)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298740
91177308-0d34-0410-b5e6-
96231b3b80d8
Krzysztof Parzyszek [Fri, 24 Mar 2017 21:01:16 +0000 (21:01 +0000)]
Move spill size and alignment info from MC to TargetRegisterInfo
This is another step towards implementing register classes with
parametrized register/spill sizes and value types.
This is an updated version of r298652. The difference is that MCRegister-
Class still contains register size, available as getPhysRegSize(). The
old function getSize was retained as a temporary measure to avoid build
breakage for out-of-tree targets.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298739
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Fri, 24 Mar 2017 20:57:10 +0000 (20:57 +0000)]
AMDGPU: Fix annotating loops with nested loop conditions
If the branch condition for a loop was a phi which itself
was fed from a phi from a loop, it isn't safe to try
to delete the phi until after the loop is handled.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298737
91177308-0d34-0410-b5e6-
96231b3b80d8
Davide Italiano [Fri, 24 Mar 2017 20:52:56 +0000 (20:52 +0000)]
[MachineScheduler] Add missing machine pass dependency.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298736
91177308-0d34-0410-b5e6-
96231b3b80d8
Ivan Krasin [Fri, 24 Mar 2017 20:49:43 +0000 (20:49 +0000)]
Revert r298620: [LV] Vectorize GEPs
Reason: breaks linking Chromium with LLD + ThinLTO (a pass crashes)
LLVM bug: https://bugs.llvm.org//show_bug.cgi?id=32413
Original change description:
[LV] Vectorize GEPs
This patch adds support for vectorizing GEPs. Previously, we only generated
vector GEPs on-demand when creating gather or scatter operations. All GEPs from
the original loop were scalarized by default, and if a pointer was to be stored
to memory, we would have to build up the pointer vector with insertelement
instructions.
With this patch, we will vectorize all GEPs that haven't already been marked
for scalarization.
The patch refines collectLoopScalars to more exactly identify the scalar GEPs.
The function now more closely resembles collectLoopUniforms. And the patch
moves vector GEP creation out of vectorizeMemoryInstruction and into the main
vectorization loop. The vector GEPs needed for gather and scatter operations
will have already been generated before vectoring the memory accesses.
Original Differential Revision: https://reviews.llvm.org/D30710
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298735
91177308-0d34-0410-b5e6-
96231b3b80d8
Jessica Paquette [Fri, 24 Mar 2017 20:47:59 +0000 (20:47 +0000)]
[Outliner] Remove no red zone requirment for AArch64
AArch64 doesn't require -mno-red-zone; stack fixups are sufficient here. This was
unnecessarily copied over from the X86 target.
(You can now outline with red zones! Yay!)
Removing the requirement passes all Single/MultiSource tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298734
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Fri, 24 Mar 2017 20:47:41 +0000 (20:47 +0000)]
Document how to fetch monorepo SVN revision notes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298733
91177308-0d34-0410-b5e6-
96231b3b80d8
Evgeniy Stepanov [Fri, 24 Mar 2017 20:42:15 +0000 (20:42 +0000)]
[asan] Delay creation of asan ctor.
Create the constructor in the module pass.
This in needed for the GC-friendly globals change, where the constructor can be
put in a comdat in some cases, but we don't know about that in the function
pass.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298731
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Fri, 24 Mar 2017 20:04:18 +0000 (20:04 +0000)]
AMDGPU: Implement f16 fround
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298730
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Fri, 24 Mar 2017 19:52:05 +0000 (19:52 +0000)]
AMDGPU: Unify divergent function exits.
StructurizeCFG can't handle cases with multiple
returns creating regions with multiple exits.
Create a copy of UnifyFunctionExitNodes that only
unifies exit nodes that skips exit nodes
with uniform branch sources.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298729
91177308-0d34-0410-b5e6-
96231b3b80d8
Krzysztof Parzyszek [Fri, 24 Mar 2017 19:18:29 +0000 (19:18 +0000)]
Revert r298652 on Quentin's request
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298727
91177308-0d34-0410-b5e6-
96231b3b80d8
Adrian Prantl [Fri, 24 Mar 2017 19:11:31 +0000 (19:11 +0000)]
Make testcase less nonsensical while still exercising the same code paths.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298726
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Fri, 24 Mar 2017 19:04:57 +0000 (19:04 +0000)]
AMDGPU: Fold rcp/rsq of undef to undef
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298725
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Fri, 24 Mar 2017 18:56:43 +0000 (18:56 +0000)]
TTI: Split IsSimple in MemIntrinsicInfo
All this did before was assert in EarlyCSE.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298724
91177308-0d34-0410-b5e6-
96231b3b80d8
Stanislav Mekhanoshin [Fri, 24 Mar 2017 18:55:20 +0000 (18:55 +0000)]
[AMDGPU] Fold V_CNDMASK with identical source operands
Such instructions sometimes appear after lowering and folding.
Differential Revision: https://reviews.llvm.org/D31318
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298723
91177308-0d34-0410-b5e6-
96231b3b80d8
Konstantin Zhuravlyov [Fri, 24 Mar 2017 18:43:15 +0000 (18:43 +0000)]
[AMDGPU] Rename Kind to ValueKind in metadata to be consistent
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298722
91177308-0d34-0410-b5e6-
96231b3b80d8
Stanislav Mekhanoshin [Fri, 24 Mar 2017 18:01:14 +0000 (18:01 +0000)]
[AMDGPU] Add AMDGPUAliasAnalysis to opt pipeline
Previously it was added only to the BE.
Differential Revision: https://reviews.llvm.org/D31323
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298721
91177308-0d34-0410-b5e6-
96231b3b80d8
Teresa Johnson [Fri, 24 Mar 2017 17:59:06 +0000 (17:59 +0000)]
[ThinLTO] Correct counting of functions in inliner stats
Summary: Declarations need to be filtered out when counting functions.
Reviewers: eraman
Subscribers: Prazek, llvm-commits
Differential Revision: https://reviews.llvm.org/D31336
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298720
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Fri, 24 Mar 2017 17:53:06 +0000 (17:53 +0000)]
[AMDGPU] Don't enforce constexpr, there are still old standard libraries around that don't have a constexpr std::pair.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298719
91177308-0d34-0410-b5e6-
96231b3b80d8
Valery Pykhtin [Fri, 24 Mar 2017 17:49:05 +0000 (17:49 +0000)]
[AMDGPU] Remove double map lookups in SI scheduler
Patch by Axel Davy (axel.davy@normalesup.org)
Differential revision: https://reviews.llvm.org/D30382
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298718
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Fri, 24 Mar 2017 17:26:38 +0000 (17:26 +0000)]
[PDB] Split item and type records when merging type streams
Summary: MSVC does this when producing a PDB.
Reviewers: ruiu
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D31316
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298717
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Fri, 24 Mar 2017 17:25:47 +0000 (17:25 +0000)]
[X86][SSE] Add ashr + mask test cases.
Test cases showing cases where we're missing an opportunity to lshr a value with an extended sign to avoid loading a mask
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298716
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Fri, 24 Mar 2017 16:56:51 +0000 (16:56 +0000)]
[InstCombine] Provide a way to calculate KnownZero/One for Add/Sub in SimplifyDemandedUseBits without recursing into ComputeKnownBits
SimplifyDemandedUseBits for Add/Sub already recursed down LHS and RHS for simplifying bits. If that didn't provide any simplifications we fall back to calling computeKnownBits which will recurse again. Instead just take the known bits for LHS and RHS we already have and call into a new function in ValueTracking that can calculate the known bits given the LHS/RHS bits.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298711
91177308-0d34-0410-b5e6-
96231b3b80d8
Valery Pykhtin [Fri, 24 Mar 2017 16:45:50 +0000 (16:45 +0000)]
[AMDGPU] Fix SGPR usage count in SI scheduler
Patch by Axel Davy (axel.davy@normalesup.org)
Differential revision: https://reviews.llvm.org/D30149
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298710
91177308-0d34-0410-b5e6-
96231b3b80d8
Valery Pykhtin [Fri, 24 Mar 2017 16:37:48 +0000 (16:37 +0000)]
[AMDGPU] Add a new line after a debug message
Patch by Axel Davy (axel.davy@normalesup.org)
Differential revision: https://reviews.llvm.org/D30146
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298708
91177308-0d34-0410-b5e6-
96231b3b80d8
Tom Stellard [Fri, 24 Mar 2017 16:13:18 +0000 (16:13 +0000)]
stable-merge-request.sh: Add a script for submitting merge requests via bugzilla
Summary:
This script will automatically create a new stable merge request bug in
bugzilla for the given svn revision and release number.
Reviewers: hans
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D30905
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298705
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Fri, 24 Mar 2017 16:12:31 +0000 (16:12 +0000)]
[X86][SSE] Generalised lowerTruncate by PACKSS to work with any 'zero/all bits' result, not just comparisons.
Added vector compare opcodes to X86TargetLowering::ComputeNumSignBitsForTargetNode
Covered by existing tests added for D22814.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298704
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Fri, 24 Mar 2017 14:17:56 +0000 (14:17 +0000)]
Another instance where GCC doesn't understand implicit construction of StringLiteral.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298703
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Fri, 24 Mar 2017 14:15:35 +0000 (14:15 +0000)]
Make GCC happy again.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298702
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Fri, 24 Mar 2017 14:11:47 +0000 (14:11 +0000)]
Don't build up std::vectors with constant sizes when an array suffices.
NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298701
91177308-0d34-0410-b5e6-
96231b3b80d8
Teresa Johnson [Fri, 24 Mar 2017 12:50:45 +0000 (12:50 +0000)]
Remove stale and unused (MC)TargetOptions comparators.
Summary:
I discovered accidentally that the operator== for TargetOptions
is stale - it is missing many fields that have been added over
the recent years. It isn't used, so remove it. Ditto for the
comparator in MCTargetOptions, which doesn't seem stale yet but is
unused.
Reviewers: echristo
Subscribers: llvm-commits, mehdi_amini
Differential Revision: https://reviews.llvm.org/D31301
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298700
91177308-0d34-0410-b5e6-
96231b3b80d8
Max Kazantsev [Fri, 24 Mar 2017 07:04:31 +0000 (07:04 +0000)]
Revert "[ScalarEvolution] Re-enable Predicate implication from operations"
This reverts commit rL298690
Causes failures on clang.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298693
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Berlin [Fri, 24 Mar 2017 06:33:51 +0000 (06:33 +0000)]
NewGVN: Small cleanup of two dominance related functions to make
them easier to understand.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298692
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Berlin [Fri, 24 Mar 2017 06:33:48 +0000 (06:33 +0000)]
NewGVN: Small cleanup of useless expression deletion, and don't uselessly create two expressions in symbolic store evaluation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298691
91177308-0d34-0410-b5e6-
96231b3b80d8
Max Kazantsev [Fri, 24 Mar 2017 06:19:00 +0000 (06:19 +0000)]
[ScalarEvolution] Re-enable Predicate implication from operations
The patch rL298481 was reverted due to crash on clang-with-lto-ubuntu build.
The reason of the crash was type mismatch between either a or b and RHS in the following situation:
LHS = sext(a +nsw b) > RHS.
This is quite rare, but still possible situation. Normally we need to cast all {a, b, RHS} to their widest type.
But we try to avoid creation of new SCEV that are not constants to avoid initiating recursive analysis that
can take a lot of time and/or cache a bad value for iterations number. To deal with this, in this patch we
reject this case and will not try to analyze it if the type of sum doesn't match with the type of RHS. In this
situation we don't need to create any non-constant SCEVs.
This patch also adds an assertion to the method IsProvedViaContext so that we could fail on it and not
go further into range analysis etc (because in some situations these analyzes succeed even when the passed
arguments have wrong types, what should not normally happen).
The patch also contains a fix for a problem with too narrow scope of the analysis caused by wrong
usage of predicates in recursive invocations.
The regression test on the said failure: test/Analysis/ScalarEvolution/implied-via-addition.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298690
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Fri, 24 Mar 2017 05:38:09 +0000 (05:38 +0000)]
[ValueTracking] Use uint64_t for CarryIn in computeKnownBitsAddSub instead of a creating a temporary APInt. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298688
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Berlin [Fri, 24 Mar 2017 05:30:34 +0000 (05:30 +0000)]
NewGVN: Fix PR32403 - Handling of undef in phis was not quite correct
due to LLVM's view of phi nodes. It would cause NewGVN not to fixpoint
in some interesting edge cases.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298687
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Fri, 24 Mar 2017 03:57:24 +0000 (03:57 +0000)]
[ValueTracking] Convert more places to use setHighBits/setLowBits/setSignBit. NFCI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298683
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Fri, 24 Mar 2017 02:58:02 +0000 (02:58 +0000)]
[InstCombine] Use range-based for loop. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298680
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Fri, 24 Mar 2017 02:57:59 +0000 (02:57 +0000)]
[InstCombine] Fix 80 column violation I accidentally introduced. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298679
91177308-0d34-0410-b5e6-
96231b3b80d8
Petr Hosek [Fri, 24 Mar 2017 02:21:11 +0000 (02:21 +0000)]
[CMake] Support single target builtins build on Darwin
This change allows cross-compiling compiler-rt builtins for
multiple targets as part of runtimes on Darwin. This functionality
is already supported on other platforms.
Differential Revision: https://reviews.llvm.org/D30957
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298678
91177308-0d34-0410-b5e6-
96231b3b80d8
Meador Inge [Fri, 24 Mar 2017 01:57:29 +0000 (01:57 +0000)]
[AVR] Fix build after r298178
r298178 capitalized the fields in `ArgListEntry`. All the official
targets were updated accordingly, but as an experimental target AVR
was missed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298677
91177308-0d34-0410-b5e6-
96231b3b80d8
Kostya Serebryany [Fri, 24 Mar 2017 00:51:18 +0000 (00:51 +0000)]
[libFuzzer] split two tests to get more parallelism in test runs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298673
91177308-0d34-0410-b5e6-
96231b3b80d8
Kostya Serebryany [Fri, 24 Mar 2017 00:45:15 +0000 (00:45 +0000)]
[libFuzzer] increase kFeatureSetSize to 2^21 and make InputCorpus scale to that size. This will potentially make libFuzzer more sensitive on targets with lots of signals
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298671
91177308-0d34-0410-b5e6-
96231b3b80d8
Kostya Serebryany [Thu, 23 Mar 2017 23:48:47 +0000 (23:48 +0000)]
[libFuzzer] fix non-linux build
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298666
91177308-0d34-0410-b5e6-
96231b3b80d8
Adrian Prantl [Thu, 23 Mar 2017 23:35:09 +0000 (23:35 +0000)]
Refactor code to reduce indentation and improve readability. (NFC)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298665
91177308-0d34-0410-b5e6-
96231b3b80d8
Adrian Prantl [Thu, 23 Mar 2017 23:35:00 +0000 (23:35 +0000)]
Fix a bug when emitting debug info for partially constant global variables.
While fixing a malformed testcase, I discovered that the code
exercised by it was wrong, too.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298664
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Thu, 23 Mar 2017 23:30:41 +0000 (23:30 +0000)]
[sancov] Don't instrument blocks with no insertion point
This prevents crashes when attempting to instrument functions containing
C++ try.
Sanitizer coverage will still fail at runtime when an exception is
thrown through a sancov instrumented function, but that seems marginally
better than what we have now. The full solution is to color the blocks
in LLVM IR and only instrument blocks that have an unambiguous color,
using the appropriate token.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298662
91177308-0d34-0410-b5e6-
96231b3b80d8
Dehao Chen [Thu, 23 Mar 2017 23:28:09 +0000 (23:28 +0000)]
Fix trellis layout to avoid mis-identify triangle.
Summary:
For the following CFG:
A->B
B->C
A->C
If there is another edge B->D, then ABC should not be considered as triangle.
Reviewers: davidxl, iteratee
Reviewed By: iteratee
Subscribers: nemanjai, llvm-commits
Differential Revision: https://reviews.llvm.org/D31310
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298661
91177308-0d34-0410-b5e6-
96231b3b80d8
Dehao Chen [Thu, 23 Mar 2017 23:26:00 +0000 (23:26 +0000)]
Set the prof weight correctly for call instructions in DeadArgumentElimination.
Summary: In DeadArgumentElimination, the call instructions will be replaced. We also need to set the prof weights so that function inlining can find the correct profile.
Reviewers: eraman
Reviewed By: eraman
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D31143
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298660
91177308-0d34-0410-b5e6-
96231b3b80d8
Bryant Wong [Thu, 23 Mar 2017 23:21:07 +0000 (23:21 +0000)]
[MetaRenamer] Don't rename library functions.
Library functions can have specific semantics that affect the behavior of
certain passes. DSE, for instance, gives special treatment to malloc-ed pointers
but not to pointers returned from an equivalently typed (but differently named)
function.
MetaRenamer ought not to alter program semantics, so library functions must
remain untouched.
Reviewers: mehdi_amini, majnemer, chandlerc, davide
Reviewed By: davide
Subscribers: davide, llvm-commits
Differential Revision: https://reviews.llvm.org/D31304
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298659
91177308-0d34-0410-b5e6-
96231b3b80d8
Dehao Chen [Thu, 23 Mar 2017 23:14:11 +0000 (23:14 +0000)]
Use isFunctionHotInCallGraph to set the function section prefix.
Summary: The current prefix based function layout algorithm only looks at function's entry count, which is not sufficient. A function should be grouped together if its entry count or any call edge count is hot.
Reviewers: davidxl, eraman
Reviewed By: eraman
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D31225
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298656
91177308-0d34-0410-b5e6-
96231b3b80d8
Krzysztof Parzyszek [Thu, 23 Mar 2017 23:01:22 +0000 (23:01 +0000)]
[Hexagon] Avoid infinite loops in HexagonLoopIdiomRecognition
- Avoid explosive growth of the simplification queue by not queuing
expressions that are alredy in it.
- Add an iteration counter and abort after a sufficiently large number
of iterations (assuming that it's a symptom of an infinite loop).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298655
91177308-0d34-0410-b5e6-
96231b3b80d8
Kostya Serebryany [Thu, 23 Mar 2017 22:43:12 +0000 (22:43 +0000)]
[libFuzzer] create experimental support for user-provided coverage signal
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298654
91177308-0d34-0410-b5e6-
96231b3b80d8
Petr Hosek [Thu, 23 Mar 2017 22:40:10 +0000 (22:40 +0000)]
[CMake] Provide an option to disable runtimes build
This could be used to either disable the runtimes build altogether
or avoid building them but still generate the build targets.
Differential Revision: https://reviews.llvm.org/D31060
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298653
91177308-0d34-0410-b5e6-
96231b3b80d8
Krzysztof Parzyszek [Thu, 23 Mar 2017 22:32:22 +0000 (22:32 +0000)]
Move spill size and alignment info from MC to TargetRegisterInfo
This is another step towards implementing register classes with
parametrized register/spill sizes.
Differential Revision: https://reviews.llvm.org/D31299
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298652
91177308-0d34-0410-b5e6-
96231b3b80d8
Jessica Paquette [Thu, 23 Mar 2017 22:17:20 +0000 (22:17 +0000)]
[Outliner] Remove unused lambda capture.
Remove an unused lambda capture that made some bots unhappy.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298651
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Thu, 23 Mar 2017 21:36:25 +0000 (21:36 +0000)]
[PDB] Use two DBs when dumping the IPI stream
Summary:
When dumping these records from an object file section, we should use
only one type database. However, when dumping from a PDB, we should use
two: one for the type stream and one for the IPI stream.
Certain type records that normally live in the .debug$T object file
section get moved over to the IPI stream of the PDB file and they get
new indices.
So far, I've noticed that the MSVC linker always moves these records
into IPI:
- LF_FUNC_ID
- LF_MFUNC_ID
- LF_STRING_ID
- LF_SUBSTR_LIST
- LF_BUILDINFO
- LF_UDT_MOD_SRC_LINE
These records have index fields that can point into TPI or IPI. In
particular, LF_SUBSTR_LIST and LF_BUILDINFO point to LF_STRING_ID
records to describe compilation command lines.
I've modified the dumper to have an optional pointer to the item DB, and
to do type name lookup of these fields in that DB. See printItemIndex.
The result is that our pdbdump-headers.test is more faithful to the PDB
contents and the output is less confusing.
Reviewers: ruiu
Subscribers: amccarth, zturner, llvm-commits
Differential Revision: https://reviews.llvm.org/D31309
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298649
91177308-0d34-0410-b5e6-
96231b3b80d8
Jessica Paquette [Thu, 23 Mar 2017 21:27:38 +0000 (21:27 +0000)]
[Outliner] Fix compile-time overhead for candidate choice
The old candidate collection method in the outliner caused some very large
regressions in compile time on large tests. For MultiSource/Benchmarks/7zip it
caused a 284.07 s or 1156% increase in compile time. On average, using the
SingleSource/MultiSource tests, it caused an average increase of 8 seconds in
compile time (something like 1000%).
This commit replaces that candidate collection method with a new one which
only visits each node in the tree once. This reduces the worst compile time
increase (still 7zip) to a 0.542 s overhead (22%) and the average compile time
increase on SingleSource and MultiSource to 0.018 s (4%).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298648
91177308-0d34-0410-b5e6-
96231b3b80d8
Dehao Chen [Thu, 23 Mar 2017 21:20:05 +0000 (21:20 +0000)]
Disable loop unrolling and icp in SamplePGO ThinLTO compile phase
Summary:
loop unrolling and icp will make the sample profile annotation much harder in the backend. So disable these 2 optimization in the ThinLTO compile phase.
Will add a test in cfe in a separate patch.
Reviewers: tejohnson
Reviewed By: tejohnson
Subscribers: mehdi_amini, llvm-commits, Prazek
Differential Revision: https://reviews.llvm.org/D31217
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298646
91177308-0d34-0410-b5e6-
96231b3b80d8
Richard Smith [Thu, 23 Mar 2017 21:02:31 +0000 (21:02 +0000)]
Remove unnecessary use of std::result_of, which is deprecated in C++17.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298645
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Thu, 23 Mar 2017 21:00:13 +0000 (21:00 +0000)]
[InstCombine] Remove some code from visitAnd that dealt with trying to reduce the LHS of a sub to 0. This should now be fully handled by SimplifyDemandedInstructionBits now.
Now that we call ShrinkDemandedConstant on the RHS of sub this should be taken care of. This code doesn't trigger on any in tree regressions, but did before ShrinkDemandedConstant was added to the RHS.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298644
91177308-0d34-0410-b5e6-
96231b3b80d8
Erich Keane [Thu, 23 Mar 2017 20:38:34 +0000 (20:38 +0000)]
LLVM Changes for alloc_align
GCC has the alloc_align attribute, which is similar to assume_aligned, except the attribute's parameter is the index of the integer parameter that needs aligning to.
This is the required LLVM changes to make this happen.
Differential Revision: https://reviews.llvm.org/D29598
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298643
91177308-0d34-0410-b5e6-
96231b3b80d8
Adrian Prantl [Thu, 23 Mar 2017 20:23:42 +0000 (20:23 +0000)]
Zero-Initialize PrevInstBB when entering a new MachineFunction.
It is not guaranteed that the memory used for MachineBasicBlocks in
the previous MachineFunction hasn't been freed, so holding on to a
pointer to the last function's isn't correct. Particularly I have
observed the sret.ll testcase failing because the first BasicBlock in
the new function happened to be allocated to the exact same memory as
the previously saved and (deleted) PrevInstBB.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298642
91177308-0d34-0410-b5e6-
96231b3b80d8
Gil Rapaport [Thu, 23 Mar 2017 20:02:23 +0000 (20:02 +0000)]
[LV] Add regression test for r297610
The new test asserts that scalarized memory operations get memcheck metadata
added even if the loop is only unrolled.
Differential Revision: https://reviews.llvm.org/D30972
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298641
91177308-0d34-0410-b5e6-
96231b3b80d8
Anna Thomas [Thu, 23 Mar 2017 20:00:54 +0000 (20:00 +0000)]
[LVIPrinterPass] Print LVI info for function arguments
Using AssemblyAnnotationWriter for LVI printer prints
for instructions and basic blocks.
So, we explicitly need to print LVI info for the arguments of the function (these
are values and not instructions).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298640
91177308-0d34-0410-b5e6-
96231b3b80d8
Teresa Johnson [Thu, 23 Mar 2017 19:47:39 +0000 (19:47 +0000)]
[ThinLTO] Add support for emitting minimized bitcode for thin link
Summary:
The cumulative size of the bitcode files for a very large application
can be huge, particularly with -g. In a distributed build environment,
all of these files must be sent to the remote build node that performs
the thin link step, and this can exceed size limits.
The thin link actually only needs the summary along with a bitcode
symbol table. Until we have a proper bitcode symbol table, simply
stripping the debug metadata results in significant size reduction.
Add support for an option to additionally emit minimized bitcode
modules, just for use in the thin link step, which for now just strips
all debug metadata. I plan to add a cc1 option so this can be invoked
easily during the compile step.
However, care must be taken to ensure that these minimized thin link
bitcode files produce the same index as with the original bitcode files,
as these original bitcode files will be used in the backends.
Specifically:
1) The module hash used for caching is typically produced by hashing the
written bitcode, and we want to include the hash that would correspond
to the original bitcode file. This is because we want to ensure that
changes in the stripped portions affect caching. Added plumbing to emit
the same module hash in the minimized thin link bitcode file.
2) The module paths in the index are constructed from the module ID of
each thin linked bitcode, and typically is automatically generated from
the input file path. This is the path used for finding the modules to
import from, and obviously we need this to point to the original bitcode
files. Added gold-plugin support to take a suffix replacement during the
thin link that is used to override the identifier on the MemoryBufferRef
constructed from the loaded thin link bitcode file. The assumption is
that the build system can specify that the minimized bitcode file has a
name that is similar but uses a different suffix (e.g. out.thinlink.bc
instead of out.o).
Added various tests to ensure that we get identical index files out of
the thin link step.
Reviewers: mehdi_amini, pcc
Subscribers: Prazek, llvm-commits
Differential Revision: https://reviews.llvm.org/D31027
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298638
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Thu, 23 Mar 2017 19:41:10 +0000 (19:41 +0000)]
Kill some trailing whitespace to make some new changes a bit easier.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298637
91177308-0d34-0410-b5e6-
96231b3b80d8
Nirav Dave [Thu, 23 Mar 2017 18:25:17 +0000 (18:25 +0000)]
[X86] Fix Stale SDNode use in X86ISelDAGtoDAG
Summary: Fixes pr32329.
Reviewers: spatel, craig.topper
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D31286
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298633
91177308-0d34-0410-b5e6-
96231b3b80d8
Zhaoshi Zheng [Thu, 23 Mar 2017 18:06:09 +0000 (18:06 +0000)]
Model ashr(shl(x, n), m) as mul(x, 2^(n-m)) when n > m
Given below case:
%y = shl %x, n
%z = ashr %y, m
when n = m, SCEV models it as sext(trunc(x)). This patch tries to handle
the case where n > m by using sext(mul(trunc(x), 2^(n-m)))) as the SCEV
expression.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298631
91177308-0d34-0410-b5e6-
96231b3b80d8
Zhaoshi Zheng [Thu, 23 Mar 2017 17:52:20 +0000 (17:52 +0000)]
revert test commit r298629
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298630
91177308-0d34-0410-b5e6-
96231b3b80d8
Zhaoshi Zheng [Thu, 23 Mar 2017 17:38:47 +0000 (17:38 +0000)]
test commit
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298629
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Thu, 23 Mar 2017 17:35:08 +0000 (17:35 +0000)]
Remove the subtarget argument from LowerFP_TO_INT since there's one
stored on X86TargetLowering.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298628
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Thu, 23 Mar 2017 17:35:06 +0000 (17:35 +0000)]
Remove unused X86Subtarget argument from getOnesVector.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298627
91177308-0d34-0410-b5e6-
96231b3b80d8
Adrian McCarthy [Thu, 23 Mar 2017 17:18:50 +0000 (17:18 +0000)]
Somehow this still breaks because of ANSI color codes in test output on Linux.
Reverting until I can figure out the root cause.
Revert "Re-land: Make NativeExeSymbol a concrete subclass of NativeRawSymbol [PDB]"
This reverts commit
f461a70cc376f0f91c8b4917be79479cc86330a5.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298626
91177308-0d34-0410-b5e6-
96231b3b80d8
Adrian McCarthy [Thu, 23 Mar 2017 16:57:53 +0000 (16:57 +0000)]
Fix build break after r298623
Use the -color-output option explicitly to eliminate the ANSI color codes in
pdb-native-summary.test. (The default should have done this.)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298625
91177308-0d34-0410-b5e6-
96231b3b80d8
Pirama Arumuga Nainar [Thu, 23 Mar 2017 16:47:47 +0000 (16:47 +0000)]
[ARM] Fix computeKnownBits for ARMISD::CMOV
Summary:
The true and false operands for the CMOV are operands 0 and 1.
ARMISelLowering.cpp::computeKnownBits was looking at operands 1 and 2
instead. This can cause CMOV instructions to be incorrectly folded into
BFI if value set by the CMOV is another CMOV, whose known bits are
computed incorrectly.
This patch fixes the issue and adds a test case.
Reviewers: kristof.beyls, jmolloy
Subscribers: llvm-commits, aemerson, srhines, rengolin
Differential Revision: https://reviews.llvm.org/D31265
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298624
91177308-0d34-0410-b5e6-
96231b3b80d8
Adrian McCarthy [Thu, 23 Mar 2017 16:45:20 +0000 (16:45 +0000)]
Re-land: Make NativeExeSymbol a concrete subclass of NativeRawSymbol [PDB]
The new test should pass on all platforms now that llvm-pdbdump has the
`-color-output` option.
This moves exe symbol-specific method implementations out of NativeRawSymbol
into a concrete subclass. Also adds implementations for hasCTypes and
hasPrivateSymbols and a simple test to ensure the native reader can access
the summary information for the executable from the PDB.
Original Differential Revision: https://reviews.llvm.org/D31059
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298623
91177308-0d34-0410-b5e6-
96231b3b80d8
Matthew Simpson [Thu, 23 Mar 2017 16:29:58 +0000 (16:29 +0000)]
[LV] Vectorize GEPs
This patch adds support for vectorizing GEPs. Previously, we only generated
vector GEPs on-demand when creating gather or scatter operations. All GEPs from
the original loop were scalarized by default, and if a pointer was to be stored
to memory, we would have to build up the pointer vector with insertelement
instructions.
With this patch, we will vectorize all GEPs that haven't already been marked
for scalarization.
The patch refines collectLoopScalars to more exactly identify the scalar GEPs.
The function now more closely resembles collectLoopUniforms. And the patch
moves vector GEP creation out of vectorizeMemoryInstruction and into the main
vectorization loop. The vector GEPs needed for gather and scatter operations
will have already been generated before vectoring the memory accesses.
Differential Revision: https://reviews.llvm.org/D30710
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298620
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Thu, 23 Mar 2017 16:09:34 +0000 (16:09 +0000)]
[X86][SSE] Extract elements from narrower shuffle masks.
Add support for widening narrow shuffle masks so we can directly extract from the relevant input vector of the shuffle.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298616
91177308-0d34-0410-b5e6-
96231b3b80d8
Matthew Simpson [Thu, 23 Mar 2017 16:07:21 +0000 (16:07 +0000)]
[LV] Delete unneeded scalar GEP creation code
The code for generating scalar base pointers in vectorizeMemoryInstruction is
not needed. We currently scalarize all GEPs and maintain the scalarized values
in VectorLoopValueMap. The GEP cloning in this unneeded code is the same as
that in scalarizeInstruction. The test cases that changed as a result of this
patch changed because we were able to reuse the scalarized GEP that we
previously generated instead of cloning a new one.
Differential Revision: https://reviews.llvm.org/D30587
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298615
91177308-0d34-0410-b5e6-
96231b3b80d8
Tim Shen [Thu, 23 Mar 2017 16:02:47 +0000 (16:02 +0000)]
[PPC] Add generated tests for all atomic operations
Summary: Add tests for all atomic operations for powerpc64le, so that all changes can be easily examined.
Reviewers: kbarton, hfinkel, echristo
Subscribers: mehdi_amini, nemanjai, llvm-commits
Differential Revision: https://reviews.llvm.org/D31285
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298614
91177308-0d34-0410-b5e6-
96231b3b80d8
Derek Schuff [Thu, 23 Mar 2017 15:46:47 +0000 (15:46 +0000)]
[WebAssembly] Fix import type to be signed LEBs
This fix is a follow up a previous change with stored
value types as signed integers in memory.
In future, once the yaml<->wasm binary patche lands we
can add test coverage for this kind of thing.
Differential Revision: https://reviews.llvm.org/D31227
Patch by Sam Clegg
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298612
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Thu, 23 Mar 2017 15:38:22 +0000 (15:38 +0000)]
[x86] add memcmp tests, remove run
Add tests for vector lengths that could be handled without a libcall.
There's an explicit test for 'nobuiltin', so there's not much value
in a separate run that checks that same behavior over and over again.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298611
91177308-0d34-0410-b5e6-
96231b3b80d8
Adrian McCarthy [Thu, 23 Mar 2017 15:28:15 +0000 (15:28 +0000)]
Add option to control whether llvm-pdbdump outputs in color
Adds -color-output option to llvm-pdbdump pretty commands that lets the user
specify whether the output should have color. The default depends on whether
the output is going to a TTY (per prior discussion in
https://reviews.llvm.org/D31246).
This will enable tests that pipe llvm-pdbdump output to FileCheck to work
across platforms without regard to the differences in ANSI codes.
Differential Revision: https://reviews.llvm.org/D31263
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298610
91177308-0d34-0410-b5e6-
96231b3b80d8
Igor Breger [Thu, 23 Mar 2017 15:25:57 +0000 (15:25 +0000)]
[GlobalISel][X86] Support G_STORE/G_LOAD operation
Summary:
1. Support pointer type as function argumnet and return value
2. G_STORE/G_LOAD - set legal action for i8/i16/i32/i64/f32/f64/vec128
3. RegisterBank - support typeless operations like G_STORE/G_LOAD, for scalar use GPR bank.
4. Support instruction selection for G_LOAD/G_STORE
Reviewers: zvi, rovka, ab, qcolombet
Reviewed By: rovka
Subscribers: llvm-commits, dberris, kristof.beyls, eladcohen, guyblank
Differential Revision: https://reviews.llvm.org/D30973
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298609
91177308-0d34-0410-b5e6-
96231b3b80d8
Nirav Dave [Thu, 23 Mar 2017 15:01:50 +0000 (15:01 +0000)]
[SDAG] Fix zeroExtend assertion error
Move CombineTo preventing deleted node from being returned in
visitZERO_EXTEND.
Fixes PR32284.
Reviewers: RKSimon, bogner
Reviewed By: RKSimon
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D31254
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298604
91177308-0d34-0410-b5e6-
96231b3b80d8
Vassil Vassilev [Thu, 23 Mar 2017 14:54:34 +0000 (14:54 +0000)]
Do not polute the source directory.
When a python script is run, by default it creates the bytecode file if the directory is writable, and this ‘pollutes’ source folders.
From python's help:
-B Don’t write .py[co] files on import. See also PYTHONDONTWRITEBYTECODE.
Patch by Pere Mato (D30604)!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298603
91177308-0d34-0410-b5e6-
96231b3b80d8
Dehao Chen [Thu, 23 Mar 2017 14:43:10 +0000 (14:43 +0000)]
Do not set branch weight if the branch weight annotation is present.
Summary: ThinLTO will annotate the CFG twice. If the branch weight is set by the first annotation, we should not set the branch weight again in the second annotation because the first annotation is more accurate as there is less optimization that could affect debug info accuracy.
Reviewers: tejohnson, davidxl
Reviewed By: tejohnson
Subscribers: mehdi_amini, aprantl, llvm-commits
Differential Revision: https://reviews.llvm.org/D31228
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298602
91177308-0d34-0410-b5e6-
96231b3b80d8
Zvi Rackover [Thu, 23 Mar 2017 14:08:26 +0000 (14:08 +0000)]
X86FixupBWInsts: Minor cleanup. NFC
Summary: Cleanup some remnants of code from when the X86FixupBWInsts pass did both forward liveness analysis and backward liveness analysis.
Reviewers: MatzeB, myatsina, DavidKreitzer
Reviewed By: MatzeB
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D31264
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298599
91177308-0d34-0410-b5e6-
96231b3b80d8
Strahinja Petrovic [Thu, 23 Mar 2017 13:40:07 +0000 (13:40 +0000)]
[Mips] Emit the correct DINS variant
This patch fixes emitting of correct variant of DINS instruction.
Differential Revision: https://reviews.llvm.org/D30988
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298596
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Thu, 23 Mar 2017 13:33:03 +0000 (13:33 +0000)]
[X86][SSE] Tidyup canWidenShuffleElements. NFCI.
Pull out mask elements at the start, allowing us to make the widening pattern matching more readable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298594
91177308-0d34-0410-b5e6-
96231b3b80d8
Strahinja Petrovic [Thu, 23 Mar 2017 13:19:04 +0000 (13:19 +0000)]
[Mips] Fix for decoding DINS instruction - disassembler
This patch fixes decoding of size and position for DINSM
and DINSU instructions.
Differential Revision: https://reviews.llvm.org/D31072
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298593
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Thu, 23 Mar 2017 13:18:09 +0000 (13:18 +0000)]
[X86][SSE] Add computeNumSignBits test for sitofp of (extended) i64 extracted element
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298592
91177308-0d34-0410-b5e6-
96231b3b80d8
Igor Breger [Thu, 23 Mar 2017 12:13:29 +0000 (12:13 +0000)]
[GlobalISel][X86] clang-format. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298590
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael Zuckerman [Thu, 23 Mar 2017 09:57:01 +0000 (09:57 +0000)]
[X86][TD][vpmovm2 ] New TD pattern for the vpmovm2 instruction
Up until now, vpmovm2 instruction described its destination operand size
by the source operand size. This patch adds new pattern for the vpmovm2
instruction. The node describes new expansion of the destination (from
{128|256} to 512).
Differential Revision: https://reviews.llvm.org/D30654
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298586
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Thu, 23 Mar 2017 07:06:42 +0000 (07:06 +0000)]
[ValueTracking] Use APInt::isNegative instead of using operator[BitWidth-1]. NFCI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298584
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Thu, 23 Mar 2017 07:06:39 +0000 (07:06 +0000)]
[ValueTracking] Use setAllBits/setSignBit/setLowBits/setHighBits. NFCI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298583
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Thu, 23 Mar 2017 06:15:56 +0000 (06:15 +0000)]
[IR] Use a binary search in DataLayout::getAlignmentInfo
Summary:
We currently do a linear scan through all of the Alignments array entries anytime getAlignmentInfo is called. I noticed while profiling compile time on a -O2 opt run that this function can be called quite frequently and was showing about as about 1% of the time in callgrind.
This patch puts the Alignments array into a sorted order by type and then by bitwidth. We can then do a binary search. And use the sorted nature to handle the special cases for INTEGER_ALIGN. Some of this is modeled after the sorting/searching we do for pointers already.
This reduced the time spent in this routine by about 2/3 in the one compilation I was looking at.
We could maybe improve this more by using a DenseMap to cache the results, but just sorting was easy and didn't require extra data structure. And I think it made the integer handling simpler.
Reviewers: sanjoy, davide, majnemer, resistor, arsenm, mehdi_amini
Reviewed By: arsenm
Subscribers: arsenm, llvm-commits
Differential Revision: https://reviews.llvm.org/D31232
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298579
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Thu, 23 Mar 2017 05:25:25 +0000 (05:25 +0000)]
[IR] Mark Use::getUser and Use::getImpliedUse as LLVM_READONLY.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298578
91177308-0d34-0410-b5e6-
96231b3b80d8