David L. Jones [Mon, 20 Mar 2017 20:10:30 +0000 (20:10 +0000)]
[X86] Clean up test/CodeGen/X86/2006-03-01-InstrSchedBug.ll
Summary:
- Migrated from grep to FileCheck.
- Re-indented, removed boilerplate comments.
- Added 'entry' label at beginning of basic block.
Patch by Jorge Gorbe!
Reviewed By: RKSimon
Subscribers: RKSimon, jgorbe, llvm-commits
Differential Revision: https://reviews.llvm.org/D30317
llvm-svn: 298298
Zachary Turner [Mon, 20 Mar 2017 19:56:52 +0000 (19:56 +0000)]
Explicitly add move constructor/assignment operators.
These are needed due to some obscure rules in the standard
about how std::vector selects between copy and move
constructors, which can cause a conforming implementation
to attempt to select the copy constructor of RuleMatcher,
which will fail since std::unique_ptr<> isn't copyable.
llvm-svn: 298294
Nirav Dave [Mon, 20 Mar 2017 19:48:22 +0000 (19:48 +0000)]
Add test case for merging of chained stores of mismatched type.
llvm-svn: 298293
Kevin Enderby [Mon, 20 Mar 2017 19:46:55 +0000 (19:46 +0000)]
Add the rest of the error checking for Mach-O dyld compact bind entry errors
and test cases for each of the error checks.
To do this more plumbing was needed so that the segment indexes and
segment offsets can be checked. Basically what was done was the SegInfo
from llvm-objdump’s MachODump.cpp was moved into libObject for Mach-O
objects as BindRebaseSegInfo and it is only created when an iterator for
bind or rebase entries are created.
This commit really only adds the error checking and test cases for the
bind table entires and the checking for the lazy bind and weak bind entries
are still to be fully done as well as the rebase entires. Though some of
the plumbing for those are added with this commit. Those other error
checks and test cases will be added in follow on commits.
Note, the two llvm_unreachable() calls should now actually be unreachable
with the error checks in place and would take a logic bug in the error
checking code to be reached if the segment indexes and segment
offsets are used from a checked bind entry. Comments have been added
to the methods that require the arguments to have been checked
prior to calling.
llvm-svn: 298292
Jim Ingham [Mon, 20 Mar 2017 19:21:31 +0000 (19:21 +0000)]
Get ObjectFileMachO to handle @executable_path
Only do this when we are debugging an executable, since we
don't have a good way to trace from an ObjectFile back to its
containing executable. Detecting pre-run libs before running
is "best effort" in lldb, but this one is pretty easy.
llvm-svn: 298290
Jim Ingham [Mon, 20 Mar 2017 19:19:03 +0000 (19:19 +0000)]
Fix a problem with line tables & .o files that start with code with no line table entries.
If you have code before the first line table entry when debugging with .o files on macOS, the
LineTable entry search code was assigning all that code to the first line table entry. Don't do that.
<rdar://problem/
31095765>
llvm-svn: 298289
Evgeniy Stepanov [Mon, 20 Mar 2017 18:45:34 +0000 (18:45 +0000)]
Revert r298158.
Revert "[asan] Fix dead stripping of globals on Linux."
OOM in gold linker.
llvm-svn: 298288
Evgeniy Stepanov [Mon, 20 Mar 2017 18:45:27 +0000 (18:45 +0000)]
Revert r298174, r298173, r298169, r298159.
Revert "Fix sanitizer tests with LLVM_TOOL_LLD_BUILD=OFF."
Revert "[asan] Remove gc-sections test with bfd."
Revert "[asan] Disable globals-gc test with ld.bfd."
Revert "[asan] Fix dead stripping of globals on Linux (compiler-rt)"
OOM in gold linker.
llvm-svn: 298287
Simon Pilgrim [Mon, 20 Mar 2017 18:33:23 +0000 (18:33 +0000)]
Fixed include order. NFCI.
llvm-svn: 298286
Peter Collingbourne [Mon, 20 Mar 2017 18:19:41 +0000 (18:19 +0000)]
Try using llvm::errc, should hopefully fix version mismatch problem on clang-s390x-linux bot.
llvm-svn: 298285
Marshall Clow [Mon, 20 Mar 2017 18:18:09 +0000 (18:18 +0000)]
Add two more papers from Kona, and sort them
llvm-svn: 298284
Krzysztof Parzyszek [Mon, 20 Mar 2017 18:12:58 +0000 (18:12 +0000)]
[Hexagon] Recognize polynomial-modulo loop idiom again
Regain the ability to recognize loops calculating polynomial modulo
operation. This ability has been lost due to some changes in the
preceding optimizations. Add code to preprocess the IR to a form
that the pattern matching code can recognize.
llvm-svn: 298282
Konstantin Zhuravlyov [Mon, 20 Mar 2017 18:06:45 +0000 (18:06 +0000)]
[AMDGPU] Run always inliner early in opt
Differential Revision: https://reviews.llvm.org/D31141
llvm-svn: 298281
Daniel Berlin [Mon, 20 Mar 2017 18:04:19 +0000 (18:04 +0000)]
Add missing updated test from VN coercion changes. Instructions were renamed. NFC
llvm-svn: 298280
David Blaikie [Mon, 20 Mar 2017 18:01:07 +0000 (18:01 +0000)]
Fix UB found by -Wtautological-undefined-compare
llvm-svn: 298279
Duncan P. N. Exon Smith [Mon, 20 Mar 2017 17:58:26 +0000 (17:58 +0000)]
Reapply "Modules: Cache PCMs in memory and avoid a use-after-free"
This reverts commit r298185, effectively reapplying r298165, after fixing the
new unit tests (PR32338). The memory buffer generator doesn't null-terminate
the MemoryBuffer it creates; this version of the commit informs getMemBuffer
about that to avoid the assert.
Original commit message follows:
----
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: 298278
Jonathan Roelofs [Mon, 20 Mar 2017 17:49:36 +0000 (17:49 +0000)]
Mention that the Sphinx docs build wants version 1.5 or later
`misc.highlighting_failure` support was added to `suppress_warnings` in that
version, and the warnings-as-errors docs build relies on it.
llvm-svn: 298277
Reid Kleckner [Mon, 20 Mar 2017 17:45:59 +0000 (17:45 +0000)]
[WinEH] Adjust decision to emit SEH moves for leaf functions
Move the check for "MF->hasWinCFI()" up into the calculation of the
shouldEmitMoves boolean, rather than putting it in the early returning
if. This ensures that endFunction doesn't try to emit .seh_* directives
for leaf functions.
llvm-svn: 298276
Jonathan Roelofs [Mon, 20 Mar 2017 17:07:49 +0000 (17:07 +0000)]
Fix some sphinx -Werror's
... mostly having to do with code blocks which the syntax highlighter chokes on
llvm-svn: 298275
Francis Ricci [Mon, 20 Mar 2017 17:06:42 +0000 (17:06 +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: 298274
Tim Northover [Mon, 20 Mar 2017 16:52:08 +0000 (16:52 +0000)]
GlobalISel: allow quad-precision values to be dumped.
Otherwise the fallback path fails with an assertion on AAPCS AArch64 targets,
when "long double" is encountered.
llvm-svn: 298273
George Rimar [Mon, 20 Mar 2017 16:44:28 +0000 (16:44 +0000)]
[ELF] - Detemplate MipsGotSection<ELFT>
This continues detemplation process.
Detemplating MipsGotSection<ELFT> is helpfull because can
help to detemplate getRelocTargetVA. (one more change is required)
It opens road to detemplation of GotSection<ELFT> and probably
something else after that.
Differential revision: https://reviews.llvm.org/D31090
llvm-svn: 298272
Peter Collingbourne [Mon, 20 Mar 2017 16:41:57 +0000 (16:41 +0000)]
Support, LTO: When pruning a directory, ignore files matching a prefix.
This is a safeguard against data loss if the user specifies a directory
that is not a cache directory. Teach the existing cache pruning clients
to create files with appropriate names.
Differential Revision: https://reviews.llvm.org/D31109
llvm-svn: 298271
Dehao Chen [Mon, 20 Mar 2017 16:40:44 +0000 (16:40 +0000)]
Updates branch_weights annotation for call instructions during inlining.
Summary: Inliner should update the branch_weights annotation to scale it to proper value.
Reviewers: davidxl, eraman
Reviewed By: eraman
Subscribers: zzheng, llvm-commits
Differential Revision: https://reviews.llvm.org/D30767
llvm-svn: 298270
George Rimar [Mon, 20 Mar 2017 16:40:21 +0000 (16:40 +0000)]
[ELF] - Detemplate BuildIdSection section.
Does not introduce anything new,
just performs detemplate, using methods we
already have.
Differential revision: https://reviews.llvm.org/D30935
llvm-svn: 298269
Adrian Prantl [Mon, 20 Mar 2017 16:39:41 +0000 (16:39 +0000)]
Use isa<> instead of dyn_cast<> (NFC).
llvm-svn: 298268
Kuba Mracek [Mon, 20 Mar 2017 16:36:34 +0000 (16:36 +0000)]
Disable stack-use-after-return.cc on AArch64. The test was not testing the right thing before (the call to pthread_attr_setstacksize wasn't doing anything) anyway, and now it's running out of stack due to an unrelated change.
llvm-svn: 298267
David Blaikie [Mon, 20 Mar 2017 16:35:33 +0000 (16:35 +0000)]
Avoid potential ADL ambiguity between llvm::make_unique and std::make_unique (when building as C++14+)
Patch by Moritz Kiefer!
llvm-svn: 298266
Dmitry Preobrazhensky [Mon, 20 Mar 2017 16:33:20 +0000 (16:33 +0000)]
[AMDGPU][MC] Fix for Bugs 28201, 28199, 28170 + LIT tests
This fix enables sp3 abs modifier with constants
Reviewers: artem.tamazov
Differential Revision: https://reviews.llvm.org/D30825
llvm-svn: 298265
Craig Topper [Mon, 20 Mar 2017 16:31:14 +0000 (16:31 +0000)]
[InstCombine] Print a debug message when we constant fold an operand during worklist creation
InstCombine tries to constant fold instruction operands during worklist building, but we don't print that we're doing this.
We also set a change flag here that causes us to rebuild and rerun the worklist one more time even if processing the worklist itself created no additional changes. So in the log I saw two inst combine runs that visited all instructions without printing that anything was changed. I may be submitting another patch to remove the change flag unless I can find some reason why we should be doing that.
Differential Revision: https://reviews.llvm.org/D31091
llvm-svn: 298264
Jessica Paquette [Mon, 20 Mar 2017 16:25:04 +0000 (16:25 +0000)]
[Outliner] ACTUALLY remove the errs output
I don't know how to type. This fixes the last commit which would have made all
of the overflows legal, and kept the screaming.
llvm-svn: 298263
Daniel Berlin [Mon, 20 Mar 2017 16:08:29 +0000 (16:08 +0000)]
Templatize parts of VNCoercion, and add constant-only versions of the functions to be used in NewGVN.
NFCI.
Summary:
This is ground work for the changes to enable coercion in NewGVN.
GVN doesn't care if they end up constant because it eliminates as it goes.
NewGVN cares.
IRBuilder and ConstantFolder deliberately present the same interface,
so we use this to our advantage to templatize our functions to make
them either constant only or not.
Reviewers: davide
Subscribers: llvm-commits, Prazek
Differential Revision: https://reviews.llvm.org/D30928
llvm-svn: 298262
Pavel Labath [Mon, 20 Mar 2017 16:07:17 +0000 (16:07 +0000)]
Fix remote test suite directory creation
r298203 make SBPlatform::MakeDirectory less recursive, which breaks the
test suite creation of test directory hierarchy creation on the remote
target. Since the function was never fully recursive, and the name does
not imply recursiveness, I fix the problem by modifying the test runner
to do the recursion manually.
I also make the runner complain more loudly when it fails to create the
directory -- previously it just printed the error to stdout and caused
most of the tests to hang, which is not very helpful in diagnosing the
problem.
llvm-svn: 298261
Jessica Paquette [Mon, 20 Mar 2017 15:51:45 +0000 (15:51 +0000)]
[Outliner] Remove output for offset range check
Forgot to remove some output before committing last time. (Instruction fixups
don't actually overflow anywhere in the test suite so far, so I missed it).
To prevent the outliner from screaming "Overflow!" in the event that that
does happen, this commit removes that output.
llvm-svn: 298260
Michael Kruse [Mon, 20 Mar 2017 15:37:32 +0000 (15:37 +0000)]
[DeLICM] Refector out parseSetOrNull. NFC.
Note that the isl::union_set(isl_ctx,std::string) constructor will
auto-convert the char* to an std::string. Converting a nullptr to
std::string is undefined in C++11 (sect. 21.4.2.9).
llvm-svn: 298259
Michael Kruse [Mon, 20 Mar 2017 15:24:45 +0000 (15:24 +0000)]
[DeLICM] Add forgotten isl_space_set_tuple_id in unittests.
Otherwise the isl_id NewId which ensures uniqueness of the
created space is unused. None of the tests currently uses an
nameless tuple, so there is not change in what is tested.
llvm-svn: 298258
Daniel Sanders [Mon, 20 Mar 2017 15:20:42 +0000 (15:20 +0000)]
[tablegen][globalisel] Capture instructions into locals and related infrastructure for multiple instructions matches.
Summary:
Prepare the way for nested instruction matching support by having actions
like CopyRenderer look up operands in the RuleMatcher rather than a
specific InstructionMatcher. This allows actions to reference any operand
from any matched instruction.
It works by checking the 'shape' of the match and capturing
each matched instruction to a local variable. If the shape is wrong
(not enough operands, leaf nodes where non-leafs are expected, etc.), then
the rule exits early without checking the predicates. Once we've captured
the instructions, we then test the predicates as before (except using the
local variables). If the match is successful, then we render the new
instruction as before using the local variables.
It's not noticable in this patch but by the time we support multiple
instruction matching, this patch will also cause a significant improvement
to readability of the emitted code since
MRI.getVRegDef(I->getOperand(0).getReg()) will simply be MI1 after
emitCxxCaptureStmts().
This isn't quite NFC because I've also fixed a bug that I'm surprised we
haven't encountered yet. It now checks there are at least the expected
number of operands before accessing them with getOperand().
Depends on D30531
Reviewers: t.p.northover, qcolombet, aditya_nandakumar, ab, rovka
Reviewed By: rovka
Subscribers: dberris, kristof.beyls, llvm-commits
Differential Revision: https://reviews.llvm.org/D30535
llvm-svn: 298257
Anastasia Stulova [Mon, 20 Mar 2017 15:02:54 +0000 (15:02 +0000)]
[OpenCL] Fix extension guards for atomic functions
Review: D30830
Patch by James Price!
llvm-svn: 298256
Dmitry Preobrazhensky [Mon, 20 Mar 2017 14:50:35 +0000 (14:50 +0000)]
[AMDGPU][MC] Fix for Bugs 28200, 28202 + LIT tests
Fixed several related issues with VOP3 fp modifiers.
Reviewers: artem.tamazov
Differential Revision: https://reviews.llvm.org/D30821
llvm-svn: 298255
Diana Picus [Mon, 20 Mar 2017 14:40:18 +0000 (14:40 +0000)]
[GlobalISel] Use the correct calling conv for calls
This commit adds a parameter that lets us pass in the calling convention
of the call to CallLowering::lowerCall. This allows us to handle
situations where the calling convetion of the callee is different from
that of the caller.
Differential Revision: https://reviews.llvm.org/D31039
llvm-svn: 298254
Simon Pilgrim [Mon, 20 Mar 2017 14:40:12 +0000 (14:40 +0000)]
Use MutableArrayRef for APFloat::convertToInteger
As discussed on D31074, use MutableArrayRef for destination integer buffers to help assert before stack overflows happen.
llvm-svn: 298253
Rafael Espindola [Mon, 20 Mar 2017 14:35:41 +0000 (14:35 +0000)]
Inline a few functions.
I don't foresee having to makes these functions any stricter or
fancier, so it probably makes sense to inline them.
llvm-svn: 298252
Rafael Espindola [Mon, 20 Mar 2017 14:33:33 +0000 (14:33 +0000)]
Initialize dot.
This would fix an initialized error found by msan. The error is not
showing after r298241, but it is not clear why.
llvm-svn: 298251
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