Diana Picus [Fri, 7 Jul 2017 08:53:27 +0000 (08:53 +0000)]
[ARM] GlobalISel: Fixup r307365
Rename member DebugLoc -> DbgLoc (so it doesn't conflict with the class
name).
llvm-svn: 307366
Diana Picus [Fri, 7 Jul 2017 08:39:04 +0000 (08:39 +0000)]
[ARM] GlobalISel: Select hard G_FCMP for s32
We lower to a sequence consisting of:
- MOVi 0 into a register
- VCMPS to do the actual comparison and set the VFP flags
- FMSTAT to move the flags out of the VFP unit
- MOVCCi to either use the "zero register" that we have previously set
with the MOVi, or move 1 into the result register, based on the values
of the flags
As was the case with soft-float, for some predicates (one, ueq) we
actually need two comparisons instead of just one. When that happens, we
generate two VCMPS-FMSTAT-MOVCCi sequences and chain them by means of
using the result of the first MOVCCi as the "zero register" for the
second one. This is a bit overkill, since one comparison followed by
two non-flag-setting conditional moves should be enough. In any case,
the backend manages to CSE one of the comparisons away so it doesn't
matter much.
Note that unlike SelectionDAG and FastISel, we always use VCMPS, and not
VCMPES. This makes the code a lot simpler, and it also seems correct
since the LLVM Lang Ref defines simple true/false returns if the
operands are QNaN's. For SNaN's, even VCMPS throws an Invalid Operand
exception, so they won't be slipping through unnoticed.
Implementation-wise, this introduces a template so we can share the same
code that we use for handling integer comparisons, since the only
differences are in the details (exact opcodes to be used etc). Hopefully
this will be easy to extend to s64 G_FCMP.
llvm-svn: 307365
George Rimar [Fri, 7 Jul 2017 08:29:51 +0000 (08:29 +0000)]
[ELF] - Handle symbols with default version early.
This fixes last testcase provided in PR28414.
In short issue is next: when we had X@@Version symbol in object A,
we did not resolve it to X early. Then when in another object B
we had reference to undefined X, symbol X from archive was fetched.
Since both archive and object A contains another symbol Z, duplicate
symbol definition was triggered as a result.
Correct behavior is to use X@@Version from object A instead and do not fetch
any symbols from archive.
Differential revision: https://reviews.llvm.org/D35059
llvm-svn: 307364
Craig Topper [Fri, 7 Jul 2017 06:22:36 +0000 (06:22 +0000)]
[TableGen] Cleanup capturing of instruction namespace for the fast isel emitter to remove a std::string and duplicated code. NFC
llvm-svn: 307363
Craig Topper [Fri, 7 Jul 2017 06:22:35 +0000 (06:22 +0000)]
[TableGen] Use StringRef instead of std::string for CodeGenInstruction namespace. NFC
llvm-svn: 307362
Craig Topper [Fri, 7 Jul 2017 05:50:45 +0000 (05:50 +0000)]
[TableGen] Add a proper namespace to an Instruction in an AsmMatcher test. This is required after r307358.
llvm-svn: 307361
Zachary Turner [Fri, 7 Jul 2017 05:41:25 +0000 (05:41 +0000)]
Fix lld tests after r307356.
llvm-svn: 307360
Rafael Espindola [Fri, 7 Jul 2017 05:36:53 +0000 (05:36 +0000)]
Reduce code duplication.
By addding a mapNameToDWARFSection we only need to check section names
in one place.
llvm-svn: 307359
Craig Topper [Fri, 7 Jul 2017 05:19:25 +0000 (05:19 +0000)]
[TableGen] Fix some mismatches in the use of Namespace fields versus Target name in some of our emitters.
Some of our emitters were using the name of the Target to reference things that were created by others emitters using Namespace.
Apparently all targets have the same Target name as their instruction and register Namespace field?
Someone on IRC had a target that didn't do this and was getting build errors. This patch is a necessary, but maybe not sufficient fix.
llvm-svn: 307358
Duncan P. N. Exon Smith [Fri, 7 Jul 2017 05:13:36 +0000 (05:13 +0000)]
cmath: Support clang's -fdelayed-template-parsing
r283051 added some functions to cmath (in namespace std) that have the
same name as functions in math.h (in the global namespace). Clang's
limited support for `-fdelayed-template-parsing` chokes on this. Rename
the ones in `cmath` and their uses in `complex` and the test.
rdar://problem/
32848355
llvm-svn: 307357
Zachary Turner [Fri, 7 Jul 2017 05:04:36 +0000 (05:04 +0000)]
[PDB] Teach libpdb to write DBI Stream ECNames.
Based strictly on the name, this seems to have something to do
width edit & continue. The goal of this patch has nothing to do
with supporting edit and continue though. msvc link.exe writes
very basic information into this area even when *not* compiling
with support for E&C, and so the goal here is to bring lld-link
to parity. Since we cannot know what assumptions standard tools
make about the content of PDB files, we need to be as close as
possible.
This ECNames data structure is a standard PDB string hash table.
link.exe puts a single string into this hash table, which is the
full path to the PDB file on disk. It then references this string
from the module descriptor for the compiler generated `* Linker *`
module.
With this patch, lld-link will generate the exact same sequence of
bytes as MSVC link for this subsection for a given object file
input (as reported by `llvm-pdbutil bytes -ec`).
llvm-svn: 307356
Tobias Grosser [Fri, 7 Jul 2017 04:20:55 +0000 (04:20 +0000)]
Make create_ll work with latest LLVM [NFC]
- Instead of running with -O0, we enable the highest optimization level, but
then disable optimizations. This ensures that possibly important metadata
is still emitted.
- Update the code for attribute removal to work with latest LLVM
- Do not cut an arbitrary number of lines from the LL file. It is undocumented
why this was needed at the first place, and such a feature is likely to
break with trivial IR changes that may come in the future.
llvm-svn: 307355
Lang Hames [Fri, 7 Jul 2017 03:22:57 +0000 (03:22 +0000)]
[Orc] Add missing return value (left out in r307350).
llvm-svn: 307354
Tony Tye [Fri, 7 Jul 2017 03:10:01 +0000 (03:10 +0000)]
Correct GFX9 processor names.
Differential Revision: https://reviews.llvm.org/D33736
llvm-svn: 307353
Matthias Braun [Fri, 7 Jul 2017 03:02:18 +0000 (03:02 +0000)]
RegisterScavenging: Fix PR33687
When scavenging for a use in instruction MI, we will reload after
that instruction and hence cannot spill uses/defs of this instruction.
This fixes http://llvm.org/PR33687
llvm-svn: 307352
Matthias Braun [Fri, 7 Jul 2017 03:02:17 +0000 (03:02 +0000)]
LiveRegUnits: Rename accumulateBackward()->accumulate()
Contrary to the stepForward()/stepBackward() method accumulate() doesn't
have a direction as defs, uses and clobbers all have the same effect.
Also improve the documentation comment.
llvm-svn: 307351
Lang Hames [Fri, 7 Jul 2017 02:59:13 +0000 (02:59 +0000)]
[ORC] Errorize the ORC APIs.
This patch updates the ORC layers and utilities to return and propagate
llvm::Errors where appropriate. This is necessary to allow ORC to safely handle
error cases in cross-process and remote JITing.
llvm-svn: 307350
Yaxun Liu [Fri, 7 Jul 2017 02:40:13 +0000 (02:40 +0000)]
[InferAddressSpaces] Fix assertion about null pointer
InferAddressSpaces does not check address space in collectFlatAddressExpressions,
which causes values with non flat address space put into Postorder and causes
assertion in cloneValueWithNewAddressSpace.
This patch fixes assertion in OpenCL 2.0 conformance test generic_address_space
subtest for amdgcn target.
Differential Revision: https://reviews.llvm.org/D34991
llvm-svn: 307349
Sam Clegg [Fri, 7 Jul 2017 02:01:29 +0000 (02:01 +0000)]
[WebAssembly] Support weak defined symbols
Model weakly defined symbols as symbols that are both
exports and imported and marked as weak. Local references
to the symbols refer to the import but the linker can
resolve this to the weak export if not strong symbol
is found at link time.
Differential Revision: https://reviews.llvm.org/D35029
llvm-svn: 307348
Sean Fertile [Fri, 7 Jul 2017 02:00:06 +0000 (02:00 +0000)]
Extend memcpy expansion in Transform/Utils to handle wider operand types.
Adds loop expansions for known-size and unknown-sized memcpy calls, allowing the
target to provide the operand types through TTI callbacks. The default values
for the TTI callbacks use int8 operand types and matches the existing behaviour
if they aren't overridden by the target.
Differential revision: https://reviews.llvm.org/D32536
llvm-svn: 307346
Evgeniy Stepanov [Fri, 7 Jul 2017 01:31:23 +0000 (01:31 +0000)]
Revert r307342, r307343.
Revert "Copy arguments passed by value into explicit allocas for ASan."
Revert "[asan] Add end-to-end tests for overflows of byval arguments."
Build failure on lldb-x86_64-ubuntu-14.04-buildserver.
Test failure on clang-cmake-aarch64-42vma and sanitizer-x86_64-linux-android.
llvm-svn: 307345
Kuba Mracek [Fri, 7 Jul 2017 01:06:20 +0000 (01:06 +0000)]
[cmake] Cache results of find_darwin_sdk_dir
This improves find_darwin_sdk_dir to cache the results of executing xcodebuild to find the SDK. Should significantly reduce the CMake re-configure time.
Differential Revision: https://reviews.llvm.org/D34736
llvm-svn: 307344
Evgeniy Stepanov [Fri, 7 Jul 2017 00:48:38 +0000 (00:48 +0000)]
[asan] Add end-to-end tests for overflows of byval arguments.
Included is one test for passing structs by value and one test for passing C++
objects by value.
Patch by Matt Morehouse.
Differential revision: https://reviews.llvm.org/D34827
llvm-svn: 307343
Evgeniy Stepanov [Fri, 7 Jul 2017 00:48:25 +0000 (00:48 +0000)]
Copy arguments passed by value into explicit allocas for ASan.
ASan determines the stack layout from alloca instructions. Since
arguments marked as "byval" do not have an explicit alloca instruction, ASan
does not produce red zones for them. This commit produces an explicit alloca
instruction and copies the byval argument into the allocated memory so that red
zones are produced.
Patch by Matt Morehouse.
Differential revision: https://reviews.llvm.org/D34789
llvm-svn: 307342
Evgeniy Stepanov [Fri, 7 Jul 2017 00:48:12 +0000 (00:48 +0000)]
Update Cross-DSO CFI documentation.
Reviewers: pcc
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D35094
llvm-svn: 307341
Anna Thomas [Fri, 7 Jul 2017 00:40:37 +0000 (00:40 +0000)]
[SafepointIRVerifier] NFC: Refactor code for identifying exclusive base type
Added a new Enum to identify if the base pointer is exclusively null or
exlusively some constant or not exclusively any constant.
Converted the base pointer identification method from recursive to
iterative form.
llvm-svn: 307340
George Karpenkov [Fri, 7 Jul 2017 00:22:11 +0000 (00:22 +0000)]
[lit] Modify LIT to accept environment variable LIT_FILTER to select tests.
This is especially useful when lit is invoked indirectly by the build
system, and additional arguments can not be easily specified.
Differential Revision: https://reviews.llvm.org/D35091
llvm-svn: 307339
Wei Mi [Fri, 7 Jul 2017 00:11:05 +0000 (00:11 +0000)]
[ConstHoisting] Turn on consthoist-with-block-frequency by default.
Using profile information to guide consthoisting is generally helpful for
performance, so the patch turns it on by default. No compile time or perf
regression were found using spec2000 and spec2006 on x86. Some significant
improvement (>20%) was seen on internal benchmarks.
Differential Revision: https://reviews.llvm.org/D35063
llvm-svn: 307338
Tim Hammerquist [Thu, 6 Jul 2017 23:25:35 +0000 (23:25 +0000)]
Fix Xcode project file for gtest schemes.
<rdar://problem/
33066993>
llvm-svn: 307335
Michael Kuperstein [Thu, 6 Jul 2017 23:24:39 +0000 (23:24 +0000)]
Reverting r307326 because it breaks clang tests.
llvm-svn: 307334
Craig Topper [Thu, 6 Jul 2017 23:18:43 +0000 (23:18 +0000)]
[InstCombine] No need to pass DataLayout to helper functions if we're passing the InstCombiner object. We can just ask it for the DataLayout. NFC
llvm-svn: 307333
Craig Topper [Thu, 6 Jul 2017 23:18:42 +0000 (23:18 +0000)]
[InstCombine] Remove unused arguments from some helper functions. NFC
llvm-svn: 307332
Craig Topper [Thu, 6 Jul 2017 23:18:41 +0000 (23:18 +0000)]
[InstCombine] Change a couple helper functions to only take the IRBuilder as an argument and not the whole InstCombiner object. NFC
llvm-svn: 307331
Kuba Mracek [Thu, 6 Jul 2017 23:09:16 +0000 (23:09 +0000)]
[cmake] Add an option to prefer public SDK in find_darwin_sdk_dir
Adds a CMake option DARWIN_PREFER_PUBLIC_SDK, off by default. When on, this prefers to use the public SDK, even when an internal one is present. With this, it's easy to emulate a build that the public buildbots are doing.
Differential Revision: https://reviews.llvm.org/D35071
llvm-svn: 307330
Sterling Augustine [Thu, 6 Jul 2017 22:47:19 +0000 (22:47 +0000)]
This call-site should have been updated as part of D34304.
Summary: Use an argument adjuster to preserve behavior inadvertantly changed by D34304.
Reviewers: klimek
Differential Revision: https://reviews.llvm.org/D35095
llvm-svn: 307329
Wei Mi [Thu, 6 Jul 2017 22:32:27 +0000 (22:32 +0000)]
[ConstHoisting] choose to hoist when frequency is the same.
The patch is to adjust the strategy of frequency based consthoisting:
Previously when the candidate block has the same frequency with the existing
blocks containing a const, it will not hoist the const to the candidate block.
For that case, now we change the strategy to hoist the const if only existing
blocks have more than one block member. This is helpful for reducing code size.
Differential Revision: https://reviews.llvm.org/D35084
llvm-svn: 307328
Michael Kuperstein [Thu, 6 Jul 2017 22:18:54 +0000 (22:18 +0000)]
[NVPTX] Add lowering of i128 params.
The patch adds support of i128 params lowering. The changes are quite trivial to
support i128 as a "special case" of integer type. With this patch, we lower i128
params the same way as aggregates of size 16 bytes: .param .b8 _ [16].
Currently, NVPTX can't deal with the 128 bit integers:
* in some cases because of failed assertions like
ValVTs.size() == OutVals.size() && "Bad return value decomposition"
* in other cases emitting PTX with .i128 or .u128 types (which are not valid [1])
[1] http://docs.nvidia.com/cuda/parallel-thread-execution/index.html#fundamental-types
Differential Revision: https://reviews.llvm.org/D34555
Patch by: Denys Zariaiev (denys.zariaiev@gmail.com)
llvm-svn: 307326
Lang Hames [Thu, 6 Jul 2017 22:02:49 +0000 (22:02 +0000)]
[ORC] Add missing <memory> include for shared_ptr.
Accidentally left out of r307319.
llvm-svn: 307322
Reid Kleckner [Thu, 6 Jul 2017 21:51:32 +0000 (21:51 +0000)]
[asan] Fix -Winvalid-paste error with clang-cl
We don't need to paste tokens here. String literal concatenation works
just fine here with MSVC and Clang.
llvm-svn: 307321
David L. Jones [Thu, 6 Jul 2017 21:46:47 +0000 (21:46 +0000)]
Change remaining references to lit.util.capture to use subprocess.check_output.
Summary:
The capture() function was removed in r306625. This should fix PGO breakages
reported by Michael Zolotukhin.
Reviewers: mzolotukhin
Subscribers: sanjoy, llvm-commits
Differential Revision: https://reviews.llvm.org/D35088
llvm-svn: 307320
Lang Hames [Thu, 6 Jul 2017 21:33:48 +0000 (21:33 +0000)]
[ORC] Update GlobalMappingLayer::addModuleSet to addModule.
This layer was accidentally left out of r306166.
llvm-svn: 307319
Rafael Espindola [Thu, 6 Jul 2017 21:33:23 +0000 (21:33 +0000)]
Use @LINE in two more tests.
llvm-svn: 307318
Martin Storsjo [Thu, 6 Jul 2017 21:08:34 +0000 (21:08 +0000)]
[COFF, AArch64] Set the private label prefix to .L
This fixes calls to external functions starting with a capital L,
fixing errors like this:
fatal error: error in backend: assembler label 'LocalFree' can not be undefined
Differential Revision: https://reviews.llvm.org/D35079
llvm-svn: 307317
Richard Smith [Thu, 6 Jul 2017 21:05:56 +0000 (21:05 +0000)]
Reject attempts to build a module without -fmodules, rather than silently doing weird things.
llvm-svn: 307316
Sterling Augustine [Thu, 6 Jul 2017 21:02:52 +0000 (21:02 +0000)]
Allow CompilerInvocations to generate .d files.
Summary:
Most clang tools should ignore the -M
family of options because one wouldn't want them
to generate a new dependency (.d) file. However,
some tools may want this dependency file. This
patch creates a mechanism for them to do this.
This implementation just plumbs a boolean down
several layers of calls. Each of the modified calls
has several call sites, and so a single member
variable or new API entry point won't work.
An alternative would be to write a function to filter
the -M family of arguments out of CC1Args, and have
each caller call that function by hand before calling
newInvocation, Invocation::run, or buildAstFromCodeWithArgs.
This is a more complicated and error-prone solution.
Why burden all the callers to remember to use
this function?
But I could rewrite this patch to use that method if
that is deemed more appropriate.
Reviewers: klimek
Reviewed By: klimek
Subscribers: klimek, cfe-commits
Differential Revision: https://reviews.llvm.org/D34304
llvm-svn: 307315
Matt Arsenault [Thu, 6 Jul 2017 20:57:05 +0000 (20:57 +0000)]
AMDGPU: Add macro fusion schedule DAG mutation
Try to increase opportunities to shrink vcc uses.
llvm-svn: 307313
Matt Arsenault [Thu, 6 Jul 2017 20:56:59 +0000 (20:56 +0000)]
AMDGPU: Minor cleanup of shrinking logic
llvm-svn: 307312
Matt Arsenault [Thu, 6 Jul 2017 20:56:57 +0000 (20:56 +0000)]
AMDGPU: Remove unnecessary IR from MIR tests
llvm-svn: 307311
Reid Kleckner [Thu, 6 Jul 2017 20:40:27 +0000 (20:40 +0000)]
[lit] Factor out some shell input/output redirection logic, NFC
This is a very light refactoring aimed at improving readability. There
is definitely still room for improvement here.
llvm-svn: 307310
Kuba Mracek [Thu, 6 Jul 2017 20:38:33 +0000 (20:38 +0000)]
Fix whitespace lint issue (introduced in r307307).
llvm-svn: 307309
Stanislav Mekhanoshin [Thu, 6 Jul 2017 20:34:21 +0000 (20:34 +0000)]
[AMDGPU] Always use rcp + mul with fast math
Regardless of relaxation options such as -cl-fast-relaxed-math
we are producing rather long code for fdiv via amdgcn_fdiv_fast
intrinsic. This intrinsic is used to replace fdiv with 2.5ulp
metadata and does not handle denormals, thus believed to be fast.
An fdiv instruction can also have fast math flag either by itself
or together with fpmath metadata. Clang used with a relaxation flag
always produces both metadata and fast flag:
%div = fdiv fast float %v, %0, !fpmath !12
!12 = !{float 2.500000e+00}
Current implementation ignores fast flag and favors metadata. An
instruction with just fast flag would be lowered to a fastest rcp +
mul, but that never happen on practice because of described mutual
clang and BE behavior.
This change allows an "fdiv fast" to be always lowered as rcp + mul.
Differential Revision: https://reviews.llvm.org/D34844
llvm-svn: 307308
Kuba Mracek [Thu, 6 Jul 2017 20:30:09 +0000 (20:30 +0000)]
[sanitizer] Use TASK_VM_INFO to get the maximum VM address on iOS/AArch64
We currently hardcode the maximum VM address on iOS/AArch64, which is not really correct and this value changes between device configurations. Let's use TASK_VM_INFO to retrieve the maximum VM address dynamically.
Differential Revision: https://reviews.llvm.org/D35032
llvm-svn: 307307
Davide Italiano [Thu, 6 Jul 2017 20:04:20 +0000 (20:04 +0000)]
[lib/LTO] Add a comment to explain where we set the linkage in the summary.
Pointed out by Teresa!
llvm-svn: 307305
Chad Rosier [Thu, 6 Jul 2017 20:00:25 +0000 (20:00 +0000)]
[ValueTracking] Support icmps fed by 'and' and 'or'.
This patch adds support for handling some forms of ands and ors in
ValueTracking's isImpliedCondition API.
PR33611
https://reviews.llvm.org/D34901
llvm-svn: 307304
Davide Italiano [Thu, 6 Jul 2017 19:58:26 +0000 (19:58 +0000)]
[LTO] Fix the interaction between linker redefined symbols and ThinLTO
This is the same as r304719 but for ThinLTO.
The substantial difference is that in this case we don't have
whole visibility, just the summary.
In the LTO case, when we got the resolution for the input file we
could just see if the linker told us whether a symbol was linker
redefined (using --wrap or --defsym) and switch the linkage directly
for the GV.
Here, we have the summary. So, we record that the linkage changed
from <whatever it was> to $weakany to prevent IPOs across this symbol
boundaries and actually just switch the linkage at FunctionImport time.
This patch should also fixes the lld bits (as all the scaffolding for
communicating if a symbol is linker redefined should be there & should
be the same), but I'll make sure to add some tests there as well.
Fixes PR33192.
Differential Revision: https://reviews.llvm.org/D35064
llvm-svn: 307303
Aditya Nandakumar [Thu, 6 Jul 2017 19:40:07 +0000 (19:40 +0000)]
[GISel]: Enhance the MachineIRBuilder API
Allows the MachineIRBuilder APIs to directly create registers (based on
LLT or TargetRegisterClass) as well as accept MachineInstrBuilders
and implicitly converts to register(with getOperand(0).getReg()).
Eg usage:
LLT s32 = LLT::scalar(32);
auto C32 = Builder.buildConstant(s32, 32);
auto Tmp = Builder.buildInstr(TargetOpcode::G_SUB, s32, C32,
OtherReg);
auto Tmp2 = Builder.buildInstr(Opcode, DstReg,
Builder.buildConstant(s32, 31)); ....
Only a few methods added for now.
Reviewed by Tim
llvm-svn: 307302
Simon Pilgrim [Thu, 6 Jul 2017 19:33:10 +0000 (19:33 +0000)]
[X86][SSE] Tests for bitcasting iX integers to vXi1 boolean vectors
Including sign/zero extension to legal types
llvm-svn: 307301
Rafael Espindola [Thu, 6 Jul 2017 19:09:35 +0000 (19:09 +0000)]
Add @LINE to checks in a test.
This makes it a lot easier to see which error failed a check.
llvm-svn: 307300
Chris Lattner [Thu, 6 Jul 2017 19:06:13 +0000 (19:06 +0000)]
remove an unused empty file.
llvm-svn: 307299
David Blaikie [Thu, 6 Jul 2017 19:00:12 +0000 (19:00 +0000)]
Prototype: Reduce llvm-profdata merge memory usage further
The InstrProfWriter already stores the name and hash of the record in
the nested maps it uses for lookup while merging - this data is
duplicated in the value within the maps.
Refactor the InstrProfRecord to use a nested struct for the counters
themselves so that InstrProfWriter can use this nested struct alone
without the name or hash duplicated there.
This work is incomplete, but enough to demonstrate the value (around a
50% decrease in memory usage for a large test case (10GB -> 5GB)).
Though most of that decrease is probably from removing the
SoftInstrProfError as well, but I haven't implemented a replacement for
it yet. (it needs to go with the counters, because the operations on the
counters - merging, etc, are where the failures are - unlike the
name/hash which are totally unused by those counter-related operations
and thus easy to split out)
Ongoing discussion about removing SoftInstrProfError as a field of the
InstrProfRecord is happening on the thread that added it - including
the possibility of moving back towards an earlier version of that
proposed patch that passed SoftInstrProfError through the various APIs,
rather than as a member of InstrProfRecord.
Reviewers: davidxl
Differential Revision: https://reviews.llvm.org/D34838
llvm-svn: 307298
Mandeep Singh Grang [Thu, 6 Jul 2017 18:52:16 +0000 (18:52 +0000)]
[llvm] Separate out reverse iteration flag into its own header
Summary: This will ease out adding reverse iteration flags to other containers by simply including the header.
Reviewers: mehdi_amini, dexonsmith, davide, dblaikie
Reviewed By: dblaikie
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D35042
llvm-svn: 307297
Mandeep Singh Grang [Thu, 6 Jul 2017 18:49:57 +0000 (18:49 +0000)]
[Objective-C] Fix non-determinism in clang
Summary: Iteration of the unordered Ivars causes objc-modern-metadata-visibility.mm (uncovered by reverse iterating SmallPtrSet).
Reviewers: dblaikie, davide, rsmith
Reviewed By: dblaikie
Subscribers: cfe-commits, llvm-commits
Differential Revision: https://reviews.llvm.org/D34860
llvm-svn: 307296
Craig Topper [Thu, 6 Jul 2017 18:47:47 +0000 (18:47 +0000)]
[InstCombine] Remove include of DIBuilder.h and Dwarf.h as they don't appear to be necessary.
llvm-svn: 307295
Leo Li [Thu, 6 Jul 2017 18:47:05 +0000 (18:47 +0000)]
Modify constraints in `llvm::canReplaceOperandWithVariable`
Summary:
`Instruction::Switch`: only first operand can be set to a non-constant value.
`Instruction::InsertValue` both the first and the second operand can be set to a non-constant value.
`Instruction::Alloca` return true for non-static allocation.
Reviewers: efriedma
Reviewed By: efriedma
Subscribers: srhines, pirama, llvm-commits
Differential Revision: https://reviews.llvm.org/D34905
llvm-svn: 307294
Craig Topper [Thu, 6 Jul 2017 18:39:49 +0000 (18:39 +0000)]
[Constants] Replace calls to ConstantInt::equalsInt(0)/equalsInt(1) with isZero and isOne. NFCI
llvm-svn: 307293
Craig Topper [Thu, 6 Jul 2017 18:39:47 +0000 (18:39 +0000)]
[Constants] If we already have a ConstantInt*, prefer to use isZero/isOne/isMinusOne instead of isNullValue/isOneValue/isAllOnesValue inherited from Constant. NFCI
Going through the Constant methods requires redetermining that the Constant is a ConstantInt and then calling isZero/isOne/isMinusOne.
llvm-svn: 307292
Anna Thomas [Thu, 6 Jul 2017 18:39:26 +0000 (18:39 +0000)]
[LoopUnrollRuntime] Bailout when multiple exiting blocks to the unique latch exit block
Currently, we do not support multiple exiting blocks to the
latch exit block. However, this bailout wasn't triggered when we had a
unique exit block (which is the latch exit), with multiple exiting
blocks to that unique exit.
Moved the bailout so that it's triggered in both cases and added
testcase.
llvm-svn: 307291
Craig Topper [Thu, 6 Jul 2017 18:35:52 +0000 (18:35 +0000)]
[InstCombine] Remove Builder argument from InstCombiner::tryFactorization. NFC
Builder is already a member of the InstCombiner class so we can use it with passing it.
llvm-svn: 307290
Simon Pilgrim [Thu, 6 Jul 2017 18:27:34 +0000 (18:27 +0000)]
[X86][SSE] Dropped -mcpu from bitcast+setcc tests
Use triple and attribute only for consistency
Added SSE2/AVX tests on 256-bit vectors to test PACKSS behaviour
llvm-svn: 307289
Simon Pilgrim [Thu, 6 Jul 2017 18:17:07 +0000 (18:17 +0000)]
Fix spelling in comments. NFCI.
llvm-svn: 307288
Jim Ingham [Thu, 6 Jul 2017 18:06:25 +0000 (18:06 +0000)]
Working through testcases, converting to run_to_source_breakpoint.
llvm-svn: 307287
Peter Collingbourne [Thu, 6 Jul 2017 17:56:01 +0000 (17:56 +0000)]
Bitcode: Include any strings added to the string table in the module hash.
Differential Revision: https://reviews.llvm.org/D35037
llvm-svn: 307286
Adam Nemet [Thu, 6 Jul 2017 17:51:15 +0000 (17:51 +0000)]
[opt-viewer] Move under tools, install it
We weren't installing opt-viewer and co before, this fixes the omission. I am
also moving the tools from utils/ to tools/. I believe that this is more
appropriate since these tools have matured greatly in the past year through
contributions by multiple people (thanks!) so they are ready to become
external tools.
The tools are installed under <install>/share/opt-viewer/.
I am *not* adding the llvm- prefix. If people feel strongly about adding
that, this is probably a good time since the new location will require some
mental adjustment anyway.
Fixes PR33521
Differential Revision: https://reviews.llvm.org/D35048
llvm-svn: 307285
Kuba Mracek [Thu, 6 Jul 2017 17:45:01 +0000 (17:45 +0000)]
More fixup for r307281: Move the #includes to sanitizer_linux.cc
llvm-svn: 307284
Kuba Mracek [Thu, 6 Jul 2017 17:17:50 +0000 (17:17 +0000)]
Fixup for r307281: Also move GetKernelAreaSize into sanitizer_linux.cc
llvm-svn: 307282
Kuba Mracek [Thu, 6 Jul 2017 17:13:40 +0000 (17:13 +0000)]
[sanitizer] Split GetMaxVirtualAddress into separate Linux version and Mac version [NFC]
The logic in GetMaxVirtualAddress is already pretty complex, and I want to get rid of the hardcoded value for iOS/AArch64, which would need adding more Darwin-specific code, so let's split the implementation into sanitizer_linux.cc and sanitizer_mac.cc files. NFC.
Differential Revision: https://reviews.llvm.org/D35031
llvm-svn: 307281
Reid Kleckner [Thu, 6 Jul 2017 16:41:15 +0000 (16:41 +0000)]
Fix pdb-scopes.test
llvm-svn: 307280
Rafael Espindola [Thu, 6 Jul 2017 16:40:44 +0000 (16:40 +0000)]
Remove redundant argument. NFC.
llvm-svn: 307279
Reid Kleckner [Thu, 6 Jul 2017 16:39:32 +0000 (16:39 +0000)]
[PDB] Fill in "Parent" and "End" fields of scope-like symbol records
Summary:
There are a variety of records that open scopes: function scopes, block
scopes, and inlined call site scopes. These symbol records contain
Parent and End fields with the offsets of other symbol records. The End
field contains the offset of the matching S_END or S_INLINESITE_END
record. The Parent field contains the offset of the parent record, or 0
if this is a top-level scope (i.e. a function).
With this change, `llvm-pdbutil pretty -all` no longer crashes on PDBs
produced by LLD. I haven't tried a real debugger yet.
Reviewers: zturner, ruiu
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D34898
llvm-svn: 307278
Sjoerd Meijer [Thu, 6 Jul 2017 16:37:31 +0000 (16:37 +0000)]
This reverts r305820 (ARMv.2-A FP16 vector intrinsics) because it shows
problems in testing, see comments in D34161 for some more details.
A fix is in progres in D35011, but a revert seems better now as the fix will
probably take some more time to land.
llvm-svn: 307277
Craig Topper [Thu, 6 Jul 2017 16:29:43 +0000 (16:29 +0000)]
[SimplifyCFG] Move a portion of an if statement that should already be implied to an assert
Summary: In this code we got to Dom by following the predecessor link of BB. So it stands to reason that BB should also show up as a successor of Dom's terminator right? There isn't a way to have the CFG connect in only one direction is there?
Reviewers: jmolloy, davide, mcrosier
Reviewed By: mcrosier
Subscribers: mcrosier, llvm-commits
Differential Revision: https://reviews.llvm.org/D35025
llvm-svn: 307276
Craig Topper [Thu, 6 Jul 2017 16:24:23 +0000 (16:24 +0000)]
[InstCombine] Change helper method to a file local static method. NFC
llvm-svn: 307275
Craig Topper [Thu, 6 Jul 2017 16:24:22 +0000 (16:24 +0000)]
[InstCombine] Clarify comment to mention other transform that it does. NFC
llvm-svn: 307274
Craig Topper [Thu, 6 Jul 2017 16:24:21 +0000 (16:24 +0000)]
[InstCombine] Add single use checks to SimplifyBSwap to ensure we are really saving instructions
Bswap isn't a simple operation so we need to make sure we are really removing a call to it before doing these simplifications.
For the case when both LHS and RHS are bswaps I've allowed it to be moved if either LHS or RHS has a single use since that at least allows us to move it later where it might find another bswap to combine with and it decreases the use count on the other side so maybe the other user can be optimized.
Differential Revision: https://reviews.llvm.org/D34974
llvm-svn: 307273
Gheorghe-Teodor Bercea [Thu, 6 Jul 2017 16:22:21 +0000 (16:22 +0000)]
[OpenMP] Extend CLANG target options with device offloading kind.
Summary: Pass the type of the device offloading when building the tool chain for a particular target architecture. This is required when supporting multiple tool chains that target a single device type. In our particular use case, the OpenMP and CUDA tool chains will use the same ```addClangTargetOptions ``` method. This enables the reuse of common options and ensures control over options only supported by a particular tool chain.
Reviewers: arpith-jacob, caomhin, carlo.bertolli, ABataev, jlebar, hfinkel, tstellar, Hahnfeld
Reviewed By: hfinkel
Subscribers: jgravelle-google, aheejin, rengolin, jfb, dschuff, sbc100, cfe-commits
Differential Revision: https://reviews.llvm.org/D29647
llvm-svn: 307272
Gheorghe-Teodor Bercea [Thu, 6 Jul 2017 16:08:15 +0000 (16:08 +0000)]
[OpenMP] Customize CUDA-based tool chain selection
Summary: This patch provides a generic way of selecting CUDA based tool chains as host-device pairs.
Reviewers: arpith-jacob, caomhin, carlo.bertolli, ABataev, Hahnfeld, jlebar, hfinkel, tstellar
Reviewed By: Hahnfeld
Subscribers: rengolin, cfe-commits
Differential Revision: https://reviews.llvm.org/D29658
llvm-svn: 307271
Craig Topper [Thu, 6 Jul 2017 15:58:54 +0000 (15:58 +0000)]
[InstCombine] Don't create extra ConstantInt objects in foldSelectICmpAnd. NFCI
Instead just use APInt objects and only create a ConstantInt at the end if we need it for the Offset.
llvm-svn: 307270
Wei Mi [Thu, 6 Jul 2017 15:52:14 +0000 (15:52 +0000)]
[LSR] Narrow search space by filtering non-optimal formulae with the same ScaledReg and Scale.
When the formulae search space is huge, LSR uses a series of heuristic to keep
pruning the search space until the number of possible solutions are within
certain limit.
The big hammer of the series of heuristics is NarrowSearchSpaceByPickingWinnerRegs,
which picks the register which is used by the most LSRUses and deletes the other
formulae which don't use the register. This is a effective way to prune the search
space, but quite often not a good way to keep the best solution. We saw cases before
that the heuristic pruned the best formula candidate out of search space.
To relieve the problem, we introduce a new heuristic called
NarrowSearchSpaceByFilterFormulaWithSameScaledReg. The basic idea is in order to
reduce the search space while keeping the best formula, we want to keep as many
formulae with different Scale and ScaledReg as possible. That is because the central
idea of LSR is to choose a group of loop induction variables and use those induction
variables to represent LSRUses. An induction variable candidate is often represented
by the Scale and ScaledReg in a formula. If we have more formulae with different
ScaledReg and Scale to choose, we have better opportunity to find the best solution.
That is why we believe pruning search space by only keeping the best formula with the
same Scale and ScaledReg should be more effective than PickingWinnerReg. And we use
two criteria to choose the best formula with the same Scale and ScaledReg. The first
criteria is to select the formula using less non shared registers, and the second
criteria is to select the formula with less cost got from RateFormula. The patch
implements the heuristic before NarrowSearchSpaceByPickingWinnerRegs, which is the
last resort.
Testing shows we get 1.8% and 2% on two internal benchmarks on x86. llvm nightly
testsuite performance is neutral. We also tried lsr-exp-narrow and it didn't help
on the two improved internal cases we saw.
Differential Revision: https://reviews.llvm.org/D34583
llvm-svn: 307269
Simon Pilgrim [Thu, 6 Jul 2017 15:34:17 +0000 (15:34 +0000)]
[X86][SSE4A] Add support for shuffle combining to INSERTQI.
llvm-svn: 307268
Sanjay Patel [Thu, 6 Jul 2017 15:31:38 +0000 (15:31 +0000)]
[CGP, x86] update test checks; NFC
This was auto-generated using an older version of the script,
and that version does not work with phis, so if we enable
expansion it will go bad.
llvm-svn: 307267
Jonathan Roelofs [Thu, 6 Jul 2017 15:20:12 +0000 (15:20 +0000)]
Add a test harness
Mostly cargo-culted from libcxxabi, since the unwinder was forked from there in
the first place. There may still be cruft that's only applicable to libcxxabi,
but that can be addressed in-tree.
https://reviews.llvm.org/D35038
llvm-svn: 307266
Simon Pilgrim [Thu, 6 Jul 2017 14:52:24 +0000 (14:52 +0000)]
[X86][SSE4A] Add test showing missed opportunities to combine INSERTQI shuffle
llvm-svn: 307265
Krasimir Georgiev [Thu, 6 Jul 2017 14:39:39 +0000 (14:39 +0000)]
[clang-format] Add TextProto language name, NFC
llvm-svn: 307264
Joel Jones [Thu, 6 Jul 2017 14:17:36 +0000 (14:17 +0000)]
Doxygen formatting. NFCI
llvm-svn: 307263
Sanjay Patel [Thu, 6 Jul 2017 14:15:15 +0000 (14:15 +0000)]
[x86] fix over-specified triple and auto-generate checks; NFC
llvm-svn: 307262
Krasimir Georgiev [Thu, 6 Jul 2017 13:58:29 +0000 (13:58 +0000)]
[clang-format] Add space between a message field key and the opening bracket in proto messages
Summary:
This patch updates the formatting of message fields of type `a{...}` to `a {...}`
for proto messages.
Reviewers: djasper
Reviewed By: djasper
Subscribers: klimek, cfe-commits
Differential Revision: https://reviews.llvm.org/D35015
llvm-svn: 307261
Siddharth Bhat [Thu, 6 Jul 2017 13:42:42 +0000 (13:42 +0000)]
[Polly] [PPCGCodeGeneration] Teach `must_kills` to kill scalars that are local to the scop.
- By definition, we can pass something as a `kill` to PPCG if we know
that no data can flow across a kill.
- This is useful for more complex examples where we have scalars that
are local to a scop.
- If the local is only used within a scop, we are free to kill it.
Differential Revision: https://reviews.llvm.org/D35045
llvm-svn: 307260
Mikael Holmen [Thu, 6 Jul 2017 13:18:21 +0000 (13:18 +0000)]
[MachineVerifier] Add check that tied physregs aren't different.
Summary: Added MachineVerifier code to check register ties more thoroughly, especially so that physical registers that are tied are the same. This may help e.g. when creating MIR files.
Original patch by Jesper Antonsson
Reviewers: stoklund, sanjoy, qcolombet
Reviewed By: qcolombet
Subscribers: qcolombet, llvm-commits
Differential Revision: https://reviews.llvm.org/D34394
llvm-svn: 307259
Ilya Biryukov [Thu, 6 Jul 2017 13:10:55 +0000 (13:10 +0000)]
Fixes to Dockerfile scripts.
- Put buildfiles into /tmp/clang-build/build, instead of /tmp/clang-build.
We checkout the sources to /tmp/clang-build/src and running
cmake in /tmp/clang-build was done by mistake.
- Don't add an extra ';' at the start of enabled projects list.
It worked either way, but looked strange.
- Minor comment update.
llvm-svn: 307258
Simon Pilgrim [Thu, 6 Jul 2017 13:09:19 +0000 (13:09 +0000)]
[X86][SSE] combineX86ShuffleChain - merge duplicate creations of integer mask types
llvm-svn: 307257