Roman Lebedev [Sat, 14 Jul 2018 16:44:37 +0000 (16:44 +0000)]
[NFC][InstCombine] Tests for x u> x & C to x u> C fold.
https://bugs.llvm.org/show_bug.cgi?id=38123
https://rise4fun.com/Alive/JvS
This pattern is not commutative. But InstSimplify will
already have taken care of the 'commutative' variant.
llvm-svn: 337099
Roman Lebedev [Sat, 14 Jul 2018 12:20:16 +0000 (12:20 +0000)]
[InstCombine] Fold x & (-1 >> y) u< x to x u> (-1 >> y)
https://bugs.llvm.org/show_bug.cgi?id=38123
https://rise4fun.com/Alive/ocb
This pattern is not commutative. But InstSimplify will
already have taken care of the 'commutative' variant.
llvm-svn: 337098
Roman Lebedev [Sat, 14 Jul 2018 12:20:11 +0000 (12:20 +0000)]
[NFC][InstCombine] Tests for x & (-1 >> y) u< x to x u> (-1 >> y)
https://bugs.llvm.org/show_bug.cgi?id=38123
https://rise4fun.com/Alive/ocb
This pattern is not commutative. But InstSimplify will
already have taken care of the 'commutative' variant.
llvm-svn: 337097
Roman Lebedev [Sat, 14 Jul 2018 12:20:06 +0000 (12:20 +0000)]
[InstCombine] Fold x & (-1 >> y) u>= x to x u<= (-1 >> y)
https://bugs.llvm.org/show_bug.cgi?id=38123
https://rise4fun.com/Alive/azI
This pattern is not commutative. But InstSimplify will
already have taken care of the 'commutative' variant.
llvm-svn: 337096
Roman Lebedev [Sat, 14 Jul 2018 12:20:01 +0000 (12:20 +0000)]
[NFC][InstCombine] Tests for x & (-1 >> y) u>= x to x u<= (-1 >> y)
https://bugs.llvm.org/show_bug.cgi?id=38123
https://rise4fun.com/Alive/azI
This pattern is not commutative. But InstSimplify will
already have taken care of the 'commutative' variant.
llvm-svn: 337095
Roman Lebedev [Sat, 14 Jul 2018 12:19:56 +0000 (12:19 +0000)]
[NFC][InstCombine] Add forgotten variable tests for foldICmpWithLowBitMaskedVal()
llvm-svn: 337094
Nico Weber [Sat, 14 Jul 2018 11:47:23 +0000 (11:47 +0000)]
attempt to get test/COFF/driver.test passing on sanitizer-x86_64-linux-fast; cf r337092
llvm-svn: 337093
Nico Weber [Sat, 14 Jul 2018 11:33:33 +0000 (11:33 +0000)]
Attempt to get test/tools/llvm-lib/help.test passing on sanitizer-x86_64-linux-fast
The bot has a /b directory, so /? matches against that and gets expanded to it.
(Thanks to Hans's r187366, which solved the same problem for clang-cl a while
ago and which saved me much head scratching.)
llvm-svn: 337092
Benjamin Kramer [Sat, 14 Jul 2018 10:48:06 +0000 (10:48 +0000)]
[clang-tidy] Force exceptions to be enabled in test
For targets that have them off by default.
llvm-svn: 337091
Francis Visoiu Mistrih [Sat, 14 Jul 2018 09:40:01 +0000 (09:40 +0000)]
[MachineOutliner] Check the last instruction from the sequence when updating liveness
The MachineOutliner was doing an std::for_each from the call (inserted
before the outlined sequence) to the iterator at the end of the
sequence.
std::for_each needs the iterator past the end, so the last instruction
was not taken into account when propagating the liveness information.
This fixes the machine verifier issue in machine-outliner-disubprogram.ll.
Differential Revision: https://reviews.llvm.org/D49295
llvm-svn: 337090
Chandler Carruth [Sat, 14 Jul 2018 09:32:37 +0000 (09:32 +0000)]
[x86/SLH] Fix an issue where we wouldn't harden any loads if we found
no conditions.
This is only valid to do if we're hardening calls and rets with LFENCE
which results in an LFENCE guarding the entire entry block for us.
llvm-svn: 337089
Craig Topper [Sat, 14 Jul 2018 06:30:30 +0000 (06:30 +0000)]
[X86] Fix a subtle bug in the custom execution domain fixing for blends.
The code tried to find the immediate by using getNumOperands() on the MachineInstr, but there might be implicit-defs after the immediate that get counted.
Instead use getNumOperands() from the instruction description which will only count the operands that are defined in the td file.
llvm-svn: 337088
Marshall Clow [Sat, 14 Jul 2018 04:15:19 +0000 (04:15 +0000)]
Mark __equal_to 's operations as constexpr.
llvm-svn: 337087
Nico Weber [Sat, 14 Jul 2018 04:07:51 +0000 (04:07 +0000)]
lld-link: Add /lib to Options.td so that it appears in lld-link's help output.
https://reviews.llvm.org/D49319
llvm-svn: 337086
Marshall Clow [Sat, 14 Jul 2018 03:06:11 +0000 (03:06 +0000)]
Mark one more __wrap_iter operation as constexpr.
llvm-svn: 337085
Nico Weber [Sat, 14 Jul 2018 02:29:44 +0000 (02:29 +0000)]
Give llvm-lib rudimentary help output.
https://reviews.llvm.org/D49318
llvm-svn: 337084
Craig Topper [Sat, 14 Jul 2018 02:05:08 +0000 (02:05 +0000)]
[X86] Prefer blendi over movss/sd when avx512 is enabled unless optimizing for size.
AVX512 doesn't have an immediate controlled blend instruction. But blend throughput is still better than movss/sd on SKX.
This commit changes AVX512 to use the AVX blend instructions instead of MOVSS/MOVSD. This constrains the register allocation since it won't be able to use XMM16-31, but hopefully the increased throughput and reduced port 5 pressure makes up for that.
llvm-svn: 337083
Teresa Johnson [Sat, 14 Jul 2018 01:50:14 +0000 (01:50 +0000)]
Revert "[ThinLTO] Ensure we always select the same function copy to import"
This reverts commit r337051.
llvm-svn: 337082
Teresa Johnson [Sat, 14 Jul 2018 01:45:49 +0000 (01:45 +0000)]
Revert "[ThinLTO] Ensure we always select the same function copy to import"
This reverts commits r337050 and r337059. Caused failure in
reverse-iteration bot that needs more investigation.
llvm-svn: 337081
Teresa Johnson [Sat, 14 Jul 2018 01:34:06 +0000 (01:34 +0000)]
Revert "[ThinLTO] Add debug output to test"
This reverts commit r337076. Not needed any more.
llvm-svn: 337080
Evgeniy Stepanov [Sat, 14 Jul 2018 01:20:53 +0000 (01:20 +0000)]
Revert "AMDGPU: Fix handling of alignment padding in DAG argument lowering"
This reverts commit r337021.
WARNING: MemorySanitizer: use-of-uninitialized-value
#0 0x1415cd65 in void write_signed<long>(llvm::raw_ostream&, long, unsigned long, llvm::IntegerStyle) /code/llvm-project/llvm/lib/Support/NativeFormatting.cpp:95:7
#1 0x1415c900 in llvm::write_integer(llvm::raw_ostream&, long, unsigned long, llvm::IntegerStyle) /code/llvm-project/llvm/lib/Support/NativeFormatting.cpp:121:3
#2 0x1472357f in llvm::raw_ostream::operator<<(long) /code/llvm-project/llvm/lib/Support/raw_ostream.cpp:117:3
#3 0x13bb9d4 in llvm::raw_ostream::operator<<(int) /code/llvm-project/llvm/include/llvm/Support/raw_ostream.h:210:18
#4 0x3c2bc18 in void printField<unsigned int, &(amd_kernel_code_s::amd_kernel_code_version_major)>(llvm::StringRef, amd_kernel_code_s const&, llvm::raw_ostream&) /code/llvm-project/llvm/lib/Target/AMDGPU/Utils/AMDKernelCodeTUtils.cpp:78:23
#5 0x3c250ba in llvm::printAmdKernelCodeField(amd_kernel_code_s const&, int, llvm::raw_ostream&) /code/llvm-project/llvm/lib/Target/AMDGPU/Utils/AMDKernelCodeTUtils.cpp:104:5
#6 0x3c27ca3 in llvm::dumpAmdKernelCode(amd_kernel_code_s const*, llvm::raw_ostream&, char const*) /code/llvm-project/llvm/lib/Target/AMDGPU/Utils/AMDKernelCodeTUtils.cpp:113:5
#7 0x3a46e6c in llvm::AMDGPUTargetAsmStreamer::EmitAMDKernelCodeT(amd_kernel_code_s const&) /code/llvm-project/llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUTargetStreamer.cpp:161:3
#8 0xd371e4 in llvm::AMDGPUAsmPrinter::EmitFunctionBodyStart() /code/llvm-project/llvm/lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp:204:26
[...]
Uninitialized value was created by an allocation of 'KernelCode' in the stack frame of function '_ZN4llvm16AMDGPUAsmPrinter21EmitFunctionBodyStartEv'
#0 0xd36650 in llvm::AMDGPUAsmPrinter::EmitFunctionBodyStart() /code/llvm-project/llvm/lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp:192
llvm-svn: 337079
Chandler Carruth [Sat, 14 Jul 2018 00:52:09 +0000 (00:52 +0000)]
[x86/SLH] Add an assert to catch if we ever end up trying to harden
post-load a register that isn't valid for use with OR or SHRX.
llvm-svn: 337078
Matt Davis [Sat, 14 Jul 2018 00:10:42 +0000 (00:10 +0000)]
[llvm-mca] Remove unused InstRef formal from pre and post execute callbacks. NFC.
llvm-svn: 337077
Teresa Johnson [Sat, 14 Jul 2018 00:08:48 +0000 (00:08 +0000)]
[ThinLTO] Add debug output to test
Add -debug-only=function-import to get more information for debugging
reverse-iteration bot failure from r337050.
llvm-svn: 337076
Tim Shen [Fri, 13 Jul 2018 23:58:46 +0000 (23:58 +0000)]
Re-apply "[SCEV] Strengthen StrengthenNoWrapFlags (reapply r334428)."
llvm-svn: 337075
Tim Shen [Fri, 13 Jul 2018 23:48:59 +0000 (23:48 +0000)]
Add a CHECK line for r337072.
llvm-svn: 337074
Krzysztof Parzyszek [Fri, 13 Jul 2018 23:42:29 +0000 (23:42 +0000)]
[Hexagon] Avoid introducing calls into coalesced range of HVX vector pairs
If an HVX vector register is to be coalesced into a vector pair, make
sure that the vector pair will not have a function call in its live range,
unless it already had one. All HVX vector registers are volatile, so
any vector register live across a function call will have to be spilled.
If a vector needs to be spilled, and it's coalesced into a vector pair
then the whole pair will need to be spilled (even if only a part of it is
live), taking extra stack space.
llvm-svn: 337073
Tim Shen [Fri, 13 Jul 2018 23:40:00 +0000 (23:40 +0000)]
[LSR] If no Use is interesting, early return.
Summary:
By looking at the callers of getUse(), we can see that even though
IVUsers may offer uses, but they may not be interesting to
LSR. It's possible that none of them is interesting.
Reviewers: sanjoy
Subscribers: jlebar, hiraditya, bixia, llvm-commits
Differential Revision: https://reviews.llvm.org/D49049
llvm-svn: 337072
Sterling Augustine [Fri, 13 Jul 2018 23:03:15 +0000 (23:03 +0000)]
Rollback r337070.
Someone simultaneously fixed the breakage it was designed to fix.
llvm-svn: 337071
Sterling Augustine [Fri, 13 Jul 2018 22:54:41 +0000 (22:54 +0000)]
Update ClangASTContext for the new DependentVector type.
https://reviews.llvm.org/D49326
llvm-svn: 337070
Eugene Zelenko [Fri, 13 Jul 2018 22:53:05 +0000 (22:53 +0000)]
[Documentation] Add missing description for bugprone-exception-escape in Release Notes.
llvm-svn: 337069
Max Moroz [Fri, 13 Jul 2018 22:49:06 +0000 (22:49 +0000)]
[UBSan] Followup for silence_unsigned_overflow flag to handle negate overflows.
Summary:
That flag has been introduced in https://reviews.llvm.org/D48660 for
suppressing UIO error messages in an efficient way. The main motivation is to
be able to use UIO checks in builds used for fuzzing as it might provide an
interesting signal to a fuzzing engine such as libFuzzer.
See https://github.com/google/oss-fuzz/issues/910 for more information.
Reviewers: morehouse, kcc
Reviewed By: morehouse
Subscribers: kubamracek, delcypher, #sanitizers, llvm-commits
Differential Revision: https://reviews.llvm.org/D49324
llvm-svn: 337068
Craig Topper [Fri, 13 Jul 2018 22:41:52 +0000 (22:41 +0000)]
[X86][SLH] Remove PDEP and PEXT from isDataInvariantLoad
Ryzen has something like an 18 cycle latency on these based on Agner's data. AMD's own xls is blank. So it seems like there might be something tricky here.
Agner's data for Intel CPUs indicates these are a single uop there.
Probably safest to remove them. We never generate them without an intrinsic so this should be ok.
Differential Revision: https://reviews.llvm.org/D49315
llvm-svn: 337067
Craig Topper [Fri, 13 Jul 2018 22:41:50 +0000 (22:41 +0000)]
[X86][SLH] Add VEX and EVEX conversion instructions to isDataInvariantLoad
-Drop the intrinsic versions of conversion instructions. These should be handled when we do vectors. They shouldn't show up in scalar code.
-Add the float<->double conversions which were missing.
-Add the AVX512 and AVX version of the conversion instructions including the unsigned integer conversions unique to AVX512
Differential Revision: https://reviews.llvm.org/D49313
llvm-svn: 337066
Craig Topper [Fri, 13 Jul 2018 22:41:46 +0000 (22:41 +0000)]
[X86][SLH] Regroup the instructions in isDataInvariantLoad a little. NFC
-Move BSF/BSR to the same group as TZCNT/LZCNT/POPCNT.
-Split some of the bit manipulation instructions away from TZCNT/LZCNT/POPCNT. These are things like 'x & (x - 1)' which are composed of a few simple arithmetic operations. These aren't nearly as complicated/surprising as counting bits.
-Move BEXTR/BZHI into their own group. They aren't like a simple arithmethic op or the bit manipulation instructions. They're more like a shift+and.
Differential Revision: https://reviews.llvm.org/D49312
llvm-svn: 337065
Alexander Polyakov [Fri, 13 Jul 2018 22:41:16 +0000 (22:41 +0000)]
[lldb-mi] Make symbol-list-lines.test XFAIL on Windows
It's a temporary decision until we reach out what causes
a failure.
llvm-svn: 337064
Fangrui Song [Fri, 13 Jul 2018 22:40:40 +0000 (22:40 +0000)]
Fix -Wswitch after introduction of clang;:Type::DependentVector in r337036
llvm-svn: 337063
Vedant Kumar [Fri, 13 Jul 2018 22:39:31 +0000 (22:39 +0000)]
[docs] Update usage directive for llvm-cov report -show-functions
llvm-svn: 337062
Vedant Kumar [Fri, 13 Jul 2018 22:39:31 +0000 (22:39 +0000)]
Fix comments which mixed up 'before' and 'after', NFC
llvm-svn: 337061
Vedant Kumar [Fri, 13 Jul 2018 22:39:29 +0000 (22:39 +0000)]
Clarify wording of a doxygen comment, NFC
llvm-svn: 337060
Teresa Johnson [Fri, 13 Jul 2018 22:36:22 +0000 (22:36 +0000)]
[ThinLTO] Require x86 target for new test
Should fix non-x86 bot failures for new test from r337050.
llvm-svn: 337059
Jim Ingham [Fri, 13 Jul 2018 22:31:59 +0000 (22:31 +0000)]
Make these tests c++ tests so they can be skipped on systems that don't support those tests.
llvm-svn: 337058
Craig Topper [Fri, 13 Jul 2018 22:27:53 +0000 (22:27 +0000)]
[X86] Use the correct types in some recently added isel patterns.
These were supposed to be integer types since we are selecting integer instructions.
Found while preparing to remove these patterns for another patch.
llvm-svn: 337057
Tom Stellard [Fri, 13 Jul 2018 22:16:03 +0000 (22:16 +0000)]
AMDGPU/GlobalISel: Implement select() for 32-bit @llvm.minnun and @llvm.maxnum
Reviewers: arsenm, nhaehnle
Subscribers: kzhuravl, wdng, yaxunl, rovka, kristof.beyls, dstuttard, tpr, llvm-commits, t-tye
Differential Revision: https://reviews.llvm.org/D46172
llvm-svn: 337056
Craig Topper [Fri, 13 Jul 2018 22:09:30 +0000 (22:09 +0000)]
[X86][FastISel] Support uitofp with avx512.
llvm-svn: 337055
Philip Pfaffe [Fri, 13 Jul 2018 22:05:01 +0000 (22:05 +0000)]
[Polly][isl] Add neutrally-named accessors to isl list elements and sizes
Summary: This could simplify the isl iterator implementation a lot.
Reviewers: grosser, Meinersbur, bollu
Reviewed By: grosser
Subscribers: pollydev, llvm-commits
Differential Revision: https://reviews.llvm.org/D49019
llvm-svn: 337054
Eli Friedman [Fri, 13 Jul 2018 21:58:55 +0000 (21:58 +0000)]
[LTO] Fix linking with an alias defined using another alias.
When we're linking an alias which will be defined later, we neeed to
build a GlobalAlias, or else we'll crash later in
IRLinker::linkGlobalValueBody.
clang sometimes constructs aliases like this for C++ destructors.
Differential Revision: https://reviews.llvm.org/D49316
llvm-svn: 337053
Fangrui Song [Fri, 13 Jul 2018 21:40:08 +0000 (21:40 +0000)]
[X86] Correct comment of TEST elimination in BSF/TZCNT
llvm-svn: 337052
Teresa Johnson [Fri, 13 Jul 2018 21:35:58 +0000 (21:35 +0000)]
[ThinLTO] Ensure we always select the same function copy to import
Clang change to reflect the FunctionsToImportTy type change
in the llvm changes for D48670.
llvm-svn: 337051
Teresa Johnson [Fri, 13 Jul 2018 21:35:51 +0000 (21:35 +0000)]
[ThinLTO] Ensure we always select the same function copy to import
In order to always import the same copy of a linkonce function,
even when encountering it with different thresholds (a higher one then a
lower one), keep track of the summary we decided to import.
This ensures that the backend only gets a single definition to import
for each GUID, so that it doesn't need to choose one.
Move the largest threshold the GUID was considered for import into the
current module out of the ImportMap (which is part of a larger map
maintained across the whole index), and into a new map just maintained
for the current module we are computing imports for. This saves some
memory since we no longer have the thresholds maintained across the
whole index (and throughout the in-process backends when doing a normal
non-distributed ThinLTO build), at the cost of some additional
information being maintained for each invocation of ComputeImportForModule
(the selected summary pointer for each import).
There is an additional map lookup for each callee being considered for
importing, however, this was able to subsume a map lookup in the
Worklist iteration that invokes computeImportForFunction. We also are
able to avoid calling selectCallee if we already failed to import at the
same or higher threshold.
I compared the run time and peak memory for the SPEC2006 471.omnetpp
benchmark (running in-process ThinLTO backends), as well as for a large
internal benchmark with a distributed ThinLTO build (so just looking at
the thin link time/memory). Across a number of runs with and without
this change there was no significant change in the time and memory.
(I tried a few other variations of the change but they also didn't
improve time or peak memory).
Reviewers: davidxl
Subscribers: mehdi_amini, inglorion, llvm-commits
Differential Revision: https://reviews.llvm.org/D48670
llvm-svn: 337050
Krzysztof Parzyszek [Fri, 13 Jul 2018 21:32:33 +0000 (21:32 +0000)]
[Hexagon] Fix hvx-length feature name in testcases
llvm-svn: 337049
Richard Smith [Fri, 13 Jul 2018 21:29:31 +0000 (21:29 +0000)]
Make BuiltinType constructor private, and befriend ASTContext.
This reflects the fact that only ASTContext should ever create an
instance of BuiltinType, and matches what we do for all the other Type
subclasses.
llvm-svn: 337048
Richard Smith [Fri, 13 Jul 2018 21:07:42 +0000 (21:07 +0000)]
Use external layout information to layout bit-fields for MS ABI.
Patch by Aleksandr Urakov!
Differential Revision: https://reviews.llvm.org/D49227
llvm-svn: 337047
Tom Stellard [Fri, 13 Jul 2018 21:05:14 +0000 (21:05 +0000)]
AMDGPU/GlobalISel: Implement select() for @llvm.amdgcn.exp
Reviewers: arsenm, nhaehnle
Subscribers: kzhuravl, wdng, yaxunl, rovka, kristof.beyls, dstuttard, tpr, t-tye, llvm-commits
Differential Revision: https://reviews.llvm.org/D45882
llvm-svn: 337046
Craig Topper [Fri, 13 Jul 2018 21:03:43 +0000 (21:03 +0000)]
[X86][FastISel] Add EVEX support to sitofp handling.
llvm-svn: 337045
Vlad Tsyrklevich [Fri, 13 Jul 2018 20:56:48 +0000 (20:56 +0000)]
Fix for Darwin buildbot failure due to r337037
Duplicate __get_unsafe_stack_bottom instead of using an alias for
platforms that don't suppport it like Darwin.
llvm-svn: 337044
Fangrui Song [Fri, 13 Jul 2018 20:54:24 +0000 (20:54 +0000)]
[X86] Try fixing r336768
llvm-svn: 337043
Roman Lebedev [Fri, 13 Jul 2018 20:33:34 +0000 (20:33 +0000)]
[NFC][InstCombine] Tests for 'check for [no] signed truncation' pattern
[[ https://bugs.llvm.org/show_bug.cgi?id=38149 | PR38149 ]]
As discussed in https://reviews.llvm.org/D49179#1158957 and later,
the IR for 'check for [no] signed truncation' pattern can be improved:
https://rise4fun.com/Alive/gBf
^ that pattern will be produced by Implicit Integer Truncation sanitizer,
https://reviews.llvm.org/D48958 https://bugs.llvm.org/show_bug.cgi?id=21530
in signed case, therefore it is probably a good idea to improve it.
The DAGCombine will reverse this transform, see
https://reviews.llvm.org/D49266
llvm-svn: 337042
JF Bastien [Fri, 13 Jul 2018 20:33:23 +0000 (20:33 +0000)]
CodeGen: specify alignment + inbounds for automatic variable initialization
Summary: Automatic variable initialization was generating default-aligned stores (which are deprecated) instead of using the known alignment from the alloca. Further, they didn't specify inbounds.
Subscribers: dexonsmith, cfe-commits
Differential Revision: https://reviews.llvm.org/D49209
llvm-svn: 337041
Craig Topper [Fri, 13 Jul 2018 20:16:38 +0000 (20:16 +0000)]
[X86] Change the rounding mode used when testing the sqrt_round intrinsics.
Using CUR_DIRECTION is not a realistic scenario. That is equivalent to the intrinsic without rounding.
llvm-svn: 337040
Petr Hosek [Fri, 13 Jul 2018 20:01:55 +0000 (20:01 +0000)]
Revert "[CMake] Pass Clang defaults to runtimes builds"
This reverts commit r332923 which is no longer needed since its
use has been reverted in r337033.
llvm-svn: 337039
Vlad Tsyrklevich [Fri, 13 Jul 2018 19:57:39 +0000 (19:57 +0000)]
[LowerTypeTests] Limit when icall jumptable entries are emitted
Summary:
Currently LowerTypeTests emits jumptable entries for all live external
and address-taken functions; however, we could limit the number of
functions that we emit entries for significantly.
For Cross-DSO CFI, we continue to emit jumptable entries for all
exported definitions. In the non-Cross-DSO CFI case, we only need to
emit jumptable entries for live functions that are address-taken in live
functions. This ignores exported functions and functions that are only
address taken in dead functions. This change uses ThinLTO summary data
(now emitted for all modules during ThinLTO builds) to determine
address-taken and liveness info.
The logic for emitting jumptable entries is more conservative in the
regular LTO case because we don't have summary data in the case of
monolithic LTO builds; however, once summaries are emitted for all LTO
builds we can unify the Thin/monolithic LTO logic to only use summaries
to determine the liveness of address taking functions.
This change is a partial fix for PR37474. It reduces the build size for
nacl_helper by ~2-3%, the reduction is due to nacl_helper compiling in
lots of unused code and unused functions that are address taken in dead
functions no longer being being considered live due to emitted jumptable
references. The reduction for chromium is ~0.1-0.2%.
Reviewers: pcc, eugenis, javed.absar
Reviewed By: pcc
Subscribers: aheejin, dexonsmith, dschuff, mehdi_amini, eraman, steven_wu, llvm-commits, kcc
Differential Revision: https://reviews.llvm.org/D47652
llvm-svn: 337038
Vlad Tsyrklevich [Fri, 13 Jul 2018 19:48:35 +0000 (19:48 +0000)]
SafeStack: Add builtins to read unsafe stack top/bottom
Summary:
Introduce built-ins to read the unsafe stack top and bottom. The unsafe
stack top is required to implement garbage collection scanning for
Oilpan. Currently there is already a built-in 'get_unsafe_stack_start'
to read the bottom of the unsafe stack, but I chose to duplicate this
API because 'start' is ambiguous (e.g. Oilpan uses WTF::GetStackStart to
read the safe stack top.)
Reviewers: pcc
Reviewed By: pcc
Subscribers: llvm-commits, kcc
Differential Revision: https://reviews.llvm.org/D49152
llvm-svn: 337037
Erich Keane [Fri, 13 Jul 2018 19:46:04 +0000 (19:46 +0000)]
PR15730/PR16986 Allow dependently typed vector_size types.
As listed in the above PRs, vector_size doesn't allow
dependent types/values. This patch introduces a new
DependentVectorType to handle a VectorType that has a dependent
size or type.
In the future, ALL the vector-types should be able to create one
of these to handle dependent types/sizes as well. For example,
DependentSizedExtVectorType could likely be switched to just use
this instead, though that is left as an exercise for the future.
Differential Revision: https://reviews.llvm.org/D49045
llvm-svn: 337036
Jim Ingham [Fri, 13 Jul 2018 19:28:32 +0000 (19:28 +0000)]
Fix the libcxx set, multiset, vector and bitset formatters to work on references.
The synthetic child providers for these classes had a type expression that matched
pointers & references to the type, but the Front End only worked on the actual object.
I fixed this by adding a way for the Synthetic Child FrontEnd provider to request dereference,
and then had these formatters use that mode.
<rdar://problem/
40849836>
Differential Revision: https://reviews.llvm.org/D49279
llvm-svn: 337035
Jim Ingham [Fri, 13 Jul 2018 19:24:26 +0000 (19:24 +0000)]
Add the new PDBLocationToDWARFExpression.{cpp,h} to the Xcode project.
llvm-svn: 337034
Petr Hosek [Fri, 13 Jul 2018 19:16:30 +0000 (19:16 +0000)]
[CMake] Don't use CLANG_DEFAULT_* values
These are not necessarily correct, just because Clang is configured
to use libc++ or compiler-rt as defaults doesn't mean that the host
compiler uses these as defaults as well. A more correct solution
would be to test the host compiler to check what the default actually
is as attempted in D46857.
Part of PR-38025.
Differential Revision: https://reviews.llvm.org/D49272
llvm-svn: 337033
Raphael Isemann [Fri, 13 Jul 2018 18:54:55 +0000 (18:54 +0000)]
Add includes for CompletionRequest to every file that uses it
Summary: Should fix the builds (and prevent future builds from failing when people try to reduce includes).
Reviewers: jingham
Reviewed By: jingham
Subscribers: jingham, lldb-commits
Differential Revision: https://reviews.llvm.org/D49311
llvm-svn: 337032
Raphael Isemann [Fri, 13 Jul 2018 18:28:14 +0000 (18:28 +0000)]
Replaced more boilerplate code with CompletionRequest (NFC)
Summary:
As suggested in D48796, this patch replaces even more internal calls that were using the old
completion API style with a single CompletionRequest. In some cases we also pass an option
vector/index, but as we don't always have this information, it currently is not part of the
CompletionRequest class.
The constructor of the CompletionRequest is now also more sensible. You only pass the
user input, cursor position and your list of matches to the request and the rest will be
inferred (using the same code we used before to calculate this). You also have to pass these
match window parameters to it, even though they are unused right now.
The patch shouldn't change any behavior.
Reviewers: jingham
Reviewed By: jingham
Subscribers: lldb-commits
Differential Revision: https://reviews.llvm.org/D48976
llvm-svn: 337031
Raphael Isemann [Fri, 13 Jul 2018 18:13:46 +0000 (18:13 +0000)]
No longer pass a StringRef to the Python API
Summary:
The refactoring patch for DoExecute missed this case of a variadic function that just silently
accepts a StringRef which it then tries to reinterpret as a C-string.
This should fix the Windows builds.
Reviewers: stella.stamenova
Reviewed By: stella.stamenova
Subscribers: lldb-commits
Differential Revision: https://reviews.llvm.org/D49309
llvm-svn: 337030
Frederic Riss [Fri, 13 Jul 2018 17:45:43 +0000 (17:45 +0000)]
Fix TestAttachDenied on macOS Mojave
TestAttachDenied tries to attach to a process that is ptracing itself and
verifies that we error out. Starting with macOS Mojave, processes need
an entitlement to be able to ptrace. This commit adds the entitlement for
the test binary when building on Darwin.
llvm-svn: 337029
Marshall Clow [Fri, 13 Jul 2018 17:31:36 +0000 (17:31 +0000)]
wrap _LIBCPP_HAS_NO_CXX14_CONSTEXPR in defined(...)
llvm-svn: 337028
Marshall Clow [Fri, 13 Jul 2018 17:24:59 +0000 (17:24 +0000)]
Shot in the dark to fix gcc 4.9 / c++11 build
llvm-svn: 337027
Jonas Devlieghere [Fri, 13 Jul 2018 17:21:51 +0000 (17:21 +0000)]
[dwarfdump] Add pretty printer for accelerator table based on Atom.
For instance, When dumping .apple_types, the second atom represents the
DW_TAG. In addition to printing the raw value, we now also pretty print
the value if the ATOM tells us how.
llvm-svn: 337026
Andrea Di Biagio [Fri, 13 Jul 2018 16:46:51 +0000 (16:46 +0000)]
[llvm-mca][BtVer2] Add tests for dependency breaking instructions.
llvm-svn: 337024
Ulrich Weigand [Fri, 13 Jul 2018 16:42:15 +0000 (16:42 +0000)]
[TableGen] Suppress type validation when parsing pattern fragments
Currently, any attempt to define a PatFrag involving any floating-point
only (or vector only) node causes a hard assertion failure in TableGen
if the current target does not have any floating-point (or vector)
types.
This is annoying if you want to provide convenience fragments in common
code (e.g. include/llvm/Target/TargetSelectionDAG.td) that is parsed on
all platforms, including those that miss such types.
But really, there's no reason not accept this when parsing the fragment
-- of course it would be an error for such a target to actually *use*
such a fragment anywhere, but as long as it doesn't, I think TableGen
shouldn't error out.
The immediate cause of the assertion failure is the test inside the
ValidateOnExit destructor. This patch simply disables that check while
infering types during parsing of pattern fragments (only).
Reviewed By: hfinkel, kparzysz
Differential Revision: https://reviews.llvm.org/D48887
llvm-svn: 337023
Matt Arsenault [Fri, 13 Jul 2018 16:40:37 +0000 (16:40 +0000)]
AMDGPU: Properly handle shader inputs with split arguments
This needs to refer to arguments by their original argument
index, not the argument split index which depends on what
the type splitting decides to do.
Also avoid increment PSInputNum for each split piece.
llvm-svn: 337022
Matt Arsenault [Fri, 13 Jul 2018 16:40:25 +0000 (16:40 +0000)]
AMDGPU: Fix handling of alignment padding in DAG argument lowering
This was completely broken if there was ever a struct argument, as
this information is thrown away during the argument analysis.
The offsets as passed in to LowerFormalArguments are not useful,
as they partially depend on the legalized result register type,
and they don't consider the alignment in the first place.
Ignore the Ins array, and instead figure out from the raw IR type
what we need to do. This seems to fix the padding computation
if the DAG lowering is forced (and stops breaking arguments
following padded arguments if the arguments were only partially
lowered in the IR)
llvm-svn: 337021
Marcello Maggioni [Fri, 13 Jul 2018 16:36:14 +0000 (16:36 +0000)]
[Tablegen] Optimize isSubsetOf() in AsmMatcherEmitter.cpp. NFC
isSubsetOf() could be very slow if the hierarchy of the RegisterClasses
of the target is very complicated.
This is mainly caused by the fact that isSubset() is called
multiple times over the same SuperClass of a register class
if this ends up being the super class of a register class
from multiple paths.
Differential Revision: https://reviews.llvm.org/D49124
llvm-svn: 337020
Marshall Clow [Fri, 13 Jul 2018 16:35:26 +0000 (16:35 +0000)]
Make internal class __wrap_iter constexpr when not using libc++'s debugging mode. Introduce a new macro _LIBCPP_CONSTEXPR_IF_NODEBUG to mark this.
llvm-svn: 337019
Evgeniy Stepanov [Fri, 13 Jul 2018 16:32:31 +0000 (16:32 +0000)]
Revert "CallGraphSCCPass: iterate over all functions."
This reverts commit r336419: use-after-free on CallGraph::FunctionMap elements
due to the use of a stale iterator in CGPassManager::runOnModule.
The iterator may be invalidated if a pass removes a function, ex.:
llvm::LegacyInlinerBase::inlineCalls
inlineCallsImpl
llvm::CallGraph::removeFunctionFromModule
llvm-svn: 337018
Nicolas Lesser [Fri, 13 Jul 2018 16:27:45 +0000 (16:27 +0000)]
Fix PR34668 - P0704R1 implementation is too permissive
Summary:
https://bugs.llvm.org/show_bug.cgi?id=34668
Pretty straightforward.
Reviewers: rsmith, Rakete1111
Reviewed By: Rakete1111
Subscribers: Rakete1111, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D38075
llvm-svn: 337017
Marshall Clow [Fri, 13 Jul 2018 16:26:16 +0000 (16:26 +0000)]
Fix a couple of 'unused variable' warnings in a vector test. NFC.
llvm-svn: 337016
Gheorghe-Teodor Bercea [Fri, 13 Jul 2018 16:18:24 +0000 (16:18 +0000)]
[OpenMP] Initialize data sharing stack for SPMD case
Summary: In the SPMD case, we need to initialize the data sharing and globalization infrastructure. This covers the case when an SPMD region calls a function in a different compilation unit.
Reviewers: ABataev, carlo.bertolli, caomhin
Reviewed By: ABataev
Subscribers: Hahnfeld, jholewinski, guansong, cfe-commits
Differential Revision: https://reviews.llvm.org/D49188
llvm-svn: 337015
Roman Lebedev [Fri, 13 Jul 2018 16:14:37 +0000 (16:14 +0000)]
[NFC][X86][AArch64] Negative tests for 'check for [no] signed truncation' pattern
See D49247, D49266
I'm only adding the sane negative tests, and not
adding the one-use tests yet. Also, not adding
negative tests for the second pattern with inverted operands yet,
since it's handling will be added in later differential.
llvm-svn: 337014
Gheorghe-Teodor Bercea [Fri, 13 Jul 2018 16:14:22 +0000 (16:14 +0000)]
[OpenMP][libomptarget] Fix data sharing and globalization infrastructure to work in SPMD mode
Summary: This patch fixes the data sharing infrastructure to work for the SPMD and non-SPMD cases.
Reviewers: ABataev, grokos, carlo.bertolli, caomhin
Reviewed By: ABataev, grokos
Subscribers: guansong, openmp-commits
Differential Revision: https://reviews.llvm.org/D49204
llvm-svn: 337013
Joel Galenson [Fri, 13 Jul 2018 16:09:19 +0000 (16:09 +0000)]
[cfi-verify] Only run AArch64 tests when it is a supported target
This stops the tests I added in r337007 from running when AArch64 is not a supported target.
llvm-svn: 337012
Jonas Devlieghere [Fri, 13 Jul 2018 16:06:17 +0000 (16:06 +0000)]
[dwarfdump] Pretty print DW_AT_APPLE_runtime_class
Instead of printing
DW_AT_APPLE_runtime_class (0x10)
we now print
DW_AT_APPLE_runtime_class (DW_LANG_ObjC)
llvm-svn: 337011
Kostya Kortchinsky [Fri, 13 Jul 2018 15:31:05 +0000 (15:31 +0000)]
[sanitizer] Use -Wl,-z,global on Android
Summary:
Use `-Wl,-z,global` for all Sanitizer shared libraries on
Android. We want them to be in the global group
(https://android.googlesource.com/platform/bionic/+/master/android-changes-for-ndk-developers.md#changes-to-library-search-order)
to avoid any alloc/dealloc mismatch between the libc allocator & said library.
`audioserver` was one of the binary that exhibited the problem with Scudo,
this seems to fix it.
[edited for accuracy]
Reviewers: eugenis, alekseyshl
Reviewed By: eugenis
Subscribers: kubamracek, srhines, mgorny, delcypher, #sanitizers, llvm-commits
Differential Revision: https://reviews.llvm.org/D49198
llvm-svn: 337010
Sjoerd Meijer [Fri, 13 Jul 2018 15:25:42 +0000 (15:25 +0000)]
[AArch64] Armv8.4-A: LDAPR & STLR with immediate offset instructions (cont'd)
Follow up of rL336913: fix base class description. Thanks to Ahmed Bougacha
for pointing this out.
Differential Revision: https://reviews.llvm.org/D49284
llvm-svn: 337009
Nemanja Ivanovic [Fri, 13 Jul 2018 15:21:03 +0000 (15:21 +0000)]
[PowerPC] Materialize more constants with CR-field set in late peephole
Revision r322373 fixed a bug in how we materialize constants when the CR-field
needs to be set.
However the fix is overly conservative. It will only do the transform if
AND-ing the input with the new constant produces the same new constant.
This is of course correct, but not necessarily required.
If there are no futher uses of the constant, the constant can be changed.
If there are no uses of the GPR result, the final result of the materialization
isn't important other than it needs to compare to zero correctly (lt, gt, eq).
Differential revision: https://reviews.llvm.org/D42109
llvm-svn: 337008
Joel Galenson [Fri, 13 Jul 2018 15:19:33 +0000 (15:19 +0000)]
[cfi-verify] Support AArch64.
This patch adds support for AArch64 to cfi-verify.
This required three changes to cfi-verify. First, it generalizes checking if an instruction is a trap by adding a new isTrap flag to TableGen (and defining it for x86 and AArch64). Second, the code that ensures that the operand register is not clobbered between the CFI check and the indirect call needs to allow a single dereference (in x86 this happens as part of the jump instruction). Third, we needed to ensure that return instructions are not counted as indirect branches. Technically, returns are indirect branches and can be covered by CFI, but LLVM's forward-edge CFI does not protect them, and x86 does not consider them, so we keep that behavior.
In addition, we had to improve AArch64's code to evaluate the branch target of a MCInst to handle calls where the destination is not the first operand (which it often is not).
Differential Revision: https://reviews.llvm.org/D48836
llvm-svn: 337007
Stella Stamenova [Fri, 13 Jul 2018 15:10:53 +0000 (15:10 +0000)]
[json, test] Fix the json.td test - the path to python could contain spaces
Summary: The path to the python executable can contain spaces, so it should be specified with quotes.
Reviewers: asmith, simon_tatham
Reviewed By: simon_tatham
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D49258
llvm-svn: 337006
Erich Keane [Fri, 13 Jul 2018 15:07:47 +0000 (15:07 +0000)]
[NFC] Rename clang::AttributeList to clang::ParsedAttr
Since The type no longer contains the 'next' item anymore, it isn't a list,
so rename it to ParsedAttr to be more accurate.
llvm-svn: 337005
Simon Atanasyan [Fri, 13 Jul 2018 15:03:24 +0000 (15:03 +0000)]
[mips] Add microMIPS case to the tests and regenerate assertions using update_llc_test_checks.py. NFC
llvm-svn: 337004
Andrea Di Biagio [Fri, 13 Jul 2018 14:55:47 +0000 (14:55 +0000)]
[llvm-mca] Improve a few debug prints. NFC
llvm-svn: 337003
Erich Keane [Fri, 13 Jul 2018 14:43:20 +0000 (14:43 +0000)]
Add parens to silence Wparentheses warning, introduced by 336990
llvm-svn: 337002
Erich Keane [Fri, 13 Jul 2018 14:41:15 +0000 (14:41 +0000)]
[NFC] Silence Wparentheses warning in DomTreeUpdater, introduced by 336968
llvm-svn: 337001
Adam Balogh [Fri, 13 Jul 2018 13:44:44 +0000 (13:44 +0000)]
[Analyzer] alpha.unix.cstring.OutOfBounds checker enable/disable fix
It was not possible to disable alpha.unix.cstring.OutOfBounds checker's reports
since unix.Malloc checker always implicitly enabled the filter. Moreover if the
checker was disabled from command line (-analyzer-disable-checker ..) the out
of bounds warnings were nevertheless emitted under different checker names such
as unix.cstring.NullArg, or unix.Malloc.
This patch fixes the case sot that Malloc checker only enables implicitly the
underlying modeling of strcpy, memcpy etc. but not the warning messages that
would have been emmitted by alpha.unix.cstring.OutOfBounds
Patch by: Dániel Krupp
Differential Revision: https://reviews.llvm.org/D48831
llvm-svn: 337000
Ulrich Weigand [Fri, 13 Jul 2018 13:18:00 +0000 (13:18 +0000)]
[TableGen] Support multi-alternative pattern fragments
A TableGen instruction record usually contains a DAG pattern that will
describe the SelectionDAG operation that can be implemented by this
instruction. However, there will be cases where several different DAG
patterns can all be implemented by the same instruction. The way to
represent this today is to write additional patterns in the Pattern
(or usually Pat) class that map those extra DAG patterns to the
instruction. This usually also works fine.
However, I've noticed cases where the current setup seems to require
quite a bit of extra (and duplicated) text in the target .td files.
For example, in the SystemZ back-end, there are quite a number of
instructions that can implement an "add-with-overflow" operation.
The same instructions also need to be used to implement just plain
addition (simply ignoring the extra overflow output). The current
solution requires creating extra Pat pattern for every instruction,
duplicating the information about which particular add operands
map best to which particular instruction.
This patch enhances TableGen to support a new PatFrags class, which
can be used to encapsulate multiple alternative patterns that may
all match to the same instruction. It operates the same way as the
existing PatFrag class, except that it accepts a list of DAG patterns
to match instead of just a single one. As an example, we can now define
a PatFrags to match either an "add-with-overflow" or a regular add
operation:
def z_sadd : PatFrags<(ops node:$src1, node:$src2),
[(z_saddo node:$src1, node:$src2),
(add node:$src1, node:$src2)]>;
and then use this in the add instruction pattern:
defm AR : BinaryRRAndK<"ar", 0x1A, 0xB9F8, z_sadd, GR32, GR32>;
These SystemZ target changes are implemented here as well.
Note that PatFrag is now defined as a subclass of PatFrags, which
means that some users of internals of PatFrag need to be updated.
(E.g. instead of using PatFrag.Fragment you now need to use
!head(PatFrag.Fragments).)
The implementation is based on the following main ideas:
- InlinePatternFragments may now replace each original pattern
with several result patterns, not just one.
- parseInstructionPattern delays calling InlinePatternFragments
and InferAllTypes. Instead, it extracts a single DAG match
pattern from the main instruction pattern.
- Processing of the DAG match pattern part of the main instruction
pattern now shares most code with processing match patterns from
the Pattern class.
- Direct use of main instruction patterns in InferFromPattern and
EmitResultInstructionAsOperand is removed; everything now operates
solely on DAG match patterns.
Reviewed by: hfinkel
Differential Revision: https://reviews.llvm.org/D48545
llvm-svn: 336999