Commit Graph

30215 Commits

Author SHA1 Message Date
Chandler Carruth
067ba90db4 [PM] Clean up variable and parameter names to match modern LLVM naming
conventions more conistently before hacking on this code to integrate
nicely with new PM's loop pass infrastructure. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292272 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-17 21:51:39 +00:00
Dan Gohman
c67238a892 [WebAssembly] Add triple support for the new wasm object format
Differential Revision: https://reviews.llvm.org/D26701


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292252 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-17 20:34:09 +00:00
Chandler Carruth
1c28b57b8b [PM] Teach the LoopPassManager to automatically canonicalize loops by
runnig LCSSA over them prior to running the loop pipeline.

This also teaches the loop PM to verify that LCSSA form is preserved
throughout the pipeline's run across the loop nest.

Most of the test updates just leverage this new functionality. One has to be
relaxed with the new PM as IVUsers is less powerful when it sees LCSSA input.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292241 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-17 19:18:12 +00:00
George Rimar
ef935cd26f Recommit r292214 "[Support/Compression] - Change zlib API to return Error instead of custom status"
No any changes, will follow up with D28807 commit containing APLi change for clang
to fix build issues happened.

Original commit message:
[Support/Compression] - Change zlib API to return Error instead of custom status.

Previously API returned custom enum values.
Patch changes it to return Error with string description.
That should help users to report errors in universal way.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292226 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-17 15:45:07 +00:00
George Rimar
7c0ccdc11d Revert r292214 "[Support/Compression] - Change zlib API to return Error instead of custom status."
It broked clang:
http://lab.llvm.org:8080/green//job/clang-stage1-cmake-RA-incremental_build/34218/consoleFull#46141505449ba4694-19c4-4d7e-bec5-911270d8a58c

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292217 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-17 13:27:58 +00:00
George Rimar
4a6a534c0c [Support/Compression] - Change zlib API to return Error instead of custom status.
Previously API returned custom enum values.
Patch changes it to return Error with string description.
That should help users to report errors in universal way.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292214 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-17 13:20:17 +00:00
Matt Arsenault
62b3258a7c AMDGPU: Add replacement export intrinsics
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292205 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-17 07:26:53 +00:00
Lang Hames
d7472fa68e [Orc][RPC] Return unsupported rpc function errors from the non-retry cases in
negotiateFunction.

These cases were accidentally left out of r292055, resulting in a less
descriptive ECError being returned on these paths.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292193 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-17 04:07:48 +00:00
Matt Arsenault
5276f9a934 SimplifyLibCalls: Replace fabs libcalls with intrinsics
Add missing fabs(fpext) optimzation that worked with the call,
and also fixes it creating a second fpext when there were multiple
uses.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292172 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-17 00:10:40 +00:00
David Blaikie
758377052d Attempt to workaround MSVC build issue where I suspect an enum class constant 0 is considered a possible null pointer
I can't reproduce this so far with web compilers, so throwing this at
the bots to see if it sticks.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292155 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-16 20:28:59 +00:00
David Blaikie
cf890beb7e PR31650: Refer to enum constant when initializing llvm::None constant
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292149 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-16 18:48:52 +00:00
Daniel Sanders
064b91fd98 Revert r292132: [globalisel] Tablegen-erate current Register Bank Information'...
Several buildbots encountered a crash in tablegen when building this commit.
Reverting while I investigate the cause.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292136 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-16 15:34:43 +00:00
Hal Finkel
b1c51125dd Fix use-after-free bug in AffectedValueCallbackVH::allUsesReplacedWith
When transferring affected values in the cache from an old value, identified by
the value of the current callback, to the specified new value we might need to
insert a new entry into the DenseMap which constitutes the cache. Doing so
might delete the current callback object. Move the copying logic into a new
function, a member of the assumption cache itself, so that we don't run into UB
should the callback handle itself be removed mid-copy.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292133 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-16 15:22:01 +00:00
Daniel Sanders
ca24065b98 [globalisel] Tablegen-erate current Register Bank Information
Summary:
Adds a RegisterBank tablegen class that can be used to declare the register
banks and an associated tablegen pass to generate the necessary code.

Reviewers: t.p.northover, ab, rovka, qcolombet

Subscribers: aditya_nandakumar, rengolin, kristof.beyls, vkalintiris, mgorny, dberris, llvm-commits, rovka

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292132 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-16 15:20:43 +00:00
Xin Tong
37b9de5028 Fix typos. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292092 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-16 03:41:09 +00:00
Serge Pavlov
69a1a20613 Reverted: Track validity of pass results
Commits r291882 and related r291887.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292062 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-15 10:23:18 +00:00
Daniel Jasper
a8933c2b2d Revert "[GlobalISel] track predecessor mapping during switch lowering."
This reverts commit r291973.

The test fails in a Release build with LLVM_BUILD_GLOBAL_ISEL enabled.
AFAICT, llc segfaults. I'll add a few more details to the original
commit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292061 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-15 09:41:49 +00:00
Chandler Carruth
d97514d79a [PM] Teach the optimization remarks emitter to handle invalidation
events.

This pass sometimes has a pointer to BlockFrequencyInfo so it needs
custom invalidation logic. It is also otherwise immutable so we can
reduce the number of invalidations that happen substantially.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292058 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-15 08:20:50 +00:00
Daniel Berlin
9aeadfb99d These two functions should be const. We often could detect it but this just makes it always true.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292057 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-15 07:40:51 +00:00
Lang Hames
b1e2ecc0ae [Orc][RPC] Add an RPCFunctionNotSupported error type and return it from
negotiateFunction where appropriate.

Replacing the old ECError with a custom type allows us to attach the name of
the function that could not be negotiated, enabling better diagnostics for
negotiation failures.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292055 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-15 06:34:25 +00:00
Chandler Carruth
10dd00ced5 [PM] Introduce an analysis set used to preserve all analyses over
a function's CFG when that CFG is unchanged.

This allows transformation passes to simply claim they preserve the CFG
and analysis passes to check for the CFG being preserved to remove the
fanout of all analyses being listed in all passes.

I've gone through and removed or cleaned up as many of the comments
reminding us to do this as I could.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292054 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-15 06:32:49 +00:00
Rui Ueyama
4b8b0ba562 PDB: Add a class to create the /names stream contents.
This patch adds a new class NameHashTableBuilder which creates /names streams.
This patch contains a test to confirm that a stream created by
NameHashTableBuilder can be read by NameHashTable reader class.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292040 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-15 00:36:02 +00:00
Chandler Carruth
15050a4c1e [PM] The assumption cache is fundamentally designed to be self-updating,
mark it as never invalidated in the new PM.

The old PM already required this to work, and after a discussion with
Hal this seems to really be the only sensible answer. The cache
gracefully degrades as the IR is mutated, and most things which do this
should already be incrementally updating the cache.

This gets rid of a bunch of logic preserving and testing the
invalidation of this analysis.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292039 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-15 00:26:18 +00:00
David Majnemer
fe78796b30 Adding const overloads of operator* and operator-> for DenseSet iterators
This fixes some problems when building ClangDiagnostics.cpp on Visual Studio 2017 RC. As far as I understand, there was a change in the implementation of the constructor for std::vector with two iterator parameters, which in our case causes an attempt to dereference const Iterator objects. Since there was no overload for a const Iterator, the compile would fail.

Patch by Hugo Puhlmann!

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292034 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-14 21:54:58 +00:00
Xin Tong
2472433b47 Delete duplicate word. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291999 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-14 05:51:36 +00:00
Eugene Zelenko
15ffebc95b Fix modules buildbots broken in r291983.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291985 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-14 01:07:05 +00:00
Eugene Zelenko
034cc87d1e [Transforms/Utils] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291983 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-14 00:32:38 +00:00
Easwaran Raman
65d7a8cd1c Compute summary before calling extractProfTotalWeight
extractProfTotalWeight checks if the profile type is sample profile, but
before that we have to ensure that summary is available. Also expanded
the unittest to test the case where there is no summar

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291982 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-14 00:32:37 +00:00
Justin Bogner
669e297a93 GlobalISel: Abort in ResetMachineFunctionPass if fallback isn't enabled
When GlobalISel is configured to abort rather than fallback the only
thing that resetting the machine function does is make things harder
to debug. If we ever get to this point in the abort configuration it
indicates that we've already hit a bug, so this changes the behaviour
to abort instead.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291977 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-13 23:46:11 +00:00
Tim Northover
b5ead7c450 [GlobalISel] track predecessor mapping during switch lowering.
Correctly populating Machine PHIs relies on knowing exactly how the IR level
CFG was lowered to MachineIR. This needs to be tracked by any translation
phases that meddle (currently only SwitchInst handling).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291973 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-13 23:11:37 +00:00
Greg Clayton
b24afca5be Add a variant of DWARFDie::find() and DWARFDie::findRecursively() that takes a llvm::ArrayRef<dwarf::Attribute>.
This allows us efficiently look for more than one attribute, something that is quite common in DWARF consumption.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291967 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-13 22:32:12 +00:00
Greg Clayton
beabb639c5 Cleanup how DWARFDie attributes are accessed and decoded.
Removed all DWARFDie::getAttributeValueAs*() calls.
Renamed:
  Optional<DWARFFormValue> DWARFDie::getAttributeValue(dwarf::Attribute);
To:
  Optional<DWARFFormValue> DWARFDie::find(dwarf::Attribute);
Added:
  Optional<DWARFFormValue> DWARFDie::findRecursively(dwarf::Attribute);
  
All decoding of Optional<DWARFFormValue> values are now done using the dwarf::to*() functions from DWARFFormValue.h:

Old code:
  
  auto DeclLine = DWARFDie.getAttributeValueAsSignedConstant(DW_AT_decl_line).getValueOr(0);
  
New code:

  auto DeclLine = toUnsigned(DWARFDie.find(DW_AT_decl_line), 0);
  
This composition helps us since we can now easily do:

  auto DeclLine = toUnsigned(DWARFDie.findRecursively(DW_AT_decl_line), 0);
  
This allows us to easily find attribute values in the current DIE only (the first new code above) or in any DW_AT_abstract_origin or DW_AT_specification Dies using the line above. Note that the code line length is shorter and more concise.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291959 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-13 21:08:18 +00:00
Malcolm Parsons
60f78e3e92 Remove unused lambda captures. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291916 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-13 17:12:16 +00:00
Ivan Krasin
d6d6b83a0b Revert r291903 and r291898. Reason: they break check-lld on the bots.
Summary:
Revert [ARM] Fix ubig32_t read in ARMAttributeParser

Now using support functions to read data instead of trying to
perform casts.
===========================================================

Revert [ARM] Enable objdump to construct triple for ARM

Now that The ARMAttributeParser has been moved into the library,
it has been modified so that it can parse the attributes without
printing them and stores them in a map. ELFObjectFile now queries
the attributes to fill out the architecture details of a provided
triple for 'arm' and 'thumb' targets. llvm-objdump uses this new
functionality.

Subscribers: llvm-commits, samparker, aemerson, mgorny

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291911 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-13 16:45:15 +00:00
Benjamin Kramer
1fb85c6675 Apply clang-tidy's performance-unnecessary-value-param to LLVM.
With some minor manual fixes for using function_ref instead of
std::function. No functional change intended.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291904 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-13 14:39:03 +00:00
Sam Parker
6968dd2f43 [ARM] Enable objdump to construct triple for ARM
Now that The ARMAttributeParser has been moved into the library,
it has been modified so that it can parse the attributes without
printing them and stores them in a map. ELFObjectFile now queries
the attributes to fill out the architecture details of a provided
triple for 'arm' and 'thumb' targets. llvm-objdump uses this new
functionality.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291898 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-13 11:04:21 +00:00
Sam Parker
93a4a6e681 [ARM] Moved ARMAttributeParser to Support
Moved ARMAttributeParser out of llvm-readobj and into the support
library.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291896 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-13 10:50:01 +00:00
Diana Picus
8a47810cd6 [CodeGen] Rename MachineInstrBuilder::addOperand. NFC
Rename from addOperand to just add, to match the other method that has been
added to MachineInstrBuilder for adding more than just 1 operand.

See https://reviews.llvm.org/D28057 for the whole discussion.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291891 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-13 09:58:52 +00:00
Diana Picus
0aacbaa851 [ARM] CodeGen: Remove AddDefaultPred. NFC.
Replace all uses of AddDefaultPred with MachineInstrBuilder::add(predOps()).
This makes the code building MachineInstrs more readable, because it allows us
to write code like:

MIB.addSomeOperand(blah)
   .add(predOps())
   .addAnotherOperand(blahblah)

instead of

AddDefaultPred(MIB.addSomeOperand(blah))
    .addAnotherOperand(blahblah)

This commit also adds the predOps helper in the ARM backend, as well as the add
method taking a variable number of operands to the MachineInstrBuilder.

The transformation has been done mostly automatically with a custom tool based
on Clang AST Matchers + RefactoringTool.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291890 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-13 09:37:56 +00:00
NAKAMURA Takumi
a24ffee2df DWARFDie.h: Move a class declaration out of the method description since r291861. [-Wdocumentation]
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291886 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-13 08:20:18 +00:00
Craig Topper
6ffcfe02df [IR] Don't call assertModuleIsMaterialized in release builds
Summary:
To fix a release vs debug build linking error, r259695 made the body of assertModuleIsMaterialized empty if Value.cpp gets compiled in a release build. This way any code compiled as a debug build can still link against a release version of the function.

This patch takes this a step farther and removes all calls to it from Value.h in any code that includes it in a relase build.

This shrinks the opt binary on my macbook build by 17240 bytes.

Reviewers: rafael

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291883 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-13 06:26:18 +00:00
Serge Pavlov
e77eb6a23d Track validity of pass results
Running tests with expensive checks enabled exhibits some problems with
verification of pass results.

First, the pass verification may require results of analysis that are not
available. For instance, verification of loop info requires results of dominator
tree analysis. A pass may be marked as conserving loop info but does not need to
be dependent on DominatorTreePass. When a pass manager tries to verify that loop
info is valid, it needs dominator tree, but corresponding analysis may be
already destroyed as no user of it remained.

Another case is a pass that is skipped. For instance, entities with linkage
available_externally do not need code generation and such passes are skipped for
them. In this case result verification must also be skipped.

To solve these problems this change introduces a special flag to the Pass
structure to mark passes that have valid results. If this flag is reset,
verifications dependent on the pass result are skipped.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291882 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-13 06:09:54 +00:00
Easwaran Raman
a2090aaaf9 ProfileSummaryInfo improvements.
* Add is{Hot|Cold}CallSite methods
* Fix a bug in isHotBB where it was looking for MD_prof on a return instruction
* Use MD_prof data only if sample profiling was used to collect profiles.
* Add an unit test to ProfileSummaryInfo

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291878 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-13 01:34:00 +00:00
NAKAMURA Takumi
72895656c7 Revert r291503, "Lift the 10-type limit for AlignedCharArrayUnion", and followings.
r291503, "Lift the 10-type limit for AlignedCharArrayUnion"
  r291514, "Fix MSVC build of AlignedCharArrayUnion"
  r291515, "Revert the attempt to optimize the constexpr functions. MSVC does not handle this yet"
  r291519, "Try once again to fix the MSVC build of AlignedCharArrayUnion"

They has been failing on i686-linux.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291875 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-13 01:13:10 +00:00
Greg Clayton
e377aa5d8f Add the ability to iterate across all attributes in a DIE.
Differential Revision: https://reviews.llvm.org/D28386



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291861 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-13 00:13:42 +00:00
Chris Bieneman
15135b3b8a [ObjectYAML] Pull yaml2dwarf out of yaml2obj for reuse
This patch pulls the yaml2dwarf code out of yaml2obj into a new set of DWARF emitter functions in the DWARFYAML namespace. This will enable the YAML->DWARF code to be used inside DWARF tests by populating the DWARFYAML structs and calling the Emitter functions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291828 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-12 21:35:21 +00:00
Robert Lougher
cecc5431c0 [DebugInfo] Handle same locations in DILocation::getMergedLocation
Revision 289661 introduced the function DILocation::getMergedLocation for
merging of debug locations. At the time is was simply a stub which always
returned no location. This patch modifies getMergedLocation to handle the
case where the two locations are the same or can't be discriminated.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291809 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-12 20:34:35 +00:00
Chad Rosier
4afed5d5d2 TTI: Add comment clarifying the meaning of MemIntrinsicInfo::PtrVal.
Patch by Tom Stellard.
Differential Revision: https://reviews.llvm.org/D27563

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291772 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-12 16:15:10 +00:00
Daniel Sanders
819f312880 [globalisel] Move as much RegisterBank initialization to the constructor as possible
Summary:
The register bank is now entirely initialized in the constructor. However,
we still have the hardcoded number of register classes which will be
dealt with in the TableGen patch (D27338) since we do not have access
to this information to resolve this at this stage. The number of register
classes is known to the TRI and to TableGen but the RegisterBank
constructor is too early for the former and too late for the latter.
This will be fixed when the data is tablegen-erated.

Reviewers: t.p.northover, ab, rovka, qcolombet

Subscribers: aditya_nandakumar, kristof.beyls, vkalintiris, llvm-commits, dberris

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291770 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-12 16:11:23 +00:00
Amjad Aboud
8c4ff10896 [DebugInfo] Added DI macro creation API to DIBuilder.
Differential Revision: https://reviews.llvm.org/D16077

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291769 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-12 15:49:46 +00:00
Daniel Sanders
6e712a22a6 [globalisel] Initialize RegisterBanks with static data.
Summary:
Refactor the RegisterBank initialization to use static data. This requires
GlobalISel implementations to rewrite calls to createRegisterBank() and
addRegBankCoverage() into a call to setRegBankData().

Out of tree targets can use diff 4 of D27807
(https://reviews.llvm.org/D27807?id=84117) to have addRegBankCoverage() dump
the register classes and other data that needs to be provided to
setRegBankData(). This is the method that was used to generate the static data
in this patch.

Tablegen-eration of this static data will follow after some refactoring.

Reviewers: t.p.northover, ab, rovka, qcolombet

Subscribers: aditya_nandakumar, kristof.beyls, vkalintiris, llvm-commits, dberris

Differential Revision: https://reviews.llvm.org/D27807
Differential Revision: https://reviews.llvm.org/D27808



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291768 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-12 15:32:10 +00:00
Piotr Padlewski
4e1eef1855 [Devirtualization] MemDep returns non-local !invariant.group dependencies
Summary:
Memory Dependence Analysis was limited to return only local dependencies
for invariant.group handling. Now it returns NonLocal when it finds it
and then by asking getNonLocalPointerDependency we get found dep.

Thanks to this we are able to devirtualize loops!

    void indirect(A &a, int n) {
      for (int i = 0 ; i < n; i++)
        a.foo();

    }
    void test(int n) {
      A a;
      indirect(a);
    }

After inlining a.foo() will be changed to direct call, even if foo and A::A()
is external (but only if vtable definition is be available).

Reviewers: nlewycky, dberlin, chandlerc, rsmith

Subscribers: mehdi_amini, davide, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291762 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-12 11:33:58 +00:00
Simon Pilgrim
dfe0691ff4 Wdocumentation fix
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291761 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-12 11:21:56 +00:00
Zachary Turner
4509ae413a [CodeView] Finish decoupling TypeDatabase from TypeDumper.
Previously the type dumper itself was passed around to a lot of different
places and manipulated in ways that were more appropriate on the type
database. For example, the entire TypeDumper was passed into the symbol
dumper, when all the symbol dumper wanted to do was lookup the name of a
TypeIndex so it could print it. That's what the TypeDatabase is for --
mapping type indices to names.

Another example is how if the user runs llvm-pdbdump with the option to
dump symbols but not types, we still have to visit all types so that we
can print minimal information about the type of a symbol, but just without
dumping full symbol records. The way we did this before is by hacking it
up so that we run everything through the type dumper with a null printer,
so that the output goes to /dev/null. But really, we don't need to dump
anything, all we want to do is build the type database. Since
TypeDatabaseVisitor now exists independently of TypeDumper, we can do
this. We just build a custom visitor callback pipeline that includes a
database visitor but not a dumper.

All the hackery around printers etc goes away. After this patch, we could
probably even delete the entire CVTypeDumper class since really all it is
at this point is a thin wrapper that hides the details of how to build a
useful visitation pipeline. It's not a priority though, so CVTypeDumper
remains for now.

After this patch we will be able to easily plug in a different style of
type dumper by only implementing the proper visitation methods to dump
one-line output and then sticking it on the pipeline.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291724 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-11 23:24:22 +00:00
Peter Collingbourne
799d7f0370 LowerTypeTests: Represent the memory region size with the constant size-1.
This means that we can use a shorter instruction sequence in the case where
the size is a power of two and on the boundary between two representations.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291706 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-11 21:32:10 +00:00
Peter Collingbourne
1d8008b2d3 Re-apply r291205, "LowerTypeTests: Split the pass in two: a resolution phase and a lowering phase.", with a fix for an off-by-one error.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291699 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-11 20:28:46 +00:00
Rong Xu
6d80fe73c6 Resubmit "[PGO] Turn off comdat renaming in IR PGO by default"
This patch resubmits the changes in r291588.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291696 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-11 20:19:41 +00:00
David Blaikie
ae69f7de68 Make some operator bools explicit for sanity/safety.
There are a couple left in bool-like containers (BitVector, etc) where
the implicit conversions seem more suitable - though it might be worth
considering explicitifying those too.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291694 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-11 19:47:16 +00:00
Greg Clayton
a9a480efd1 Remove all variants of DWARFDie::getAttributeValueAs...() that had parameters that specified default values.
Now we only support returning Optional<> values and have changed all clients over to use Optional::getValueOr().

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291686 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-11 17:43:37 +00:00
Ivan Krasin
52a39de25f Revert rL291205 because it breaks Chrome tests under CFI.
Summary:
Revert LowerTypeTests: Split the pass in two: a resolution phase and a lowering phase.

This change separates how type identifiers are resolved from how intrinsic
calls are lowered. All information required to lower an intrinsic call
is stored in a new TypeIdLowering data structure. The idea is that this
data structure can either be initialized using the module itself during
regular LTO, or using the module summary in ThinLTO backends.

Original URL: https://reviews.llvm.org/D28341

Reviewers: pcc

Subscribers: mehdi_amini, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291684 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-11 16:54:04 +00:00
George Rimar
bdfaae10c4 [lib/Object] - Introduce Decompressor class.
Decompressor intention is to reduce duplication of code.
Currently LLD has own implementation of decompressor
for compressed debug sections.

This class helps to avoid it and share the code.
LLD patch for reusing it is D28106

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291675 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-11 15:26:41 +00:00
Hal Finkel
a6e44bd635 Make processing @llvm.assume more efficient - Add affected values to the assumption cache
Here's my second try at making @llvm.assume processing more efficient. My
previous attempt, which leveraged operand bundles, r289755, didn't end up
working: it did make assume processing more efficient but eliminating the
assumption cache made ephemeral value computation too expensive. This is a
more-targeted change. We'll keep the assumption cache, but extend it to keep a
map of affected values (i.e. values about which an assumption might provide
some information) to the corresponding assumption intrinsics. This allows
ValueTracking and LVI to find assumptions relevant to the value being queried
without scanning all assumptions in the function. The fact that ValueTracking
started doing O(number of assumptions in the function) work, for every
known-bits query, has become prohibitively expensive in some cases.

As discussed during the review, this is a pragmatic fix that, longer term, will
likely be replaced by a more-principled solution (perhaps based on an extended
SSA form).

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291671 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-11 13:24:24 +00:00
Chandler Carruth
c68d25fb58 [PM] Separate the LoopAnalysisManager from the LoopPassManager and move
the latter to the Transforms library.

While the loop PM uses an analysis to form the IR units, the current
plan is to have the PM itself establish and enforce both loop simplified
form and LCSSA. This would be a layering violation in the analysis
library.

Fundamentally, the idea behind the loop PM is to *transform* loops in
addition to running passes over them, so it really seemed like the most
natural place to sink this was into the transforms library.

We can't just move *everything* because we also have loop analyses that
rely on a subset of the invariants. So this patch splits the the loop
infrastructure into the analysis management that has to be part of the
analysis library, and the transform-aware pass manager.

This also required splitting the loop analyses' printer passes out to
the transforms library, which makes sense to me as running these will
transform the code into LCSSA in theory.

I haven't split the unittest though because testing one component
without the other seems nearly intractable.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291662 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-11 09:43:56 +00:00
Mohammed Agabaria
9c6b24cc3a [X86] updating TTI costs for arithmetic instructions on X86\SLM arch.
updated instructions:
pmulld, pmullw, pmulhw, mulsd, mulps, mulpd, divss, divps, divsd, divpd, addpd and subpd.

special optimization case which replaces pmulld with pmullw\pmulhw\pshuf seq. 
In case if the real operands bitwidth <= 16.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291657 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-11 08:23:37 +00:00
Dean Michael Berris
14cdbca6b8 [XRay] Define the library for XRay trace logs
Summary:
In this change we move the definition of the log reading routines from
the tools directory in LLVM to {include/llvm,lib}/XRay. We improve the
documentation a little bit for the publicly accessible headers, and
adjust the top-matter. This also leads to some refactoring and cleanup
in the tooling code.

In particular, we do the following:

  - Rename the class from LogReader to Trace, as it better represents
    the logical set of records as opposed to a log.
  - Use file type detection instead of asking the user to say what
    format the input file is. This allows us to keep the interface
    simple and encapsulate the logic of loading the data appropriately.

In future changes we increase the API surface and write dedicated unit
tests for the XRay library.

Depends on D24376.

Reviewers: dblaikie, echristo

Subscribers: mehdi_amini, mgorny, llvm-commits, varno

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291652 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-11 06:39:09 +00:00
Chandler Carruth
d27a39a962 [PM] Rewrite the loop pass manager to use a worklist and augmented run
arguments much like the CGSCC pass manager.

This is a major redesign following the pattern establish for the CGSCC layer to
support updates to the set of loops during the traversal of the loop nest and
to support invalidation of analyses.

An additional significant burden in the loop PM is that so many passes require
access to a large number of function analyses. Manually ensuring these are
cached, available, and preserved has been a long-standing burden in LLVM even
with the help of the automatic scheduling in the old pass manager. And it made
the new pass manager extremely unweildy. With this design, we can package the
common analyses up while in a function pass and make them immediately available
to all the loop passes. While in some cases this is unnecessary, I think the
simplicity afforded is worth it.

This does not (yet) address loop simplified form or LCSSA form, but those are
the next things on my radar and I have a clear plan for them.

While the patch is very large, most of it is either mechanically updating loop
passes to the new API or the new testing for the loop PM. The code for it is
reasonably compact.

I have not yet updated all of the loop passes to correctly leverage the update
mechanisms demonstrated in the unittests. I'll do that in follow-up patches
along with improved FileCheck tests for those passes that ensure things work in
more realistic scenarios. In many cases, there isn't much we can do with these
until the loop simplified form and LCSSA form are in place.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291651 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-11 06:23:21 +00:00
Adam Nemet
f5fda305e6 [LICM] Report failing to hoist a load with an invariant address
These are interesting because lack of precision in alias information
could be standing in the way of this optimization.

An example is the case in the test suite that I showed in the DevMeeting
talk:

http://lab.llvm.org:8080/artifacts/opt-view_test-suite/build/MultiSource/Benchmarks/FreeBench/distray/CMakeFiles/distray.dir/html/_org_test-suite_MultiSource_Benchmarks_FreeBench_distray_distray.c.html#L236

canSinkOrHoistInst is also used from LoopSink, which does not use
opt-remarks so we need to take ORE as an optional argument.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291648 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-11 04:39:45 +00:00
Adam Nemet
468290d338 Fix typo in comment
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291647 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-11 04:39:41 +00:00
Adam Nemet
a162766bd7 [LICM] Report successful hoist/sink/promotion
Differential Revision: https://reviews.llvm.org/D27938

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291646 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-11 04:39:35 +00:00
Eugene Zelenko
bdf370d28b [Target] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291641 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-11 01:45:03 +00:00
Zachary Turner
bfe8722e9e Remove unused field.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291633 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-11 00:56:53 +00:00
Quentin Colombet
7249f505bd [RegBankSelect] Improve the output of the debug messages.
Add more information about mapping cost and chosen solution.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291629 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-11 00:48:41 +00:00
Zachary Turner
eb6ab04fb2 [CodeView/PDB] Rename a bunch of files.
We were starting to get some name clashes between llvm-pdbdump
and the common CodeView framework, so I took this opportunity
to rename a bunch of files to more accurately describe their
usage.  This also helps in llvm-pdbdump to distinguish
between different files and whether they are used for pretty
dump mode or raw dump mode.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291627 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-11 00:35:43 +00:00
Zachary Turner
e85dd39ac9 [CodeView] Add TypeDatabase class.
This creates a centralized class in which to store type records.
It stores types as an array of entries, which matches the
notion of a type stream being a topologically sorted DAG.
Logic to build up such a database was already being used in
CVTypeDumper, so CVTypeDumper is now updated to to read from
a TypeDatabase which is filled out by an earlier visitor in
the pipeline.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291626 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-11 00:35:08 +00:00
Zachary Turner
70b1ff1543 Add better documentation for iterator facade subclasses.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291625 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-11 00:34:41 +00:00
Matt Arsenault
1f4353fb62 InstSimplify: Eliminate fabs on known positive
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291624 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-11 00:33:24 +00:00
Rong Xu
de4116d55c Revert "[PGO] Turn off comdat renaming in IR PGO by default"
This patch reverts r291588: [PGO] Turn off comdat renaming in IR PGO by default,
as we are seeing some hash mismatches in our internal tests.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291621 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-10 23:54:31 +00:00
Justin Lebar
e9bf848e46 [TM] Restore default TargetOptions in TargetMachine::resetTargetOptions.
Summary:
Previously if you had

 * a function with the fast-math-enabled attr, followed by
 * a function without the fast-math attr,

the second function would inherit the first function's fast-math-ness.

This means that mixing fast-math and non-fast-math functions in a module
was completely broken unless you explicitly annotated every
non-fast-math function with "unsafe-fp-math"="false".  This appears to
have been broken since r176986 (March 2013), when the resetTargetOptions
function was introduced.

This patch tests the correct behavior as best we can.  I don't think I
can test FPDenormalMode and NoTrappingFPMath, because they aren't used
in any backends during function lowering.  Surprisingly, I also can't
find any uses at all of LessPreciseFPMAD affecting generated code.

The NVPTX/fast-math.ll test changes are an expected result of fixing
this bug.  When FMA is disabled, we emit add as "add.rn.f32", which
prevents fma combining.  Before this patch, fast-math was enabled in all
functions following the one which explicitly enabled it on itself, so we
were emitting plain "add.f32" where we should have generated
"add.rn.f32".

Reviewers: mkuper

Subscribers: hfinkel, majnemer, jholewinski, nemanjai, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291618 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-10 23:43:04 +00:00
Florian Hahn
2fa5ad0ad4 [loop-unroll] Factor out code to update LoopInfo (NFC).
Move the code to update LoopInfo for cloned basic blocks to
addClonedBlockToLoopInfo, as suggested in 
https://reviews.llvm.org/D28482.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291614 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-10 23:24:54 +00:00
Reid Kleckner
7b6850372e Move the section name from GlobalObject to the LLVMContext
Summary:
Convention wisdom says that bytes in Function are precious, and the
vast, vast majority of globals do not live in special sections. Even
when they do, they tend to live in the same section. Store the section
name on the LLVMContext in a StringSet, and maintain a map from
GlobalObject* to section name like we do for metadata, prefix data, etc.

The fact that we've survived this long wasting at least three pointers
of space in Function suggests that Function bytes are perhaps not as
precious as we once thought. Given that most functions have metadata
attachments when debug info is enabled, we might consider adding a
pointer here to make that access more efficient.

Reviewers: jlebar, dexonsmith, mehdi_amini

Subscribers: mehdi_amini, aprantl, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291613 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-10 23:23:58 +00:00
Matt Arsenault
d8c5040a18 Remove unused CONVERT_RNDSAT intrinsics
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291607 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-10 22:38:02 +00:00
Matt Arsenault
fa5aafaac2 DAG: Avoid OOB when legalizing vector indexing
If a vector index is out of bounds, the result is supposed to be
undefined but is not undefined behavior. Change the legalization
for indexing the vector on the stack so that an out of bounds
index does not create an out of bounds memory access.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291604 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-10 22:02:30 +00:00
Victor Leschuk
d9df13befc DebugInfo: support for DW_FORM_implicit_const
Support for DW_FORM_implicit_const DWARFv5 feature.
When this form is used attribute value goes to .debug_abbrev section (as SLEB).
As this form would break any debug tool which doesn't support DWARFv5
it is guarded by dwarf version check. Attempt to use this form with
dwarf version <= 4 is considered a fatal error.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291599 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-10 21:18:26 +00:00
Rong Xu
2cf892fefa [PGO] Turn off comdat renaming in IR PGO by default
Summary:
In IR PGO we append the function hash to comdat functions to avoid the
potential hash mismatch. This turns out not legal in some cases: if the comdat
function is address-taken and used in comparison. Renaming changes the semantic.

This patch turns off comdat renaming by default.

To alleviate the hash mismatch issue, we now rename the profile variable
for comdat functions. Profile allows co-existing multiple versions of profiles
with different hash value. The inlined copy will always has the correct profile
counter. The out-of-line copy might not have the correct count. But we will
not have the bogus mismatch warning.

Reviewers: davidxl

Subscribers: llvm-commits, xur

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291588 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-10 19:30:20 +00:00
Chad Rosier
ef64b17169 [ARM] Remove rbit intrinsics and autoupgrade to generic bitreverse.
Testing already covered by CodeGen/ARM/rbit.ll

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291587 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-10 19:23:51 +00:00
Chad Rosier
33d492eb19 [AArch64] Add support for lowering bitreverse to the rbit instruction.
Differential Revision: https://reviews.llvm.org/D28379

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291575 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-10 17:20:33 +00:00
Chris Bieneman
6c9c3a7a3c [ObjectYAML] Support for DWARF line tables
One more try... relanding r291541 with a fix to properly gate MaxOpsPerInst on DWARF version.

Description from r291541:

This patch re-lands r291470, which failed on Linux bots. The issue (I believe) was undefined behavior because the size of llvm::dwarf::LineNumberOps was not explcitly specified or consistently respected. The updated patch adds an explcit underlying type to the enum and preserves the size more correctly.

Original description:

This patch adds support for the DWARF debug_lines section. The line table state machine opcodes are preserved, so this can be used to test the state machine evaluation directly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291546 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-10 06:22:49 +00:00
Chris Bieneman
2d737382e2 Revert "[ObjectYAML] Support for DWARF line tables"
This reverts commit r291541.

Still failing on a bot:

http://bb.pgr.jp/builders/cmake-llvm-x86_64-linux/builds/47224/steps/test_llvm/logs/stdio

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291542 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-10 05:31:23 +00:00
Chris Bieneman
e8209239b1 [ObjectYAML] Support for DWARF line tables
This patch re-lands r291470, which failed on Linux bots. The issue (I believe) was undefined behavior because the size of llvm::dwarf::LineNumberOps was not explcitly specified or consistently respected. The updated patch adds an explcit underlying type to the enum and preserves the size more correctly.

Original description:

This patch adds support for the DWARF debug_lines section. The line table state machine opcodes are preserved, so this can be used to test the state machine evaluation directly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291541 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-10 05:25:24 +00:00
Serge Pavlov
b2ae9e2c45 [StructurizeCfg] Update dominator info.
In some cases StructurizeCfg updates root node, but dominator info
remains unchanges, it causes crash when expensive checks are enabled.
To cope with this problem a new method was added to DominatorTreeBase
that allows adding new root nodes, it is called in StructurizeCfg to
put dominator tree in sync.

This change fixes PR27488.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291530 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-10 02:50:47 +00:00
Reid Kleckner
edab6023d7 Try once again to fix the MSVC build of AlignedCharArrayUnion
It was complaining about ambiguity between llvm::detail and
llvm::support::detail:
  error C2872: 'detail': ambiguous symbol
  note: could be 'llvm::detail'
  note: or       'llvm::support::detail'

Standardize on llvm::support::detail to hide these symbols further.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291519 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-10 01:05:33 +00:00
Reid Kleckner
e444a76147 Revert the attempt to optimize the constexpr functions. MSVC does not handle this yet
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291515 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-10 00:29:05 +00:00
Reid Kleckner
178be5db99 Fix MSVC build of AlignedCharArrayUnion
Use constexpr recursion for alignof like we do for sizeof. Seems to work
with Clang and MSVC. Also, don't recurse twice to avoid slowdowns in
compilers that don't memoize constexpr results (Clang).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291514 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-10 00:26:56 +00:00
Sean Callanan
48a2a277e6 Lift the 10-type limit for AlignedCharArrayUnion
This patch uses C++11 parameter packs and constexpr functions
to allow AlignedCharArrayUnion to hold an arbitrary number of
types.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291503 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-09 23:23:25 +00:00
Rafael Espindola
cf230cb30a Support outputting to /dev/null.
When writing to a non regular file we cannot rename to it. Since we
have to write, we may as well create a temporary file to avoid trying
to create an unique file in /dev when trying to write to /dev/null.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291485 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-09 21:52:35 +00:00
Chris Bieneman
67c28b0349 Revert "[ObjectYAML] Support for DWARF line tables"
This reverts commit r291470 due to failing bots:

http://bb.pgr.jp/builders/cmake-llvm-x86_64-linux/builds/47209/steps/test_llvm/logs/stdio

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291471 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-09 20:04:55 +00:00
Chris Bieneman
b7b948cda3 [ObjectYAML] Support for DWARF line tables
This patch adds support for the DWARF debug_lines section. The line table state machine opcodes are preserved, so this can be used to test the state machine evaluation directly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291470 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-09 20:01:37 +00:00
Sanjay Patel
3f06747367 fix comment typos; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291447 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-09 16:27:56 +00:00
Mohammed Agabaria
a2d2e19c17 [IR] Adding const_value_op_iterator for IR/User.h
const value op iterator is missing from User.h class.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291443 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-09 14:00:57 +00:00
Chandler Carruth
f7babeb5d8 [PM] Teach SCEV to invalidate itself when its dependencies become
invalid.

This fixes use-after-free bugs that will arise with any interesting use
of SCEV.

I've added a dedicated test that works diligently to trigger these kinds
of bugs in the new pass manager and also checks for them explicitly as
well as triggering ASan failures when things go squirly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291426 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-09 07:44:34 +00:00
Rui Ueyama
d9a8ccc226 Define sys::path::convert_to_slash
This patch moves convertToUnixPathSeparator from LLD to LLVM.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291414 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-09 01:47:15 +00:00
Lang Hames
c103185b6b [Orc][RPC] Lock the pending results data structure when installing new result
handlers, make abandonPendingResults public API.

This should make installing asynchronous result handlers thread safe.

The abandonPendingResults method is made public so that clients can disconnect
from a remote even if they have asynchronous handlers awaing results from that
remote. The asynchronous handlers will all receive "abandoned result" errors as
their argument.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291399 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-08 20:09:35 +00:00
Lang Hames
b15738d320 [Orc][RPC] Add an APICalls utility for grouping RPC funtions for registration.
APICalls allows groups of functions to be composed into an API that can be
registered as a unit with an RPC endpoint. Doing registration on a-whole API
basis (rather than per-function) allows missing API functions to be detected
early.

APICalls also allows Function membership to be tested at compile-time. This
allows clients to write static assertions that functions to be called are
members of registered APIs.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291380 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-08 01:13:47 +00:00
Lang Hames
f83ef1736f [Orc][RPC] Add a class-method version of addHandler to MultiThreadedRPCEndpoint.
This brings MultiThreadedRPCEndpoint's addHandler API in-line with
SingleThreadedRPCEndpoint's.

This will be tested in an up-coming unit-test for MultiThreadedRPCEndpoint.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291376 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-08 00:18:51 +00:00
Lang Hames
2caf90de45 [Orc][RPC] Rename Single/MultiThreadedRPC to Single/MultithreadedRPCEndpoint.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291374 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-07 22:48:12 +00:00
Lang Hames
5cc5534752 [Orc][RPC] Remove a redundant 'if' statement.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291373 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-07 22:27:52 +00:00
Peter Collingbourne
260cfbc963 LowerTypeTests: Thread summary and action from the API and command line into the pass.
Also move command line handling out of the pass constructor and into
a separate function.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291323 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-07 01:17:24 +00:00
Mehdi Amini
9cb6a18769 Remove useless Forward Declaration from header (NFC)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291321 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-07 00:57:43 +00:00
Quentin Colombet
d87ddcb9f0 [MachineBasicBlock] Add a non-assert live-in accessor for debug mode.
With r291169, it is now not possible to access the live-in information
when the liveness is not properly tracked. Although this is want we want
in general, for debugging purpose we may want to still be able to
traverse this information even if it may not be accurate.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291317 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-07 00:46:30 +00:00
Jacob Gravelle
da319ede9a Test commit. Comment formatting, it's -> its.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291312 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-07 00:22:31 +00:00
Peter Collingbourne
64d3b81d23 ModuleSummaryIndexYAML: Make a few fields optional to make it easier to write tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291307 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-07 00:00:22 +00:00
Justin Lebar
41b68ffb50 [PM] Edit comments on PM Proxy and utility classes.
Reviewers: chandlerc

Subscribers: mehdi_amini, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291301 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-06 23:32:02 +00:00
Zachary Turner
ef3cdbf49f Convert MSF Stream iterators to use llvm iterator facade.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291290 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-06 22:05:12 +00:00
Lang Hames
5d6908ca72 [Orc][RPC] Fix an obvious locking-order bug in RawByteChannel::startSendMessage.
The lock needs to be acquired before the data is sent, not afterwards. This
think-o slipped in during the refactor in r286620, but went unnoticed as the
resulting bug only manifests in multi-threaded clients (of which there are none
in-tree).

No unit test as the bug depends on thread scheduling.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291216 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-06 06:22:31 +00:00
Rui Ueyama
fd456e365e Add a class to create a tar archive file.
In LLD, we create cpio archive files for --reproduce command.
cpio was not a bad choice because it is very easy to create, but
it was sometimes hard to use because people are not familiar with
cpio command.

I noticed that creating a tar archive isn't as hard as I thought.
So I implemented it in this patch.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291209 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-06 02:29:48 +00:00
Peter Collingbourne
d99c988733 LowerTypeTests: Split the pass in two: a resolution phase and a lowering phase.
This change separates how type identifiers are resolved from how intrinsic
calls are lowered. All information required to lower an intrinsic call
is stored in a new TypeIdLowering data structure. The idea is that this
data structure can either be initialized using the module itself during
regular LTO, or using the module summary in ThinLTO backends.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291205 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-06 02:22:47 +00:00
Greg Clayton
d1f6d693d6 Add iterator support to DWARFDie to allow child DIE iteration.
Differential Revision: https://reviews.llvm.org/D28303



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291194 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-05 23:47:37 +00:00
Teresa Johnson
a4ca999339 ThinLTO: add early "dead-stripping" on the Index
Summary:
Using the linker-supplied list of "preserved" symbols, we can compute
the list of "dead" symbols, i.e. the one that are not reachable from
a "preserved" symbol transitively on the reference graph.
Right now we are using this information to mark these functions as
non-eligible for import.

The impact is two folds:
- Reduction of compile time: we don't import these functions anywhere
  or import the function these symbols are calling.
- The limited number of import/export leads to better internalization.

Patch originally by Mehdi Amini.

Reviewers: mehdi_amini, pcc

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291177 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-05 21:34:18 +00:00
Joerg Sonnenberger
44b0ebe8a3 PR 31534: When emitting both DWARF unwind tables and debug information,
do not use .cfi_sections. This requires checking if any non-declaration
function in the module needs an unwind table.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291172 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-05 20:55:28 +00:00
Matthias Braun
4700463eb1 CodeGen: Assert that liveness is up to date when reading block live-ins.
Add an assert that checks whether liveins are up to date before they are
used.

- Do not print liveins into .mir files anymore in situations where they
  are out of date anyway.
- The assert in the RegisterScavenger is superseded by the new one in
  livein_begin().
- Skip parts of the liveness updating logic in IfConversion.cpp when
  liveness isn't tracked anymore (just enough to avoid hitting the new
  assert()).

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291169 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-05 20:01:19 +00:00
Simon Pilgrim
281d15cdbf Wdocumentation fix
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291114 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-05 14:58:54 +00:00
Teresa Johnson
05a63063fd [ThinLTO] Update new ModuleSummaryIndexYAML.h for r291108
Should fix bot failures due to r291108 which happened due to a
change required in ModuleSummaryIndexYAML.h which was just added in
r291069.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291111 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-05 14:40:15 +00:00
Teresa Johnson
e4e6279a08 [ThinLTO] Subsume all importing checks into a single flag
Summary:
This adds a new summary flag NotEligibleToImport that subsumes
several existing flags (NoRename, HasInlineAsmMaybeReferencingInternal
and IsNotViableToInline). It also subsumes the checking of references
on the summary that was being done during the thin link by
eligibleForImport() for each candidate. It is much more efficient to
do that checking once during the per-module summary build and record
it in the summary.

Reviewers: mehdi_amini

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291108 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-05 14:32:16 +00:00
Mohammed Agabaria
6bf7471dbc Currently isLikelyComplexAddressComputation tries to figure out if the given stride seems to be 'complex' and need some extra cost for address computation handling.
This code seems to be target dependent which may not be the same for all targets.
Passed the decision whether the given stride is complex or not to the target by sending stride information via SCEV to getAddressComputationCost instead of 'IsComplex'.

Specifically at X86 targets we dont see any significant address computation cost in case of the strided access in general.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291106 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-05 14:03:41 +00:00
Kristof Beyls
3c2073e562 [GlobalISel] Add support for switch statements
This commit does this using a trivial chain of conditional branches.  In the
future, we probably want to reuse the optimized switch lowering used in
SelectionDAG.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291099 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-05 11:28:51 +00:00
Saleem Abdulrasool
50116a25c6 MC: support passing search paths to the IAS
This is needed to support inclusion in inline assembly via the
`.include` directive.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291085 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-05 05:56:39 +00:00
Peter Collingbourne
87a14201c5 Tentative fix for modules build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291079 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-05 04:40:09 +00:00
Peter Collingbourne
0e1ad99844 Fix build bots.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291073 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-05 04:00:09 +00:00
Peter Collingbourne
405b044247 IR: Module summary representation for type identifiers; summary test scaffolding for lowertypetests.
Set up basic YAML I/O support for module summaries, plumb the summary into
the pass and add a few command line flags to test YAML I/O support. Bitcode
support to come separately, as will the code in LowerTypeTests that actually
uses the summary. Also add a couple of tests that pass by virtue of the pass
doing nothing with the summary (which happens to be the correct thing to do
for those tests).

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291069 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-05 03:39:00 +00:00
Chandler Carruth
4125a9aec7 [PM] Fix a typo in a comment that Davide spotted in another code review.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291066 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-05 03:10:26 +00:00
Justin Lebar
9b6443b451 [PM] Edit comments in PassManager.h.
Summary:
This covers most of PassManager.h, up to the introduction of inner/outer
analysis proxies.

If there's a theme to these changes, it's simplifying the language.  For
example:

  * PreservedAnalyses is a "set of analyses", not an "abstract set".
    "Abstract" doesn't have any particular meaning here.

  * "Build types for the concept types" becomes "define the concept types".

  * Instead of "data structures optimized for pointer-like types using
    the alignment-provided low bits", say "data structures that use the
    low bits of pointers."

  * "Clear the map pointing into the results list" becomes
    "Delete the map entries that point into the results list."

This patch also fixes a few places where we referred to "function" and
"module" pass/analysis managers, instead of the more abstract "IRUnitT"
PM/AMs we have now.

Subscribers: mehdi_amini

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291040 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-05 00:12:51 +00:00
Mehdi Amini
d0ad0ebd88 Change BitstreamCursor::skipRecord to return the record code (NFC)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291026 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-04 22:54:14 +00:00
David Blaikie
253e6b65d4 Fixup some header includes from recent IntrusiveRefCntPtr cleanup.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291024 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-04 22:52:00 +00:00
David Blaikie
0581f9f375 Reapply "Make BitCodeAbbrev ownership explicit using shared_ptr rather than IntrusiveRefCntPtr""
If this is a problem for anyone (shared_ptr is two pointers in size,
whereas IntrusiveRefCntPtr is 1 - and the ref count control block that
make_shared adds is probably larger than the one int in RefCountedBase)
I'd prefer to address this by adding a lower-overhead version of
shared_ptr (possibly refactoring IntrusiveRefCntPtr into such a thing)
to avoid the intrusiveness - this allows memory ownership to remain
orthogonal to types and at least to me, seems to make code easier to
understand (since no implicit ownership acquisition can happen).

This recommits 291006, reverted in r291007.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291016 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-04 22:36:33 +00:00
David Blaikie
4e9e4f277a Fix some buildbot issues with const objects with default ctors
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291013 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-04 21:59:22 +00:00
David Blaikie
23e393fa4d Revert "Make BitCodeAbbrev ownership explicit using shared_ptr rather than IntrusiveRefCntPtr"
Breaks Clang's use of bitcode. Reverting until I have a fix to go with
it there.

This reverts commit r291006.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291007 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-04 21:19:28 +00:00
David Blaikie
fe94ca2934 Make BitCodeAbbrev ownership explicit using shared_ptr rather than IntrusiveRefCntPtr
If this is a problem for anyone (shared_ptr is two pointers in size,
whereas IntrusiveRefCntPtr is 1 - and the ref count control block that
make_shared adds is probably larger than the one int in RefCountedBase)
I'd prefer to address this by adding a lower-overhead version of
shared_ptr (possibly refactoring IntrusiveRefCntPtr into such a thing)
to avoid the intrusiveness - this allows memory ownership to remain
orthogonal to types and at least to me, seems to make code easier to
understand (since no implicit ownership acquisition can happen).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291006 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-04 21:13:35 +00:00
David Blaikie
9e836572ec Remove unnecessary intrusive ref counting in favor of std::shared_ptr/make_shared
The intrusive nature of the reference counting is not required/used
here, so simplify the ownership model to make the code easier to
understand.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291005 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-04 21:13:28 +00:00
Peter Collingbourne
7108b15810 YAML: Remove Input::MapHNode::isValidKey(), use llvm::is_contained() instead. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290999 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-04 20:10:43 +00:00
David Blaikie
d4b95bb307 ADT: IntrusiveRefCntPtr: Broaden the definition of correct usage of RefCountedBase
This roughly matches the semantics of std::enable_shared_from_this - that it
does not dictate the ownership model of all users, but constrains those users
taking advantage of the intrusive nature to do so only when there's a guarantee
that that's the ownership model being used for the object being passed.

Reviewers: jlebar

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290987 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-04 18:57:31 +00:00
Sanjay Patel
6aec022dd7 fix comment formatting; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290980 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-04 18:16:43 +00:00
Jan Vesely
bf64cb107c AMDGPU/SI: Implement sendmsghalt intrinsic
v2: expose using amdgcn prefix

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290977 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-04 18:06:55 +00:00
Chandler Carruth
da53be3666 [ADT] Speculative attempt to fix build bot issues with r290952.
This just removes the usage of llvm::reverse and llvm::seq. That makes
it harder to handle the empty case correctly and so I've also added
a test there.

This is just a shot in the dark at what might be behind the buildbot
failures. I can't reproduce any issues locally including with ASan...
I feel like I'm missing something...

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290954 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-04 11:40:18 +00:00
Chandler Carruth
564b1d1f44 [ADT] Enhance the PriorityWorklist to support bulk insertion.
This is both convenient and more efficient as we can skip any
intermediate reallocation of the vector.

This usage pattern came up in a subsequent patch on the pass manager,
but it seems generically useful so I factored it out and added unittests
here.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290952 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-04 11:13:11 +00:00
Bjorn Pettersson
cd91cb1b42 Fix for InlineSpiller accessing not updated dom tree base information.
Summary:
The InlineSpiller was accessing the DominatorTreeBase directly
through the public data member DT in the MachineDominatorTree.
This is not a good idea as the "cached" information in
SplitCriticalEdges is not applied before the access.
The DominatorTreeBase must be accessed through the member
function getBase() in MachineDominatorTree.

The fault was introduced in r266162.

I think the public data member DT in the MachineDominatorTree
should have been made private in the original code (r215576)
that introduced the concept of lazily updating the
MachineDominatorTree information from
MachineBasicBlock::SplitCriticalEdge().

Patch by Karl-Johan Karlsson <karl-johan.karlsson@ericsson.com>

Reviewers: wmi, qcolombet

Subscribers: llvm-commits, bjope, uabelho

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290950 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-04 09:41:56 +00:00
Peter Collingbourne
308b6dabdf Support: Add YAML I/O support for custom mappings.
This will be used to YAMLify parts of the module summary.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290935 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-04 03:51:36 +00:00
Eric Christopher
fdd19a37e7 On a 64-bit system, the DWARFDebugLine::Row struct is 32 bytes. Each field has the following byte offsets:
0-7: Address
8-11: Line
12-13: Column
14-15: File
16-19: Isa
20-23: Discriminator
24+: bit fields

The packing is fine until the "Isa" field, which is an 8-bit int that occupies 4 bytes. We can instead move Discriminator into the 16-19 slot, and pack Isa into the 20-23 range along with the bit fields:

0-7: Address
8-11: Line
12-13: Column
14-15: File
16-19: Discriminator
20-23: Isa + bit fields

This layout is only 24 bytes. This 25% reduction in size may seem small but a large binary can have line tables with thousands of rows stored in a vector.

Patch by Simon Que!

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290931 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-04 02:34:29 +00:00
Craig Topper
a3ed852d30 [AVX-512] Remove vinsert intrinsics and autoupgrade to native shufflevectors. There are some codegen problems here that I'll try to fix in future commits.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290864 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-03 05:45:57 +00:00
Craig Topper
be3e531ac2 [AVX-512] Remove vextract intrinsics and autoupgrade to native shufflevectors. This unfortunately generates some really terrible code without VLX support due to v2i1 and v4i1 not being legal.
Hopefully we can improve that in future patches.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290863 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-03 05:45:46 +00:00
Dean Michael Berris
87ff4c129a [XRay] Merge instrumentation point table emission code into AsmPrinter.
Summary:
No need to have this per-architecture.  While there, unify 32-bit ARM's
behaviour with what changed elsewhere and start function names lowercase
as per the coding standards.  Individual entry emission code goes to the
entry's own class.

Fully tested on amd64, cross-builds on both ARMs and PowerPC.

Reviewers: dberris

Subscribers: aemerson, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290858 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-03 04:30:21 +00:00