Maxim Ostapenko [Mon, 20 Mar 2017 14:06:04 +0000 (14:06 +0000)]
[sancov] Fix broken links and displaced coloring in coverage-report-server.py
This patch fixes two issues:
* Fixed relative links to source files
* Enumeration of lines in source files starts from 1 instead of 0 to
align with .symcov files generated by sancov -symbolize
Patch by Dmitiriy Nikiforov.
Differential Revision: https://reviews.llvm.org/D31038
llvm-svn: 298250
Simon Pilgrim [Mon, 20 Mar 2017 13:55:35 +0000 (13:55 +0000)]
Strip trailing whitespace
llvm-svn: 298249
Simon Pilgrim [Mon, 20 Mar 2017 13:54:44 +0000 (13:54 +0000)]
Strip trailing whitespace
llvm-svn: 298248
Simon Pilgrim [Mon, 20 Mar 2017 13:53:59 +0000 (13:53 +0000)]
Strip trailing whitespace
llvm-svn: 298247
Francis Ricci [Mon, 20 Mar 2017 13:45:29 +0000 (13:45 +0000)]
Revert "Use pthreads for thread-local lsan allocator cache on darwin"
This is still failing stack-use-after-return on linux-aarch64.
This reverts commit
5b350130fc4bf6f70c078a5d97096df98a17a057.
llvm-svn: 298246
Sylvestre Ledru [Mon, 20 Mar 2017 12:56:40 +0000 (12:56 +0000)]
Add more examples to clang-format configuration
Reviewers: djasper
Reviewed By: djasper
Subscribers: klimek, cfe-commits
Differential Revision: https://reviews.llvm.org/D30990
llvm-svn: 298245
George Rimar [Mon, 20 Mar 2017 10:47:00 +0000 (10:47 +0000)]
[ELF] - Simplify redundant templated call. NFC.
llvm-svn: 298244
George Rimar [Mon, 20 Mar 2017 10:40:40 +0000 (10:40 +0000)]
[ELF] - Get rid of uintX_t in GdbIndexSection. NFC.
llvm-svn: 298243
George Rimar [Mon, 20 Mar 2017 10:16:57 +0000 (10:16 +0000)]
[ELF] - Reuse Config->IsLE. NFC.
llvm-svn: 298242
George Rimar [Mon, 20 Mar 2017 10:09:58 +0000 (10:09 +0000)]
[ELF] - Combine LinkerScriptBase and LinkerScript<ELFT>
Patch removes templated linkerscript class.
Unfortunately that required 2 additional static methods
findSymbol() and addRegularSymbol() because code
depends on Symtab<ELFT>::X
Differential revision: https://reviews.llvm.org/D30982
llvm-svn: 298241
George Rimar [Mon, 20 Mar 2017 09:51:18 +0000 (09:51 +0000)]
[ELF] - Apply clang-format. NFC.
llvm-svn: 298240
Konstantin Zhuravlyov [Mon, 20 Mar 2017 09:26:08 +0000 (09:26 +0000)]
Revert "[AMDGPU] Run always inliner early in opt"
This reverts commit r297958, it breaks device-libs build.
llvm-svn: 298239
Laszlo Nagy [Mon, 20 Mar 2017 09:03:24 +0000 (09:03 +0000)]
[scan-build-py] use python tempfile for tempdir
Differential Revision: https://reviews.llvm.org/D30862
llvm-svn: 298238
Craig Topper [Mon, 20 Mar 2017 06:40:39 +0000 (06:40 +0000)]
[IR] Move a few static functions in Instruction class inline.
They just check for certain opcodes and opcode enums are available in Instruction.h.
llvm-svn: 298237
Michael Zolotukhin [Mon, 20 Mar 2017 06:33:07 +0000 (06:33 +0000)]
[ConstantRange] Add setSizeSmallerThanOf method.
Summary:
ConstantRange class currently has a method getSetSize, which is mostly used to
compare set sizes of two constant ranges (there is only one spot where it's used
in a slightly different scenario). This patch introduces setSizeSmallerThanOf
method, which does such comparison in a more efficient way. In the original
method we have to extend our types to (BitWidth+1), which can result it using
slow case of APInt, extra memory allocations, etc.
The change is supposed to not change any functionality, but it slightly improves
compile time. Here is compile time improvements that I observed on CTMark:
* tramp3d-v4 -2.02%
* pairlocalalign -1.82%
* lencod -1.67%
Reviewers: sanjoy, atrick, pete
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D31104
llvm-svn: 298236
Craig Topper [Mon, 20 Mar 2017 05:08:41 +0000 (05:08 +0000)]
[IR] Remove some unneeded includes from Operator.h and fix cpp files that were transitively depending on it. NFC
llvm-svn: 298235
Craig Topper [Mon, 20 Mar 2017 05:08:38 +0000 (05:08 +0000)]
[IR] Add missing copyright header.
llvm-svn: 298234
Craig Topper [Mon, 20 Mar 2017 01:29:52 +0000 (01:29 +0000)]
[APInt] Don't initialize VAL to 0 in APInt constructors. Push it down to the initSlowCase and other init methods.
I'm not sure if zeroing VAL before writing pVal is really necessary, but at least one other place did it in code.
But by taking the store out of line, this reduces the opt binary by about 20k on my local x86-64 build.
llvm-svn: 298233
Xin Tong [Mon, 20 Mar 2017 00:30:19 +0000 (00:30 +0000)]
Remove unnecessary IDom check
Summary: This Idom check seems unnecessary. The immediate children of a node on the Dominator Tree should always be the IDom of its immediate children in this case.
Reviewers: hfinkel, majnemer, dberlin
Reviewed By: dberlin
Subscribers: dberlin, davide, llvm-commits
Differential Revision: https://reviews.llvm.org/D26954
llvm-svn: 298232
Craig Topper [Sun, 19 Mar 2017 21:45:57 +0000 (21:45 +0000)]
[InstCombine] Remove duplicate code in SimplifyDemandedUseBits for URem. NFC
llvm-svn: 298231
Simon Atanasyan [Sun, 19 Mar 2017 19:32:51 +0000 (19:32 +0000)]
[ELF] clang-format sortMipsSymbols. NFC
llvm-svn: 298230
Aaron Ballman [Sun, 19 Mar 2017 17:23:23 +0000 (17:23 +0000)]
Rename the clang-tidy safety module to be hicpp, for the High-Integrity C++ coding standard from PRQA.
This commit renames all of the safety functionality to be hicpp, adds an appropriate LICENSE.TXT, and updates the documentation accordingly.
llvm-svn: 298229
Craig Topper [Sun, 19 Mar 2017 17:11:09 +0000 (17:11 +0000)]
[AVX-512] Handle kor/kand/kandn/kxor/kxnor/knot intrinsics at lowering time instead of isel
Summary:
Currently we handle these intrinsics at isel with special patterns. But as they just map to normal logic operations, we should just handle them at lowering. This will expose them to DAG combine optimizations. Right now the kor-sequence test generates a bunch of regclass copies between GR16 and VK16 that the peephole optimizer and/or register coallescing are removing to keep everything in the mask domain. By handling the logic op intrinsics earlier, these copies become bitcasts in the DAG and get removed by DAG combine which seems more robust.
This should help enable my plan to stop copying between K registers and GR8/GR16. The peephole optimizer can't remove a chain of copies between K and GR32 with insert_subreg/extract_subreg present in the chain so the kor-sequence test break. But this patch should dodge the problem entirely.
Reviewers: zvi, delena, RKSimon, igorb
Reviewed By: igorb
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D31056
llvm-svn: 298228
Craig Topper [Sun, 19 Mar 2017 17:04:52 +0000 (17:04 +0000)]
[InstCombine] Use update_test_checks.py to regenerate a test. NFC
llvm-svn: 298227
Simon Pilgrim [Sun, 19 Mar 2017 16:50:25 +0000 (16:50 +0000)]
Fix constant folding of fp2int to large integers
We make the assumption in most of our constant folding code that a fp2int will target an integer of 128-bits or less, calling the APFloat::convertToInteger with only uint64_t[2] of raw bits for the result.
Fuzz testing (PR24662) showed that we don't handle other cases at all, resulting in stack overflows and all sorts of crashes.
This patch uses the APSInt version of APFloat::convertToInteger instead to better handle such cases.
Differential Revision: https://reviews.llvm.org/D31074
llvm-svn: 298226
Simon Pilgrim [Sun, 19 Mar 2017 16:39:04 +0000 (16:39 +0000)]
Fix MSVC warning: "switch statement contains 'default' but no 'case' labels". NFCI.
llvm-svn: 298225
Ahmed Bougacha [Sun, 19 Mar 2017 16:13:00 +0000 (16:13 +0000)]
[GlobalISel] Don't select trivially dead instructions.
Folding instructions when selecting can cause them to become dead.
Don't select these dead instructions (if they don't have other side
effects, and don't define physical registers).
Preserve existing tests by adding COPYs.
In some tests, the G_CONSTANT vregs never get constrained to a class:
the only use of the vreg was folded into another instruction, so the
G_CONSTANT, now dead, never gets selected.
llvm-svn: 298224
Ahmed Bougacha [Sun, 19 Mar 2017 16:12:53 +0000 (16:12 +0000)]
[GlobalISel][AArch64] Add DBG_VALUE select test. NFC.
llvm-svn: 298223
Ahmed Bougacha [Sun, 19 Mar 2017 16:12:51 +0000 (16:12 +0000)]
[GlobalISel][AArch64] Split out cast select tests. NFC.
And remove some redundant bitcast tests.
Also split the test functions themselves: it makes it obvious to see
what's tested where and what isn't, it makes the tests much easier to
read and manually update, and, most importantly, it makes them almost
trivial to update using tooling. Yes, it's obnoxiously verbose, but
said tooling helps upgrade to better MIR syntax whenever available.
llvm-svn: 298222
Ahmed Bougacha [Sun, 19 Mar 2017 16:12:48 +0000 (16:12 +0000)]
[GlobalISel] Move method definition to the proper file. NFC.
llvm-svn: 298221
Ahmed Bougacha [Sun, 19 Mar 2017 16:12:45 +0000 (16:12 +0000)]
[CodeGen] Update hasSideEffects comment. NFC.
We used to have 3 side effect flags, but as of r222809, we only have
hasSideEffects. Change the comment to reflect that.
llvm-svn: 298220
Xin Tong [Sun, 19 Mar 2017 15:41:46 +0000 (15:41 +0000)]
Correct a rebase mistake.
Left out AA in jumpthreading SimplifyPartiallyRedundantLoad
llvm-svn: 298219
Xin Tong [Sun, 19 Mar 2017 15:31:16 +0000 (15:31 +0000)]
Remove unused arguments. NFCI
llvm-svn: 298218
Xin Tong [Sun, 19 Mar 2017 15:30:53 +0000 (15:30 +0000)]
[JumpThreading] Perform phi-translation in SimplifyPartiallyRedundantLoad.
Summary:
In case we are loading on a phi-load in SimplifyPartiallyRedundantLoad.
Try to phi translate it into incoming values in the predecessors before
we search for available loads.
This needs https://reviews.llvm.org/D30524
Reviewers: davide, sanjoy, efriedma, dberlin, rengolin
Reviewed By: dberlin
Subscribers: junbuml, llvm-commits
Differential Revision: https://reviews.llvm.org/D30543
llvm-svn: 298217
Xin Tong [Sun, 19 Mar 2017 15:27:52 +0000 (15:27 +0000)]
Extract FindAvailablePtrLoadStore out of FindAvailableLoadedValue. NFCI
Summary:
Extract FindAvailablePtrLoadStore out of FindAvailableLoadedValue.
Prepare for upcoming change which will do phi-translation for load on
phi pointer in jump threading SimplifyPartiallyRedundantLoad.
This is in preparation for https://reviews.llvm.org/D30543
Reviewers: efriedma, sanjoy, davide, dberlin
Reviewed By: davide
Subscribers: junbuml, davide, llvm-commits
Differential Revision: https://reviews.llvm.org/D30524
llvm-svn: 298216
Aaron Ballman [Sun, 19 Mar 2017 15:15:28 +0000 (15:15 +0000)]
Cleaning up the IdentifierResolver::iterator class a bit; NFC.
The comment about there being three different forms that Ptr represents was stale. Also, the opaque value does not need to be exposed (these functions are unused).
llvm-svn: 298215
Francis Ricci [Sun, 19 Mar 2017 15:02:43 +0000 (15:02 +0000)]
Use pthreads for thread-local lsan allocator cache on darwin
Summary:
This patch allows us to move away from using __thread on darwin,
which is requiring for building lsan for darwin on ios version 7
and on iossim i386.
Reviewers: kubamracek, kcc
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D29994
llvm-svn: 298214
Teresa Johnson [Sun, 19 Mar 2017 13:54:57 +0000 (13:54 +0000)]
Enable stripping of multiple DILocation on !llvm.loop metadata
Summary:
I found that stripDebugInfo was still leaving significant amounts of
debug info due to !llvm.loop that contained DILocation after stripping.
The support for stripping debug info on !llvm.loop added in r293377 only
removes a single DILocation. Enhance that to remove all DILocation from
!llvm.loop.
Reviewers: hfinkel, aprantl, dsanders
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D31117
llvm-svn: 298213
Oren Ben Simhon [Sun, 19 Mar 2017 13:23:20 +0000 (13:23 +0000)]
[MIR] Test assumes x64 windows calling convention upon printing/parsing MIR output/input.
llvm-svn: 298212
Benjamin Kramer [Sun, 19 Mar 2017 13:04:35 +0000 (13:04 +0000)]
[MIR] Add triple to test that assumes it runs on windows.
llvm-svn: 298211
Oren Ben Simhon [Sun, 19 Mar 2017 11:18:09 +0000 (11:18 +0000)]
CalleeSavedRegister was removed from MIR and is recalculated upon MIR parsing.
llvm-svn: 298210
Oren Ben Simhon [Sun, 19 Mar 2017 08:53:42 +0000 (08:53 +0000)]
Moving the test to x86 because other architectures do not suport regcall calling convention.
llvm-svn: 298209
Igor Breger [Sun, 19 Mar 2017 08:27:16 +0000 (08:27 +0000)]
[X86][AVX512][Clang][Intrinsics] Adding missing intrinsics to Clang .
Summary:
Adding missing intrinsics :
_mm512_set_epi16,
_mm512_set_epi8,
_mm512_permutevar_epi32
_mm512_mask_permutevar_epi32
Reviewers: zvi, guyblank, eladcohen, craig.topper
Reviewed By: craig.topper
Subscribers: craig.topper, cfe-commits
Differential Revision: https://reviews.llvm.org/D31034
llvm-svn: 298208
Oren Ben Simhon [Sun, 19 Mar 2017 08:14:18 +0000 (08:14 +0000)]
[MIR] Support Customed Register Mask and CSRs
The MIR printer dumps a string that describe the register mask of a function.
A static predefined list of register masks matches a static list of strings.
However when the register mask is not from the static predefined list, there is no descriptor string and the printer fails.
This patch adds support to custom register mask printing and dumping.
Also the list of callee saved registers (describing the registers that must be preserved for the caller) might be dynamic.
As such this data needs to be dumped and parsed back to the Machine Register Info.
Differential Revision: https://reviews.llvm.org/D30971
llvm-svn: 298207
Zachary Turner [Sun, 19 Mar 2017 06:00:31 +0000 (06:00 +0000)]
Fix syntax error when building with editline support.
llvm-svn: 298206
Zachary Turner [Sun, 19 Mar 2017 05:49:43 +0000 (05:49 +0000)]
Remove FileSystem::Get/SetFilePermissions
Differential Revision: https://reviews.llvm.org/D31089
llvm-svn: 298205
Craig Topper [Sun, 19 Mar 2017 05:49:16 +0000 (05:49 +0000)]
[InstCombine] Use setHighBits/setLowBits/setBitsFrom in place of getLowBitsSet/getHighBitsSet.
llvm-svn: 298204
Zachary Turner [Sun, 19 Mar 2017 05:48:47 +0000 (05:48 +0000)]
Remove FileSystem::MakeDirectory.
Have callers use llvm::sys::fs::create_directory() instead.
Differential Revision: https://reviews.llvm.org/D31086
llvm-svn: 298203
Zachary Turner [Sun, 19 Mar 2017 05:48:01 +0000 (05:48 +0000)]
Fix unit test compilation failure.
llvm-svn: 298202
Brian Gesiak [Sun, 19 Mar 2017 04:40:42 +0000 (04:40 +0000)]
[Analysis] bitreverse(undef) returns undef
Summary:
The reverse of an artbitrary bitpattern is also an arbitrary
bitpattern.
Reviewers: trentxintong, arsenm, majnemer
Reviewed By: majnemer
Subscribers: majnemer, wdng, llvm-commits
Differential Revision: https://reviews.llvm.org/D31118
llvm-svn: 298201
Kuba Mracek [Sun, 19 Mar 2017 00:59:08 +0000 (00:59 +0000)]
Re-commit of r296706 ("Increase stack size for stack-use-after-return test"). Hopefully the recent changes in the test will make it not flaky anymore.
Differential Revision: https://reviews.llvm.org/D30267
llvm-svn: 298200
Daniel Berlin [Sun, 19 Mar 2017 00:07:32 +0000 (00:07 +0000)]
NewGVN: Now that we have a better verifier, we can prove that we can erase the predicateuser set each time we mark it touched
llvm-svn: 298199
Daniel Berlin [Sun, 19 Mar 2017 00:07:27 +0000 (00:07 +0000)]
NewGVN: Remove dead code (for now)
llvm-svn: 298198
Tobias Grosser [Sat, 18 Mar 2017 23:12:49 +0000 (23:12 +0000)]
[CodeGen] Remove need for all parameters to be in scop context for load hoisting.
When not adding constraints on parameters using -polly-ignore-parameter-bounds,
the context may not necessarily list all parameter dimensions. To support code
generation in this situation, we now always iterate over the actual parameter
list, rather than relying on the context to list all parameter dimensions.
llvm-svn: 298197
Kuba Mracek [Sat, 18 Mar 2017 22:01:33 +0000 (22:01 +0000)]
Apparently, PTHREAD_STACK_MIN can be in limits.h on some systems...
llvm-svn: 298196
Kuba Mracek [Sat, 18 Mar 2017 21:35:12 +0000 (21:35 +0000)]
Change stack-use-after-return.cc to respect PTHREAD_STACK_MIN before calling pthread_attr_setstacksize. To investigate <https://reviews.llvm.org/D30267>. NFC.
llvm-svn: 298195
Tobias Grosser [Sat, 18 Mar 2017 20:54:43 +0000 (20:54 +0000)]
[IslExprBuilder] Print accessed memory locations with RuntimeDebugBuilder
After this change, enabling -polly-codegen-add-debug-printing in combination
with -polly-codegen-generate-expressions allows us to instrument the compiled
binaries to not only print the values stored and loaded to a given memory
access, but also to print the accessed location with array name and
per-dimension offset:
MemRef_A[3][2]
Store to 6299784: 5.000000
MemRef_A[3][3]
Load from 6299788: 0.000000
MemRef_A[3][3]
Store to 6299788: 6.000000
This can be very helpful for debugging.
llvm-svn: 298194
Kuba Mracek [Sat, 18 Mar 2017 20:39:31 +0000 (20:39 +0000)]
Add extra return value checks into stack-use-after-return.cc to help diagnose AArch64 test failures for <https://reviews.llvm.org/D30267>. NFC.
llvm-svn: 298193
Tobias Grosser [Sat, 18 Mar 2017 20:10:07 +0000 (20:10 +0000)]
[OpenMP] Do not emit lifetime markers for context
In commit r219005 lifetime markers have been introduced to mark the lifetime of
the OpenMP context data structure. However, their use seems incorrect and
recently caused a miscompile in ASC_Sequoia/CrystalMk after r298053 which was
not at all related to r298053. r298053 only caused a change in the loop order,
as this change resulted in a different isl internal representation which caused
the scheduler to derive a different schedule. This change then caused the IR to
change, which apparently created a pattern in which LLVM exploites the lifetime
markers. It seems we are using the OpenMP context outside of the lifetime
markers. Even though CrystalMk could probably be fixed by expanding the scope of
the lifetime markers, it is not clear what happens in case the OpenMP function
call is in a loop which will cause a sequence of starting and ending lifetimes.
As it is unlikely that the lifetime markers give any performance benefit, we
just drop them to remove complexity.
llvm-svn: 298192
Craig Topper [Sat, 18 Mar 2017 18:24:41 +0000 (18:24 +0000)]
[GVN] Fix accidental double storage of the function BasicBlock list in iterateOnFunction
Summary:
iterateOnFunction creates a ReversePostOrderTraversal object which does a post order traversal in its constructor and stores the results in an internal vector. Iteration over it just reads from the internal vector in reverse order.
The GVN code seems to be unaware of this and iterates over ReversePostOrderTraversal object and makes a copy of the vector into a local vector. (I think at one point in time we used a DFS here instead which would have required the local vector).
The net affect of this is that we have two vectors containing the basic block list. As I didn't want to expose the implementation detail of ReversePostOrderTraversal's constructor to GVN, I've changed the code to do an explicit post order traversal storing into the local vector and then reverse iterate over that.
I've also removed the reserve(256) since the ReversePostOrderTraversal wasn't doing that. I can add it back if we thinks it important. Though it seemed weird that it wasn't based on the size of the function.
Reviewers: davide, anemet, dberlin
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D31084
llvm-svn: 298191
Craig Topper [Sat, 18 Mar 2017 18:21:46 +0000 (18:21 +0000)]
[ValueTracking] Remove deadish code from computeKnownBitsAddSub.
The code assigned to KnownZero, but later code unconditionally assigned over it. I'm pretty sure the later code can handle the same cases and more equally well.
llvm-svn: 298190
Tamas Berghammer [Sat, 18 Mar 2017 17:33:00 +0000 (17:33 +0000)]
Remove some dead code from DumpValueObjectOptions::PointerDepth
llvm-svn: 298189
Daniel Berlin [Sat, 18 Mar 2017 15:41:40 +0000 (15:41 +0000)]
NewGVN: Greatly enhance the ability of the NewGVN verifier to detect
issues, subsuming previous verifier.
llvm-svn: 298188
Daniel Berlin [Sat, 18 Mar 2017 15:41:36 +0000 (15:41 +0000)]
NewGVN: Fix PHI evaluation bug exposed by new verifier. We were checking whether the incoming block was reachable instead of whether the specific edge was reachable
llvm-svn: 298187
Daniel Berlin [Sat, 18 Mar 2017 15:41:13 +0000 (15:41 +0000)]
DebugCounters: Add API for setting/unsetting programatically.
This is required so we can re-set the counter state for verifiers,
etc.
llvm-svn: 298186
Renato Golin [Sat, 18 Mar 2017 12:31:32 +0000 (12:31 +0000)]
Revert "Modules: Cache PCMs in memory and avoid a use-after-free"
This reverts commit r298165, as it broke the ARM builds.
llvm-svn: 298185
Matthias Braun [Sat, 18 Mar 2017 05:08:58 +0000 (05:08 +0000)]
ExecutionDepsFix: Let targets specialize the pass; NFC
Let targets specialize the pass with the register class so we can get a
parameterless default constructor and can put the pass into the pass
registry to enable testing with -run-pass=.
llvm-svn: 298184
Matthias Braun [Sat, 18 Mar 2017 05:05:40 +0000 (05:05 +0000)]
ExecutionDepsFix: Normalize names; NFC
Normalize ExeDepsFix, execution-fix, ExecutionDependencyFix and
ExecutionDepsFix to the last one.
llvm-svn: 298183
Matthias Braun [Sat, 18 Mar 2017 05:05:32 +0000 (05:05 +0000)]
CodeGen.cpp: Sort alphabetically; NFC
llvm-svn: 298182
Matthias Braun [Sat, 18 Mar 2017 05:05:29 +0000 (05:05 +0000)]
InitializePasses.h: Cleanup; NFC
- Sort alphabetically
- Normalize spaces
llvm-svn: 298181
Craig Topper [Sat, 18 Mar 2017 04:01:29 +0000 (04:01 +0000)]
[ValueTracking] Add APInt::setSignBit and use it to replace ORing with getSignBit which will malloc if the bit width is larger than 64.
llvm-svn: 298180
Nirav Dave [Sat, 18 Mar 2017 00:44:07 +0000 (00:44 +0000)]
Make library calls sensitive to regparm module flag (Fixes PR3997).
Reviewers: mkuper, rnk
Subscribers: mehdi_amini, jyknight, aemerson, llvm-commits, rengolin
Differential Revision: https://reviews.llvm.org/D27050
llvm-svn: 298179
Nirav Dave [Sat, 18 Mar 2017 00:43:57 +0000 (00:43 +0000)]
Capitalize ArgListEntry fields. NFC.
llvm-svn: 298178
Nirav Dave [Sat, 18 Mar 2017 00:43:39 +0000 (00:43 +0000)]
[X86] Add NumRegisterParameters Module Flag.
Reviewers: rnk, mkuper
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D27051
llvm-svn: 298177
Bruno Cardoso Lopes [Sat, 18 Mar 2017 00:32:34 +0000 (00:32 +0000)]
[LockFileManager] Reduce lock timeout
Go back to behavior pre-r231309 and reduce the timeout from 8 to ~1.5
min now that we have (a) PCMCache mechanism (r298165) and (b) timeout
that doesn't cause a failure, but actually build the module (r298175).
rdar://problem/
30297862
llvm-svn: 298176
Bruno Cardoso Lopes [Sat, 18 Mar 2017 00:26:18 +0000 (00:26 +0000)]
[Modules] In case of lock timeout, fallback and build module
Duncan's r298165 introduced the PCMCache mechanism, which guarantees
that locks aren't necessary anymore for correctness but only for
performance, by avoiding building it twice when possible.
Change the logic to avoid an error but actually build the module in case
the timeout happens. Instead of an error, still emit a remark for
debugging purposes.
rdar://problem/
30297862
llvm-svn: 298175
Evgeniy Stepanov [Sat, 18 Mar 2017 00:25:43 +0000 (00:25 +0000)]
Fix sanitizer tests with LLVM_TOOL_LLD_BUILD=OFF.
Only depend on LLD if it is going to be built.
llvm-svn: 298174
Evgeniy Stepanov [Sat, 18 Mar 2017 00:25:40 +0000 (00:25 +0000)]
[asan] Remove gc-sections test with bfd.
It used to be XFAIL: *, but with the new implementation it passes in some cases
and fails in other. There are similar tests for gold and lld that are not
flaky, and a positive test for bfd that makes sure that were are not breaking
existing functionality.
llvm-svn: 298173
Stanislav Mekhanoshin [Fri, 17 Mar 2017 23:56:58 +0000 (23:56 +0000)]
[AMDGPU] Add address space based alias analysis pass
This is direct port of HSAILAliasAnalysis pass, just cleaned for
style and renamed.
Differential Revision: https://reviews.llvm.org/D31103
llvm-svn: 298172
Craig Topper [Fri, 17 Mar 2017 23:48:02 +0000 (23:48 +0000)]
[BuildLibCalls] emitPutChar should infer function attributes for putchar
When InstCombine calls into SimplifyLibCalls and it createa putChar calls, we don't infer the attributes. And since SimplifyLibCalls doesn't use InstCombine's IRBuilder the calls doesn't end up in the worklist on this iteration of InstCombine. So it gets picked up on the next iteration where it causes an IR change. This of course causes InstCombine to run another iteration.
So this patch just gets the attributes right the first time. We already did this for puts and some other libcalls.
Differential Revision: https://reviews.llvm.org/D31094
llvm-svn: 298171
Argyrios Kyrtzidis [Fri, 17 Mar 2017 23:41:59 +0000 (23:41 +0000)]
[index] For C++ constructors/destructors, add references to the parent type where its name appears in definitions and declarations
Patch by Nathan Hawes!
https://reviews.llvm.org/D30730
llvm-svn: 298170
Evgeniy Stepanov [Fri, 17 Mar 2017 23:40:50 +0000 (23:40 +0000)]
[asan] Disable globals-gc test with ld.bfd.
Fails on clang-cmake-armv7-a15-full.
llvm-svn: 298169
Rui Ueyama [Fri, 17 Mar 2017 23:29:01 +0000 (23:29 +0000)]
Compute Config member function return values only once.
We had a few Config member functions that returns configuration values.
For example, we had is64() which returns true if the target is 64-bit.
The return values of these functions are constant and never change.
This patch is to compute them only once to make it clear that they'll
never change.
llvm-svn: 298168
Rui Ueyama [Fri, 17 Mar 2017 23:28:41 +0000 (23:28 +0000)]
Define Config::isLE and Config::wordsize.
isLE() return true if the target is little-endian.
wordsize() returns 8 for 64-bit and 4 for 32-bit.
llvm-svn: 298167
Sanjay Patel [Fri, 17 Mar 2017 23:04:18 +0000 (23:04 +0000)]
[x86] regenerate checks; NFC
llvm-svn: 298166
Duncan P. N. Exon Smith [Fri, 17 Mar 2017 22:55:13 +0000 (22:55 +0000)]
Modules: Cache PCMs in memory and avoid a use-after-free
Clang's internal build system for implicit modules uses lock files to
ensure that after a process writes a PCM it will read the same one back
in (without contention from other -cc1 commands). Since PCMs are read
from disk repeatedly while invalidating, building, and importing, the
lock is not released quickly. Furthermore, the LockFileManager is not
robust in every environment. Other -cc1 commands can stall until
timeout (after about eight minutes).
This commit changes the lock file from being necessary for correctness
to a (possibly dubious) performance hack. The remaining benefit is to
reduce duplicate work in competing -cc1 commands which depend on the
same module. Follow-up commits will change the internal build system to
continue after a timeout, and reduce the timeout. Perhaps we should
reconsider blocking at all.
This also fixes a use-after-free, when one part of a compilation
validates a PCM and starts using it, and another tries to swap out the
PCM for something new.
The PCMCache is a new type called MemoryBufferCache, which saves memory
buffers based on their filename. Its ownership is shared by the
CompilerInstance and ModuleManager.
- The ModuleManager stores PCMs there that it loads from disk, never
touching the disk if the cache is hot.
- When modules fail to validate, they're removed from the cache.
- When a CompilerInstance is spawned to build a new module, each
already-loaded PCM is assumed to be valid, and is frozen to avoid
the use-after-free.
- Any newly-built module is written directly to the cache to avoid the
round-trip to the filesystem, making lock files unnecessary for
correctness.
Original patch by Manman Ren; most testcases by Adrian Prantl!
llvm-svn: 298165
Sanjay Patel [Fri, 17 Mar 2017 22:47:21 +0000 (22:47 +0000)]
[x86] regenerate checks; NFC
llvm-svn: 298164
Evgeniy Stepanov [Fri, 17 Mar 2017 22:31:13 +0000 (22:31 +0000)]
Fix docs-llvm-html build.
llvm-svn: 298163
Jessica Paquette [Fri, 17 Mar 2017 22:26:55 +0000 (22:26 +0000)]
[Outliner] Add outliner for AArch64
This commit adds the necessary target hooks for outlining in AArch64. It also
refactors the switch statement used in `getMemOpBaseRegImmOfsWidth` into a
more general function, `getMemOpInfo`. This allows the outliner to share that
code without copying and pasting it.
The AArch64 outliner can be run using -mllvm -enable-machine-outliner, as with
the X86-64 outliner.
The test for this pass verifies that the outliner does, in fact outline
functions, fixes up the stack accesses properly, and can correctly generate a
tail call. In the future, this test should be replaced with a MIR test, so that
we can properly test immediate offset overflows in fixed-up instructions.
llvm-svn: 298162
Eli Friedman [Fri, 17 Mar 2017 22:19:52 +0000 (22:19 +0000)]
[SCEV] Use const Loop *L instead of Loop *L. NFC
Use const pointer in the trip count and trip multiple calculations.
Patch by Huihui Zhang <huihuiz@codeaurora.org>
llvm-svn: 298161
Davide Italiano [Fri, 17 Mar 2017 22:19:20 +0000 (22:19 +0000)]
[Sema] Unbreak GCC -Werror build (enum compare).
llvm-svn: 298160
Evgeniy Stepanov [Fri, 17 Mar 2017 22:17:38 +0000 (22:17 +0000)]
[asan] Fix dead stripping of globals on Linux (compiler-rt)
Runtime support for the new instrumentation of globals based on !associated, and a bunch of tests.
Differential Revision: https://reviews.llvm.org/D30120
llvm-svn: 298159
Evgeniy Stepanov [Fri, 17 Mar 2017 22:17:29 +0000 (22:17 +0000)]
[asan] Fix dead stripping of globals on Linux.
Use a combination of !associated, comdat, @llvm.compiler.used and
custom sections to allow dead stripping of globals and their asan
metadata. Sometimes.
Currently this works on LLD, which supports SHF_LINK_ORDER with
sh_link pointing to the associated section.
This also works on BFD, which seems to treat comdats as
all-or-nothing with respect to linker GC. There is a weird quirk
where the "first" global in each link is never GC-ed because of the
section symbols.
At this moment it does not work on Gold (as in the globals are never
stripped).
Differential Revision: https://reviews.llvm.org/D30121
llvm-svn: 298158
Evgeniy Stepanov [Fri, 17 Mar 2017 22:17:24 +0000 (22:17 +0000)]
Add !associated metadata.
This is an ELF-specific thing that adds SHF_LINK_ORDER to the global's section
pointing to the metadata argument's section. The effect of that is a reverse dependency
between sections for the linker GC.
!associated does not change the behavior of global-dce. The global
may also need to be added to llvm.compiler.used.
Since SHF_LINK_ORDER is per-section, !associated effectively enables
fdata-sections for the affected globals, the same as comdats do.
Differential Revision: https://reviews.llvm.org/D29104
llvm-svn: 298157
Eli Friedman [Fri, 17 Mar 2017 22:15:50 +0000 (22:15 +0000)]
[SelectionDAG] Remove redundant stores more aggressively.
Handle TokenFactors more aggressively in
SDValue::reachesChainWithoutSideEffects. This isn't really a
very effective change anymore because of other changes to
chain handling, but it's a cheap check, and the expanded
comments are still useful.
It might be possible to loosen the hasOneUse() requirement with a
deeper analysis, but a naive implementation of that check would be
expensive.
Differential Revision: https://reviews.llvm.org/D29845
llvm-svn: 298156
Peter Collingbourne [Fri, 17 Mar 2017 22:06:36 +0000 (22:06 +0000)]
ELF: Change check(Expected<T>, const Twine &) to call toString instead of converting to an error code.
llvm-svn: 298155
Evgeniy Stepanov [Fri, 17 Mar 2017 22:04:52 +0000 (22:04 +0000)]
[ELF] Restore GC handling of LINK_ORDER, C-named sections.
__start_xxx symbol keeps section xxx alive only if it is not
SHF_LINK_ORDER. Such sections can be used for user metadata, when
__start_xxx is used to iterate over section contents at runtime, and
the liveness is determined solely by the linked (associated) section.
This was earlier implemented in r294592, and broken in r296723.
Differential Revision: https://reviews.llvm.org/D30964
llvm-svn: 298154
Peter Collingbourne [Fri, 17 Mar 2017 21:49:09 +0000 (21:49 +0000)]
LTO: Work around libstdc++ version mismatch bug, see D31063 review thread.
llvm-svn: 298127
Matthias Gehre [Fri, 17 Mar 2017 21:41:20 +0000 (21:41 +0000)]
Implement DR 373 "Lookup on namespace qualified name in using-directive"
Summary:
3.4.6 [basic.lookup.udir] paragraph 1:
In a using-directive or namespace-alias-definition, during the lookup for a namespace-name or for a name in a nested-name-specifier, only namespace names are considered.
Reviewers: rsmith, aaron.ballman
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D30848
llvm-svn: 298126
Matt Arsenault [Fri, 17 Mar 2017 21:36:28 +0000 (21:36 +0000)]
AMDGPU: Fix broken condition in hazard recognizer
Fixes bug 32248.
llvm-svn: 298125