Devin Coughlin [Thu, 3 Aug 2017 18:12:22 +0000 (18:12 +0000)]
[Analyzer] Add support for displaying cross-file diagnostic paths in HTML output
This change adds support for cross-file diagnostic paths in html output. If the
diagnostic path is not cross-file, there is no change in the output.
Patch by Vlad Tsyrklevich!
Differential Revision: https://reviews.llvm.org/D30406
llvm-svn: 309968
Greg Bedwell [Thu, 3 Aug 2017 17:55:54 +0000 (17:55 +0000)]
Fix check-lit compatibility with multi-config CMake generators
Multi-configuration CMake generators such as those for Visual Studio or Xcode do not
specify a build config at configure time, but let the user choose at build
time. In these cases binaries go into build/${Configuration}/bin rather than
build/bin. Prior to this commit, check-lit would fail when using multi-configuration
generators as it did not know how to resolve ${Configuration} in order
to find tools such as FileCheck. This commit teaches it to resolve
llvm_tools_dir within lit using the value specified with --param
build_mode.
Differential Revision: https://reviews.llvm.org/D36263
llvm-svn: 309967
Teresa Johnson [Thu, 3 Aug 2017 17:52:38 +0000 (17:52 +0000)]
Disable loop peeling during full unrolling pass.
Summary:
Peeling should not occur during the full unrolling invocation early
in the pipeline, but rather later with partial and runtime loop
unrolling. The later loop unrolling invocation will also eventually
utilize profile summary and branch frequency information, which
we would like to use to control peeling. And for ThinLTO we want
to delay peeling until the backend (post thin link) phase, just as
we do for most types of unrolling.
Ensure peeling doesn't occur during the full unrolling invocation
by adding a parameter to the shared implementation function, similar
to the way partial and runtime loop unrolling are disabled.
Performance results for ThinLTO suggest this has a neutral to positive
effect on some internal benchmarks.
Reviewers: chandlerc, davidxl
Subscribers: mzolotukhin, llvm-commits, mehdi_amini
Differential Revision: https://reviews.llvm.org/D36258
llvm-svn: 309966
Dehao Chen [Thu, 3 Aug 2017 17:11:41 +0000 (17:11 +0000)]
Do not want to use BFI to get profile count for sample pgo
Summary: For SamplePGO, we already record the callsite count in the call instruction itself. So we do not want to use BFI to get profile count as it is less accurate.
Reviewers: tejohnson, davidxl, eraman
Reviewed By: eraman
Subscribers: sanjoy, llvm-commits, mehdi_amini
Differential Revision: https://reviews.llvm.org/D36025
llvm-svn: 309964
Simon Pilgrim [Thu, 3 Aug 2017 17:04:59 +0000 (17:04 +0000)]
[X86] Adding a test for vector shuffle extractions.
When both the vector inputs of the shuffle vector is comprising of same vector or shuffle mask is accessing elements from only one operand vector (like in PR33758 test already present).
Committed on behalf of @jbhateja (Jatin Bhateja)
Differential Revision: https://reviews.llvm.org/D36271
llvm-svn: 309963
Tim Northover [Thu, 3 Aug 2017 16:59:36 +0000 (16:59 +0000)]
Revert "[AArch64] Simplify AES*Tied pseudo expansion (NFC)."
This reverts commit r309821.
My suggestion was wrong because it left the MachineOperands tied which
confused the verifier. Since there's no easy way to untie operands, the
original BuildMI solution is probably best.
llvm-svn: 309962
Simon Pilgrim [Thu, 3 Aug 2017 16:56:52 +0000 (16:56 +0000)]
[X86][AVX512] Tidied up v64i8 vector shuffle tests with triple
llvm-svn: 309961
Nico Weber [Thu, 3 Aug 2017 16:46:17 +0000 (16:46 +0000)]
Revert r304836.
See discussion in https://reviews.llvm.org/D33900#824172
llvm-svn: 309960
Changpeng Fang [Thu, 3 Aug 2017 16:37:02 +0000 (16:37 +0000)]
AMDGPU/SI: Don't fix a PHI under uniform branch in SIFixSGPRCopies only when sources and destination are all sgprs
Summary:
If a PHI has at lease one VGPR operand, we have to fix the PHI
in SIFixSGPRCopies.
Reviewer:
Matt
Differential Revision:
http://reviews.llvm.org/D34727
llvm-svn: 309959
Don Hinton [Thu, 3 Aug 2017 16:13:13 +0000 (16:13 +0000)]
[diagtool] Add ability to pass in the id and return the name for a
particular diagnostic.
Differential Revision: https://reviews.llvm.org/D36252
llvm-svn: 309955
George Rimar [Thu, 3 Aug 2017 16:05:08 +0000 (16:05 +0000)]
[ELF] - Do not segfault if linkerscript tries to access Target too early.
Following possible scripts triggered accessing to Target when it was not yet
initialized (was nullptr).
MEMORY { name : ORIGIN = DATA_SEGMENT_RELRO_END; }
MEMORY { name : ORIGIN = CONSTANT(COMMONPAGESIZE); }
Patch errors out instead.
Differential revision: https://reviews.llvm.org/D36140
llvm-svn: 309953
Benjamin Kramer [Thu, 3 Aug 2017 15:59:37 +0000 (15:59 +0000)]
Fix use after free in unit test.
llvm-svn: 309952
Nirav Dave [Thu, 3 Aug 2017 15:51:20 +0000 (15:51 +0000)]
[DAG] Allow merging of stores of vector loads
Remove restriction disallowing merging of stores vector loads into
larger store of larger vector load.
Reviewers: RKSimon, efriedma, spatel
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D36158
llvm-svn: 309951
Nico Weber [Thu, 3 Aug 2017 15:41:26 +0000 (15:41 +0000)]
Revert r309923, it caused PR34045.
llvm-svn: 309950
Nirav Dave [Thu, 3 Aug 2017 15:40:21 +0000 (15:40 +0000)]
[TableGen] AsmMatcher: fix OpIdx computation when HasOptionalOperands is true
Consider the following instruction: "inst.eq $dst, $src" where ".eq"
is an optional flag operand. The $src and $dst operands are
registers. If we parse the instruction "inst r0, r1", the flag is not
present and it will be marked in the "OptionalOperandsMask" variable.
After the matching is complete we call the "convertToMCInst" method.
The current implementation works only if the optional operands are at
the end of the array. The "Operands" array looks like [token:"inst",
reg:r0, reg:r1]. The first operand that must be added to the MCInst
is the destination, the r0 register. The "OpIdx" (in the Operands
array) for this register is 2. However, since the flag is not present
in the Operands, the actual index for r0 should be 1. The flag is not
present since we rely on the default value.
This patch removes the "NumDefaults" variable and replaces it with an
array (DefaultsOffset). This array contains an index for each operand
(excluding the mnemonic). At each index, the array contains the
number of optional operands that should be subtracted. For the
previous example, this array looks like this: [0, 1, 1]. When we need
to access the r0 register, we compute its index as 2 -
DefaultsOffset[1] = 1.
Patch by Alexandru Guduleasa!
Reviewers: SamWot, nhaustov, niravd
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D35998
llvm-svn: 309949
Gabor Horvath [Thu, 3 Aug 2017 15:38:14 +0000 (15:38 +0000)]
Fix some typos in the documentation.
Patch by: Reka Nikolett Kovacs
llvm-svn: 309948
Michael Kruse [Thu, 3 Aug 2017 15:27:00 +0000 (15:27 +0000)]
[VirtualInstruction] Avoid use of getStmtFor(BB). NFC.
With this patch, we get rid of the last use of getStmtFor(BB). Here
this is done by getting the last statement of the incoming block in
case the user is a phi node; otherwise just fetching the statement
comprising the instruction for which the virtual use is being created.
Differential Revision: https://reviews.llvm.org/D36268
llvm-svn: 309947
Sanjay Patel [Thu, 3 Aug 2017 15:18:27 +0000 (15:18 +0000)]
[NewGVN] fix typos; NFC
llvm-svn: 309946
Sanjay Patel [Thu, 3 Aug 2017 15:07:37 +0000 (15:07 +0000)]
[BDCE] add tests to show invalid/incomplete transforms
llvm-svn: 309945
Florian Hahn [Thu, 3 Aug 2017 14:48:22 +0000 (14:48 +0000)]
[GlobalISel] Only merge memory ops for mayLoad or mayStore instrs.
Summary:
We only need to merge memory operands for instructions that access
memory. This slightly reduces the number of actions executed.
Reviewers: MatzeB, rovka, dsanders
Reviewed By: dsanders
Subscribers: aemerson, igorb, kristof.beyls, llvm-commits
Differential Revision: https://reviews.llvm.org/D36151
llvm-svn: 309944
Tobias Grosser [Thu, 3 Aug 2017 14:46:53 +0000 (14:46 +0000)]
Add missing REQUIRES line
llvm-svn: 309943
Simon Dardis [Thu, 3 Aug 2017 14:35:06 +0000 (14:35 +0000)]
[mips] Fixup r309940.
Needed a // REQUIRES: mips-registered-target
llvm-svn: 309942
Krasimir Georgiev [Thu, 3 Aug 2017 14:17:29 +0000 (14:17 +0000)]
[clang-format] Fix indent of 'key <...>' and 'key {...}' in text protos
Summary:
This patch fixes the indentation of the code pattern `key <...>`and `key {...}` in text protos.
Previously, such line would be alinged depending on the column of the previous
colon, which usually indents too much.
I'm gonna go ahead and commit this since it's a straightforward bugfix.
Reviewers: djasper, klimek
Subscribers: klimek, cfe-commits
Differential Revision: https://reviews.llvm.org/D36143
llvm-svn: 309941
Simon Dardis [Thu, 3 Aug 2017 14:01:17 +0000 (14:01 +0000)]
[mips] Implement -muninit-const-in-rodata
This option when combined with -mgpopt and -membedded-data places all
uninitialized constant variables in the read-only section.
Reviewers: atanasyan, nitesh.jain
Differential Revision: https://reviews.llvm.org/D35917
llvm-svn: 309940
Tobias Grosser [Thu, 3 Aug 2017 13:51:15 +0000 (13:51 +0000)]
Make sure that all parameter dimensions are set in schedule
Summary:
In case the option -polly-ignore-parameter-bounds is set, not all parameters
will be added to context and domains. This is useful to keep the size of the
sets and maps we work with small. Unfortunately, for AST generation it is
necessary to ensure all parameters are part of the schedule tree. Hence,
we modify the GPGPU code generation to make sure this is the case.
To obtain the necessary information we expose a new function
Scop::getFullParamSpace(). We also make a couple of functions const to be
able to make SCoP::getFullParamSpace() const.
Reviewers: Meinersbur, bollu, gareevroman, efriedma, huihuiz, sebpop, simbuerg
Subscribers: nemanjai, kbarton, pollydev, llvm-commits
Tags: #polly
Differential Revision: https://reviews.llvm.org/D36243
llvm-svn: 309939
Michael Kruse [Thu, 3 Aug 2017 13:44:31 +0000 (13:44 +0000)]
[test] Fix test case without Polly-ACC.
llvm-svn: 309938
Krasimir Georgiev [Thu, 3 Aug 2017 13:43:45 +0000 (13:43 +0000)]
[clang-format] Fix parsing of <>-style proto options
Summary:
This patch fixes the parsing of proto option fields like `option op = <...>`.
Previously the parser did not enter the right code path inside the angle braces,
causing the contents to be split into several unwrapped lines inside.
I'll just go ahead and commit this since it's a straightforward bugfix.
Reviewers: djasper, klimek
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D36217
llvm-svn: 309937
NAKAMURA Takumi [Thu, 3 Aug 2017 13:30:43 +0000 (13:30 +0000)]
ClangdTests: Try to unbreak the case CLANG_DEFAULT_CXX_STDLIB=libc++.
llvm-svn: 309936
Simon Dardis [Thu, 3 Aug 2017 13:04:29 +0000 (13:04 +0000)]
[mips] Add support -m(no-)embedded-data option
Add support for the -membedded-data option which places constant data in
the .rodata section, rather than the .sdata section.
Reviewers: atanasyan, nitesh.jain
Differential Revision: https://reviews.llvm.org/D35914
llvm-svn: 309935
Siddharth Bhat [Thu, 3 Aug 2017 12:09:33 +0000 (12:09 +0000)]
[PPCGCodeGeneration] Construct `isl_multi_pw_aff` of PPCGArray.bounds even when polly-ignore-parameter-bounds is turned on.
When we have `-polly-ignore-parameter-bounds`, `Scop::Context` does not contain
all the paramters present in the program.
The construction of the `isl_multi_pw_aff` requires all the indivisual `pw_aff`
to have the same parameter dimensions. To achieve this, we used to realign
every `pw_aff` with `Scop::Context`. However, in conjunction with
`-polly-ignore-parameter-bounds`, this is now incorrect, since `Scop::Context`
does not contain all parameters.
We set this up correctly by creating a space that has all the parameters
used by all the `isl_pw_aff`. Then, we realign all `isl_pw_aff` to this space.
llvm-svn: 309934
Robert Lougher [Thu, 3 Aug 2017 11:54:02 +0000 (11:54 +0000)]
[LiveDebugVariables] Use lexical scope to trim debug value live intervals
The debug value live intervals computed by Live Debug Variables may extend
beyond the range of the debug location's lexical scope. In this case,
splitting of an interval can result in an interval outside of the scope being
created, causing extra unnecessary DBG_VALUEs to be emitted. To prevent this,
trim the intervals to the lexical scope.
This resolves PR33730.
Reviewers: aprantl
Differential Revision: https://reviews.llvm.org/D35953
llvm-svn: 309933
NAKAMURA Takumi [Thu, 3 Aug 2017 11:36:44 +0000 (11:36 +0000)]
Prune linefeed at eof.
llvm-svn: 309932
NAKAMURA Takumi [Thu, 3 Aug 2017 11:36:42 +0000 (11:36 +0000)]
llvm/Support/CodeGenCWrappers.h: Add missing "llvm/ADT/Optional.h", to fix modules build.
llvm-svn: 309931
Simon Dardis [Thu, 3 Aug 2017 09:38:46 +0000 (09:38 +0000)]
[SelectionDAG] Resolve PR33978.
rL306209 taught SelectionDAG how to add the dereferenceable flag when
expanding memcpy and memmove. The fix however contained a nit where
the offset + size was constructed as an APInt of PointerSize rather
than PointerSizeInBits.
This lead to isDereferenceableAndAlignedPointer() get truncated values or
values which would be sign extended within that function leading to
incorrect results.
Thanks to Alex Crichton for reporting the issue!
This resolves PR33978.
Reviewers: inouehrs
Differential Revision: https://reviews.llvm.org/D36236
llvm-svn: 309930
Max Kazantsev [Thu, 3 Aug 2017 09:25:44 +0000 (09:25 +0000)]
Removed unused variabled from unit test
llvm-svn: 309929
Ewan Crawford [Thu, 3 Aug 2017 09:23:03 +0000 (09:23 +0000)]
[Cloning] Move distinct GlobalVariable debug info metadata in CloneModule
Duplicating the distinct Subprogram and CU metadata nodes seems like the incorrect thing to do in CloneModule for GlobalVariable debug info. As it results in the scope of the GlobalVariable DI no longer being consistent with the rest of the module, and the new CU is absent from llvm.dbg.cu.
Fixed by adding RF_MoveDistinctMDs to MapMetadata flags for GlobalVariables.
Current unit test IR after clone:
```
@gv = global i32 1, comdat($comdat), !dbg !0, !type !5
define private void @f() comdat($comdat) personality void ()* @persfn !dbg !14 {
!llvm.dbg.cu = !{!10}
!0 = !DIGlobalVariableExpression(var: !1)
!1 = distinct !DIGlobalVariable(name: "gv", linkageName: "gv", scope: !2, file: !3, line: 1, type: !9, isLocal: false, isDefinition: true)
!2 = distinct !DISubprogram(name: "f", linkageName: "f", scope: null, file: !3, line: 4, type: !4, isLocal: true, isDefinition: true, scopeLine: 3, isOptimized: false, unit: !6, variables: !5)
!3 = !DIFile(filename: "filename.c", directory: "/file/dir/")
!4 = !DISubroutineType(types: !5)
!5 = !{}
!6 = distinct !DICompileUnit(language: DW_LANG_C99, file: !7, producer: "CloneModule", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !5, globals: !8)
!7 = !DIFile(filename: "filename.c", directory: "/file/dir")
!8 = !{!0}
!9 = !DIBasicType(tag: DW_TAG_unspecified_type, name: "decltype(nullptr)")
!10 = distinct !DICompileUnit(language: DW_LANG_C99, file: !7, producer: "CloneModule", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !5, globals: !11)
!11 = !{!12}
!12 = !DIGlobalVariableExpression(var: !13)
!13 = distinct !DIGlobalVariable(name: "gv", linkageName: "gv", scope: !14, file: !3, line: 1, type: !9, isLocal: false, isDefinition: true)
!14 = distinct !DISubprogram(name: "f", linkageName: "f", scope: null, file: !3, line: 4, type: !4, isLocal: true, isDefinition: true, scopeLine: 3, isOptimized: false, unit: !10, variables: !5)
```
Patched IR after clone:
```
@gv = global i32 1, comdat($comdat), !dbg !0, !type !5
define private void @f() comdat($comdat) personality void ()* @persfn !dbg !2 {
!llvm.dbg.cu = !{!6}
!0 = !DIGlobalVariableExpression(var: !1)
!1 = distinct !DIGlobalVariable(name: "gv", linkageName: "gv", scope: !2, file: !3, line: 1, type: !9, isLocal: false, isDefinition: true)
!2 = distinct !DISubprogram(name: "f", linkageName: "f", scope: null, file: !3, line: 4, type: !4, isLocal: true, isDefinition: true, scopeLine: 3, isOptimized: false, unit: !6, variables: !5)
!3 = !DIFile(filename: "filename.c", directory: "/file/dir/")
!4 = !DISubroutineType(types: !5)
!5 = !{}
!6 = distinct !DICompileUnit(language: DW_LANG_C99, file: !7, producer: "CloneModule", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !5, globals: !8)
!7 = !DIFile(filename: "filename.c", directory: "/file/dir")
!8 = !{!0}
!9 = !DIBasicType(tag: DW_TAG_unspecified_type, name: "decltype(nullptr)")
```
Reviewers: aprantl, probinson, dblaikie, echristo, loladiro
Reviewed By: aprantl
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D36082
llvm-svn: 309928
Diana Picus [Thu, 3 Aug 2017 09:14:59 +0000 (09:14 +0000)]
[ARM] GlobalISel: Select simple G_GLOBAL_VALUE instructions
Add support in the instruction selector for G_GLOBAL_VALUE for ELF and
MachO for the static relocation model. We don't handle Windows yet
because that's Thumb-only, and we don't handle Thumb in general at the
moment.
Support for PIC, ROPI, RWPI and TLS will be added in subsequent commits.
Differential Revision: https://reviews.llvm.org/D35883
llvm-svn: 309927
Dinar Temirbulatov [Thu, 3 Aug 2017 08:50:18 +0000 (08:50 +0000)]
[X86] SET0 to use XMM registers where possible PR26018 PR32862
Differential Revision: https://reviews.llvm.org/D35965
llvm-svn: 309926
Max Kazantsev [Thu, 3 Aug 2017 08:41:30 +0000 (08:41 +0000)]
[SCEV] Re-enable "Cache results of computeExitLimit"
The patch rL309080 was reverted because it did not clean up the cache on "forgetValue"
method call. This patch re-enables this change, adds the missing check and introduces
two new unit tests that make sure that the cache is cleaned properly.
Differential Revision: https://reviews.llvm.org/D36087
llvm-svn: 309925
Daniel Sanders [Thu, 3 Aug 2017 08:38:04 +0000 (08:38 +0000)]
[globalisel][tablegen] Update a comment to use the name of the constant rather than the value.
llvm-svn: 309924
Roger Ferrer Ibanez [Thu, 3 Aug 2017 07:45:10 +0000 (07:45 +0000)]
[ARM] Use ADDCARRY / SUBCARRY
This patch:
- makes nodes ISD::ADDCARRY and ISD::SUBCARRY legal for i32
- lowering is done by first converting the boolean value into the carry flag
using (_, C) <- (ARMISD::ADDC R, -1) and converted back to an integer value
using (R, _) <- (ARMISD::ADDE 0, 0, C). An ARMISD::ADDE between the two
operations does the actual addition.
- for subtraction, given that ISD::SUBCARRY second result is actually a
borrow, we need to invert the value of the second operand and result before
and after using ARMISD::SUBE. We need to invert the carry result of
ARMISD::SUBE to preserve the semantics.
- given that the generic combiner may lower ISD::ADDCARRY and
ISD::SUBCARRY into ISD::UADDO and ISD::USUBO we need to update their lowering
as well otherwise i64 operations now would require branches. This implies
updating the corresponding test for unsigned.
- add new combiner to remove the redundant conversions from/to carry flags
to/from boolean values (ARMISD::ADDC (ARMISD::ADDE 0, 0, C), -1) -> C
Differential Revision: https://reviews.llvm.org/D35192
llvm-svn: 309923
Daniel Jasper [Thu, 3 Aug 2017 05:15:53 +0000 (05:15 +0000)]
Fix WebAssembly target after r309911.
llvm-svn: 309922
Rafael Espindola [Thu, 3 Aug 2017 04:52:45 +0000 (04:52 +0000)]
Fix the ppc jit tests.
llvm-svn: 309921
Eric Fiselier [Thu, 3 Aug 2017 04:28:10 +0000 (04:28 +0000)]
Fix libcxx build with glibc 2.26+ by removing xlocale.h include.
Patch by Khem Raj. Reviewed as D35697. Also see PR33729.
llvm-svn: 309920
Tobias Grosser [Thu, 3 Aug 2017 04:17:58 +0000 (04:17 +0000)]
[unittest] Remove TODO comment which caused concern
Remove the second part of the TODO comment that highlighted an issue with
possibly connecting all nodes to the exit of the CFG. This caused concerns
with Jakub Kuderski regarding its feasability, hence we remove it. Such
points are better discussed outside of CFG. If connecting all nodes makes
sense and what the impact is is currently part of an active review discussion.
llvm-svn: 309919
Rafael Espindola [Thu, 3 Aug 2017 03:52:34 +0000 (03:52 +0000)]
Add LLVM_FALLTHROUGH.
llvm-svn: 309918
Eric Fiselier [Thu, 3 Aug 2017 02:50:43 +0000 (02:50 +0000)]
Add system header pragma to BSD locale fallback headers.
This prevent leaking warnings to the user about use of C++11
extensions in C++03.
llvm-svn: 309917
Rafael Espindola [Thu, 3 Aug 2017 02:45:01 +0000 (02:45 +0000)]
Update for llvm api change.
llvm-svn: 309916
Sameer AbuAsal [Thu, 3 Aug 2017 02:41:17 +0000 (02:41 +0000)]
[RegisterCoalescer] Add wrapper for Erasing Instructions
Summary:
To delete an instruction the coalescer needs to call eraseFromParent()
on the MachineInstr, insert it in the ErasedInstrs list and update the
Live Ranges structure. This patch re-factors the code to do all that in
one function. This will also fix cases where previous code wasn't
inserting deleted instructions in the ErasedList.
Reviewers: qcolombet, kparzysz
Reviewed By: qcolombet
Subscribers: MatzeB, llvm-commits, qcolombet
Differential Revision: https://reviews.llvm.org/D36204
llvm-svn: 309915
Vitaly Buka [Thu, 3 Aug 2017 02:22:11 +0000 (02:22 +0000)]
[asan] Allocator support for Fuchsia
Submitted on behalf of Roland McGrath.
Reviewers: vitalybuka, alekseyshl, kcc
Reviewed By: alekseyshl
Subscribers: srhines, cryptoad, kubamracek, phosek, filcab, llvm-commits
Tags: #sanitizers
Differential Revision: https://reviews.llvm.org/D36190
llvm-svn: 309914
Rafael Espindola [Thu, 3 Aug 2017 02:16:33 +0000 (02:16 +0000)]
Update for llvm change.
llvm-svn: 309913
Rafael Espindola [Thu, 3 Aug 2017 02:16:28 +0000 (02:16 +0000)]
Update for llvm change.
llvm-svn: 309912
Rafael Espindola [Thu, 3 Aug 2017 02:16:21 +0000 (02:16 +0000)]
Delete Default and JITDefault code models
IMHO it is an antipattern to have a enum value that is Default.
At any given piece of code it is not clear if we have to handle
Default or if has already been mapped to a concrete value. In this
case in particular, only the target can do the mapping and it is nice
to make sure it is always done.
This deletes the two default enum values of CodeModel and uses an
explicit Optional<CodeModel> when it is possible that it is
unspecified.
llvm-svn: 309911
Javed Absar [Thu, 3 Aug 2017 01:24:12 +0000 (01:24 +0000)]
[ARM] Tidy up banked registers encoding
Moves encoding (SYSm) information of banked registers to ARMSystemRegister.td,
where it rightly belongs and forms a single point of reference in the code.
Reviewed by: @fhahn, @rovka, @olista01
Differential Revision: https://reviews.llvm.org/D36219
llvm-svn: 309910
Dean Michael Berris [Thu, 3 Aug 2017 00:58:45 +0000 (00:58 +0000)]
[XRay][compiler-rt] Allow for building the XRay runtime without PREINIT initialization.
Summary:
Define a build-time configuration option for the XRay runtime to
determine whether the archive will add an entry to the `.preinit_array`
section of the binary. We also allow for initializing the XRay data
structures with an explicit call to __xray_init(). This allows us to
give users the capability to initialize the XRay data structures on
demand.
This can allow us to start porting XRay to platforms where
`.preinit_array` isn't a supported section. It also allows us to limit
the effects of XRay in the initialization sequence for applications that
are sensitive to this kind of interference (i.e. large binaries) or
those that want to package XRay control in libraries.
Future changes should allow us to build two different library archives
for the XRay runtime, and allow clang users to determine which version
to link.
Reviewers: dblaikie, kpw, pelikan
Subscribers: mgorny, llvm-commits
Differential Revision: https://reviews.llvm.org/D36080
llvm-svn: 309909
Tim Shen [Thu, 3 Aug 2017 00:18:11 +0000 (00:18 +0000)]
[Sema] Add a comment on an identified bug on default arguments.
Summary:
The mis-compile is triggered by internal code, but I haven't reduced it to a small piece of code. Add a FIXME here, since a decent fix doesn't seem to be trivial.
The decent fix can be changing Decl::Init to PointerUnion<Stmt *, EvaluatedStmt *, ParamVarDecl *>, and make setUninstantiatedDefaultArg take a ParamVarDecl *, which contains the Expr * as the default argument. This way, getTemplateInstantiationArgs can take that ParamVarDecl and do the right thing.
Reviewers: rsmith
Subscribers: sanjoy, cfe-commits
Differential Revision: https://reviews.llvm.org/D36253
llvm-svn: 309908
Dehao Chen [Thu, 3 Aug 2017 00:09:18 +0000 (00:09 +0000)]
Fix the bug when SampleProfileWriter writes out number of callsites.
Summary: As we support multiple callsites for the same location, we need to traverse all locations to get the number of callsites.
Reviewers: davidxl
Reviewed By: davidxl
Subscribers: sanjoy, llvm-commits
Differential Revision: https://reviews.llvm.org/D36246
llvm-svn: 309907
Vedant Kumar [Wed, 2 Aug 2017 23:35:27 +0000 (23:35 +0000)]
Move two functions to a nicer spot. NFC.
llvm-svn: 309906
Vedant Kumar [Wed, 2 Aug 2017 23:35:26 +0000 (23:35 +0000)]
Rely on autobrief, remove \briefs from a header. NFC.
llvm-svn: 309905
Vedant Kumar [Wed, 2 Aug 2017 23:35:25 +0000 (23:35 +0000)]
[Coverage] Add an API to retrive all instantiations of a function (NFC)
The CoverageMapping::getInstantiations() API retrieved all function
records corresponding to functions with more than one instantiation (e.g
template functions with multiple specializations). However, there was no
simple way to determine *which* function a given record was an
instantiation of. This was an oversight, since it's useful to aggregate
coverage information over all instantiations of a function.
llvm-cov works around this by building a mapping of source locations to
instantiation sets, but this duplicates logic that libCoverage already
has (see FunctionInstantiationSetCollector).
This change adds a new API, CoverageMapping::getInstantiationGroups(),
which returns a list of InstantiationGroups. A group contains records
for each instantiation of some particular function, and also provides
utilities to get the total execution count within the group, the source
location of the common definition, etc.
This lets removes some hacky logic in llvm-cov by reusing
FunctionInstantiationSetCollector and makes the CoverageMapping API
friendlier for other clients.
llvm-svn: 309904
Vedant Kumar [Wed, 2 Aug 2017 23:35:24 +0000 (23:35 +0000)]
[llvm-cov] Respect the value of the -show-instantiations option
Make `-show-instantiations=false` actually skip displaying instantiation
sub-views, instead of simply ignoring the option.
llvm-svn: 309903
Reid Kleckner [Wed, 2 Aug 2017 23:32:26 +0000 (23:32 +0000)]
[PDB] Improve rsds test to check that we fill in the file offset as well as the RVA
llvm-svn: 309902
Eli Friedman [Wed, 2 Aug 2017 23:22:50 +0000 (23:22 +0000)]
[coverage] Make smaller regions for the first case of a switch.
We never overwrite the end location of a region, so we would end up with
an overly large region when we reused the switch's region.
It's possible this code will be substantially rewritten in the near
future to deal with fallthrough more accurately, but this seems like
an improvement on its own for now.
Differential Revision: https://reviews.llvm.org/D34801
llvm-svn: 309901
Reid Kleckner [Wed, 2 Aug 2017 23:19:54 +0000 (23:19 +0000)]
[PDB] Improve our PDB OMF debug directory entry
In order to get dbghelp to load our pdb, we have to fill in the
PointerToRawData field as well as the AddressOfRawData field. One is the
file offset and the other is the RVA.
llvm-svn: 309900
George Karpenkov [Wed, 2 Aug 2017 23:09:57 +0000 (23:09 +0000)]
Revert "[libFuzzer tests] Use substring comparison in libFuzzer tests"
This reverts commit
3592d8049660dcdd07f7c2e797f2de9790f93111.
Breaks the bots, reverting for now.
llvm-svn: 309899
Tom Stellard [Wed, 2 Aug 2017 22:56:30 +0000 (22:56 +0000)]
AMDGPU/GlobalISel: Mark 32-bit G_FMUL as legal
Reviewers: arsenm
Reviewed By: arsenm
Subscribers: kzhuravl, wdng, nhaehnle, yaxunl, rovka, kristof.beyls, igorb, dstuttard, tpr, llvm-commits, t-tye
Differential Revision: https://reviews.llvm.org/D36218
llvm-svn: 309898
Kostya Kortchinsky [Wed, 2 Aug 2017 22:47:54 +0000 (22:47 +0000)]
[tsan] Check for pvalloc overlow
Summary:
`CheckForPvallocOverflow` was introduced with D35818 to detect when pvalloc
would wrap when rounding up to the next multiple of the page size.
Add this check to TSan's pvalloc implementation.
Reviewers: alekseyshl
Reviewed By: alekseyshl
Subscribers: llvm-commits, kubamracek
Differential Revision: https://reviews.llvm.org/D36245
llvm-svn: 309897
Zachary Turner [Wed, 2 Aug 2017 22:31:39 +0000 (22:31 +0000)]
[pdb/lld] Write a valid FPM.
The PDB reserves certain blocks for the FPM that describe which
blocks in the file are allocated and which are free. We weren't
filling that out at all, and in some cases we were even stomping
it with incorrect data. This patch writes a correct FPM.
Differential Revision: https://reviews.llvm.org/D36235
llvm-svn: 309896
Zachary Turner [Wed, 2 Aug 2017 22:26:09 +0000 (22:26 +0000)]
[MSF] Move MSF unit tests to their own unittest target.
llvm-svn: 309895
Zachary Turner [Wed, 2 Aug 2017 22:25:52 +0000 (22:25 +0000)]
[pdbutil] Add a command to dump the FPM.
Recently problems have been discovered in the way we write the FPM
(free page map). In order to fix this, we first need to establish
a baseline about what a correct FPM looks like using an MSVC
generated PDB, so that we can then make our own generated PDBs
match. And in order to do this, the dumper needs a mode where it
can dump an FPM so that we can write tests for it.
This patch adds a command to dump the FPM, as well as a test against
a known-good PDB.
llvm-svn: 309894
Tom Stellard [Wed, 2 Aug 2017 22:19:45 +0000 (22:19 +0000)]
AMDGPU/R600: Initialize more passes
Reviewers: arsenm
Reviewed By: arsenm
Subscribers: kzhuravl, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, llvm-commits
Differential Revision: https://reviews.llvm.org/D36128
llvm-svn: 309893
Sterling Augustine [Wed, 2 Aug 2017 21:52:23 +0000 (21:52 +0000)]
Use a more standard method to mark these tests as unsupported on powerpc64.
llvm-svn: 309892
Keith Wyss [Wed, 2 Aug 2017 21:47:27 +0000 (21:47 +0000)]
Xray docs with description of Flight Data Recorder binary format.
Summary:
Adding a new restructuredText file to document the trace format produced with
an FDR mode handler and read by llvm-xray toolset.
Fixed two problems in the documentation from differential review. One bad table
and a missing link in the toc.
Original commit was
e97c5836a77db803fe53319c53f3bf8e8b26d2b7.
Reviewers: dberris, pelikan
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D36041
llvm-svn: 309891
Matt Arsenault [Wed, 2 Aug 2017 21:43:08 +0000 (21:43 +0000)]
LV: Don't insert runtime ptr checks on divergent targets
llvm-svn: 309890
George Karpenkov [Wed, 2 Aug 2017 21:38:50 +0000 (21:38 +0000)]
[libFuzzer tests] Use substring comparison in libFuzzer tests
LIT launches executables with absolute, and not relative, path.
strncmp would try to do exact comparison and fail.
Differential Revision: https://reviews.llvm.org/D36242
llvm-svn: 309889
Benjamin Kramer [Wed, 2 Aug 2017 21:16:50 +0000 (21:16 +0000)]
Remove unused diagnostic. NFC.
llvm-svn: 309888
Craig Topper [Wed, 2 Aug 2017 21:05:40 +0000 (21:05 +0000)]
[InstCombine] Remove unnecessary temporary APInt. NFCI
llvm-svn: 309887
Teresa Johnson [Wed, 2 Aug 2017 20:35:29 +0000 (20:35 +0000)]
[PM] Split LoopUnrollPass and make partial unroller a function pass
Summary:
This is largely NFC*, in preparation for utilizing ProfileSummaryInfo
and BranchFrequencyInfo analyses. In this patch I am only doing the
splitting for the New PM, but I can do the same for the legacy PM as
a follow-on if this looks good.
*Not NFC since for partial unrolling we lose the updates done to the
loop traversal (adding new sibling and child loops) - according to
Chandler this is not very useful for partial unrolling, but it also
means that the debugging flag -unroll-revisit-child-loops no longer
works for partial unrolling.
Reviewers: chandlerc
Subscribers: mehdi_amini, mzolotukhin, eraman, llvm-commits
Differential Revision: https://reviews.llvm.org/D36157
llvm-svn: 309886
Rafael Espindola [Wed, 2 Aug 2017 20:32:35 +0000 (20:32 +0000)]
Update for llvm change.
llvm-svn: 309885
Rafael Espindola [Wed, 2 Aug 2017 20:32:26 +0000 (20:32 +0000)]
Don't pass the code model to MC
I was surprised to see the code model being passed to MC. After all,
it assembles code, it doesn't create it.
The one place it is used is in the expansion of .cfi directives to
handle .eh_frame being more that 2gb away from the code.
As far as I can tell, gnu assembler doesn't even have an option to
enable this. Compiling a c file with gcc -mcmodel=large produces a
regular looking .eh_frame. This is probably because in practice linker
parse and recreate .eh_frames.
In llvm this is used because the JIT can place the code and .eh_frame
very far apart. Ideally we would fix the jit and delete this
option. This is hard.
Apart from confusion another problem with the current interface is
that most callers pass CodeModel::Default, which is bad since MC has
no way to map it to the target default if it actually needed to.
This patch then replaces the argument with a boolean with a default
value. The vast majority of users don't ever need to look at it. In
fact, only CodeGen and llvm-mc use it and llvm-mc just to enable more
testing.
llvm-svn: 309884
Kostya Kortchinsky [Wed, 2 Aug 2017 20:32:12 +0000 (20:32 +0000)]
[msan] Check for pvalloc overflow
Summary:
CheckForPvallocOverflow was introduced with D35818 to detect when pvalloc
would wrap when rounding up to the next multiple of the page size.
Add this check to MSan's pvalloc implementation.
This time I made sure I was actually running (and writing) the correct tests,
and that they are passing...
Reviewers: alekseyshl
Reviewed By: alekseyshl
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D36164
llvm-svn: 309883
Craig Topper [Wed, 2 Aug 2017 20:30:27 +0000 (20:30 +0000)]
[InstCombine] Remove explicit code for folding (xor(zext(cmp)), 1) and (xor(sext(cmp)), -1) to ext(!cmp).
As far as I can tell this should be handled by foldCastedBitwiseLogic which is called later in visitXor.
Differential Revision: https://reviews.llvm.org/D36214
llvm-svn: 309882
Marshall Clow [Wed, 2 Aug 2017 20:29:26 +0000 (20:29 +0000)]
Rename a couple variables to eliminate a shadow warning. No functionality change
llvm-svn: 309881
Craig Topper [Wed, 2 Aug 2017 20:25:56 +0000 (20:25 +0000)]
[InstCombine] Support sext in foldLogicCastConstant
This adds support for sext in foldLogicCastConstant. This is a prerequisite for D36214.
Differential Revision: https://reviews.llvm.org/D36234
llvm-svn: 309880
David Blaikie [Wed, 2 Aug 2017 20:16:22 +0000 (20:16 +0000)]
DebugInfo: Test & handle (differently) non-zero DW_AT_ranges_base
Followup to r309570, fixing it slightly differently (ranges_base and
addr_base should never be read from a DWO file - so there shouldn't be
any issue with 'overriding' the values - conditionalize the code and
assert that the values aren't being overriden).
llvm-svn: 309879
Tobias Grosser [Wed, 2 Aug 2017 20:12:27 +0000 (20:12 +0000)]
Enable simplify and forward-op-tree by default
These passes have been tested over the last month and should generally help
to remove scalar data dependences in Polly. We enable them to give them even
wider test coverage. Large performance regressions and any kind of correctness
regressions are not expected.
llvm-svn: 309878
Jonathan Peyton [Wed, 2 Aug 2017 20:10:00 +0000 (20:10 +0000)]
Exclude version symbols for static libomp
We use symbol versioning for GNU-compatibility but libgomp has versioned symbols
only in the shared library but not in the static.
Moreover, version symbols in the static library can cause an error at link time.
Patch by Olga Malysheva
Differential Revision: https://reviews.llvm.org/D36225
llvm-svn: 309877
Stefan Pintilie [Wed, 2 Aug 2017 20:07:21 +0000 (20:07 +0000)]
[Power9] Exploit vector absolute difference instructions on Power 9
Power 9 has instructions to do absolute difference (VABSDUB, VABSDUH, VABSDUW)
for byte, halfword and word. We should take advantage of these.
Differential Revision: https://reviews.llvm.org/D34684
llvm-svn: 309876
Jonathan Peyton [Wed, 2 Aug 2017 20:06:32 +0000 (20:06 +0000)]
Move lock acquire/release functions in task deque cleanup code
The original locations can be reached without initializing the lock variable
(td_deque_lock), so it is potentially unsafe. It is guaranteed that the lock
is initialized if the deque (td_deque) is not NULL, and lock functions can be
safely called.
Patch by Hansang Bae
Differential Revision: https://reviews.llvm.org/D36017
llvm-svn: 309875
Jonathan Peyton [Wed, 2 Aug 2017 20:04:45 +0000 (20:04 +0000)]
Add new envirable KMP_TEAMS_THREAD_LIMIT
This change adds a new environment variable, KMP_TEAMS_THREAD_LIMIT, which is
used to set a new global variable, __kmp_teams_max_nth, which is checked when
determining the size and quantity of teams that will be created in the teams
construct. Specifically, it is a limit on the total number of threads in a given
teams construct. It differentiates the limits for the teams construct from the
limits for regular parallel regions (KMP_DEVICE_THREAD_LIMIT/__kmp_max_nth and
OMP_THREAD_LIMIT/__kmp_cg_max_nth). When each individual team is formed, it is
still subject to those limits. After the clauses to the teams construct are
parsed and calculated, we check to make sure we are within this limit, and if
not, reduce num_threads per team and/or number of teams, accordingly. The
default value is set to the number of available processors on the system.
Patch by Terry Wilmarth
Differential Revision: https://reviews.llvm.org/D36009
llvm-svn: 309874
Han Shen [Wed, 2 Aug 2017 19:53:38 +0000 (19:53 +0000)]
[UBSan] Provide default blacklist filename for UBSan
Summary:
This is to provide a default blacklist filename for UBSan.
While UBSan is turned on, it's better that clang pick up a blacklist file (when exists), just as what ASan / MSan does, so we do not end up adding the "-fsanitize-blacklist" option to every command line.
Reviewers: chandlerc, echristo, vsk, eugenis
Reviewed By: vsk, eugenis
Subscribers: vsk, eugenis, echristo, cfe-commits
Differential Revision: https://reviews.llvm.org/D35849
llvm-svn: 309873
Davide Italiano [Wed, 2 Aug 2017 19:47:37 +0000 (19:47 +0000)]
[NewGVN] Now that load coercion is enable, we pass this test.
llvm-svn: 309872
Tobias Grosser [Wed, 2 Aug 2017 19:27:25 +0000 (19:27 +0000)]
Move setNewAccessRelation to isl++
llvm-svn: 309871
Tobias Grosser [Wed, 2 Aug 2017 19:27:16 +0000 (19:27 +0000)]
Move ScopStmt::setAccessRelation to isl++
llvm-svn: 309870
Tobias Grosser [Wed, 2 Aug 2017 19:11:46 +0000 (19:11 +0000)]
Replace asserts with llvm_unreachable to clarify intent
llvm-svn: 309856
Evandro Menezes [Wed, 2 Aug 2017 18:55:34 +0000 (18:55 +0000)]
[AArch64] Add Exynos M2 feature test (NFC)
Test fusion of AES operations.
llvm-svn: 309855
Kostya Serebryany [Wed, 2 Aug 2017 18:48:45 +0000 (18:48 +0000)]
Add new ASAN_OPTION: sleep_after_init.
Summary: As mentioned in https://github.com/google/sanitizers/issues/834, suggested option can be handy for debugging.
Reviewers: kcc
Reviewed By: kcc
Subscribers: llvm-commits, kubamracek
Differential Revision: https://reviews.llvm.org/D35409
llvm-svn: 309854
Philip Pfaffe [Wed, 2 Aug 2017 18:26:48 +0000 (18:26 +0000)]
Fix r309826: Appease clang-format check.
llvm-svn: 309853
Vedant Kumar [Wed, 2 Aug 2017 18:24:12 +0000 (18:24 +0000)]
[docs] Remove accidental unindent to appease the sphinx bot
Bot failure:
http://lab.llvm.org:8011/builders/clang-sphinx-docs/builds/12043/steps/docs-clang-html/logs/stdio
llvm-svn: 309852
Marshall Clow [Wed, 2 Aug 2017 18:21:34 +0000 (18:21 +0000)]
Fix shadowing warning
llvm-svn: 309851