Rui Ueyama [Thu, 12 Oct 2017 19:10:41 +0000 (19:10 +0000)]
Remove Symbol::isPreemptible().
Because it was a redundant accessor to Symbol's public member.
llvm-svn: 315609
Konstantin Zhuravlyov [Thu, 12 Oct 2017 18:59:54 +0000 (18:59 +0000)]
AMDGPU/NFC: Move AMDGPU specific note types to ELF.h
Differential Revision: https://reviews.llvm.org/D38747
llvm-svn: 315608
Craig Topper [Thu, 12 Oct 2017 18:57:15 +0000 (18:57 +0000)]
[X86] Add CLWB intrinsic. clang part
Reviewers: RKSimon, zvi, igorb
Reviewed By: RKSimon
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D38781
llvm-svn: 315607
Craig Topper [Thu, 12 Oct 2017 18:55:57 +0000 (18:55 +0000)]
[X86] Add a bunch of -mcpu strings to the cpus.ll test.
We were missing most of the "core" aliases as well as skylake, cannonlake, and knights landing.
llvm-svn: 315606
Michal Gorny [Thu, 12 Oct 2017 18:51:41 +0000 (18:51 +0000)]
[cmake] [interception] Remove duplicate gtest from test COMPILE_DEPS
Fix the gtest dependency to be included in DEPS only, rather than
in COMPILE_DEPS + DEPS. The former variable is apparently used to
provide unconditional dependencies, while the latter are only used
for non-standalone builds. Since they are concatenated, specifying gtest
in both is redundant. Furthermore, including it in COMPILE_DEPS causes
build failure for standalone builds where 'gtest' target is not present.
Differential Revision: https://reviews.llvm.org/D38839
llvm-svn: 315605
Michal Gorny [Thu, 12 Oct 2017 18:51:37 +0000 (18:51 +0000)]
[cmake] Fix skipping DEPS (typo) in sanitizer_test_compile()
Fix typo in variable assignment inside sanitizer_test_compile() that
resulted in TEST_DEPS parameter not being included in the clang_compile()
call. Spotted by George Karpenkov in D38444.
Differential Revision: https://reviews.llvm.org/D38838
llvm-svn: 315604
Matt Morehouse [Thu, 12 Oct 2017 18:39:10 +0000 (18:39 +0000)]
[clang-format] Allow building fuzzer with OSS-Fuzz flags.
Reviewers: kcc, bogner
Reviewed By: kcc
Subscribers: cfe-commits, mgorny
Differential Revision: https://reviews.llvm.org/D38853
llvm-svn: 315603
Evgeniy Stepanov [Thu, 12 Oct 2017 18:34:20 +0000 (18:34 +0000)]
[asan] Disable a flaky test on android.
llvm-svn: 315602
Artem Belevich [Thu, 12 Oct 2017 18:27:55 +0000 (18:27 +0000)]
[NVPTX] Implemented wmma intrinsics and instructions.
WMMA = "Warp Level Matrix Multiply-Accumulate".
These are the new instructions introduced in PTX6.0 and available
on sm_70 GPUs.
Differential Revision: https://reviews.llvm.org/D38645
llvm-svn: 315601
Reid Kleckner [Thu, 12 Oct 2017 18:20:35 +0000 (18:20 +0000)]
[codeview] Don't emit FPO data in funclet prologues
Attempt 3 to work around bugs in FPO data with funclets.
llvm-svn: 315600
Justin Bogner [Thu, 12 Oct 2017 18:10:22 +0000 (18:10 +0000)]
llvm-isel-fuzzer: Work around BUILD_SHARED_LIBS testing issues
Building with BUILD_SHARED_LIBS makes it tricky to copy around
executables at will, since they won't be able to find the LLVM
libraries any more. This makes testing a feature that's based on the
executable name problematic, so we'll just disable these two tests in
that configuration.
We could potentially fix this by symlinking the lib directory into the
test directory, but that wouldn't work on windows, and losing testing
on windows would be far worse than losing testing on a configuration
that's barely even supported.
llvm-svn: 315599
Artem Belevich [Thu, 12 Oct 2017 17:40:00 +0000 (17:40 +0000)]
[TableGen] Allow intrinsics to have up to 8 return values.
Differential Revision: https://reviews.llvm.org/D38633
llvm-svn: 315598
Hans Wennborg [Thu, 12 Oct 2017 17:38:22 +0000 (17:38 +0000)]
Work around lack of Wine support for SetFileInformationByHandle harder
In r315079 I added a check for the ERROR_CALL_NOT_IMPLEMENTED error
code, but it turns out earlier versions of Wine just returned false
without setting any error code.
This patch handles the unset error code case.
llvm-svn: 315597
Konstantin Zhuravlyov [Thu, 12 Oct 2017 17:34:05 +0000 (17:34 +0000)]
AMDGPU: Fix warnings introduced in r315526
llvm-svn: 315596
Sanjay Patel [Thu, 12 Oct 2017 17:31:46 +0000 (17:31 +0000)]
[ValueTracking] return zero when there's conflict in known bits of a shift (PR34838)
Poison allows us to return a better result than undef.
llvm-svn: 315595
Craig Topper [Thu, 12 Oct 2017 17:21:01 +0000 (17:21 +0000)]
[X86] Use -ffreestanding instead of using the mm_malloc.h include guard hack on more of the builtin tests.
llvm-svn: 315594
Bruno Cardoso Lopes [Thu, 12 Oct 2017 16:54:11 +0000 (16:54 +0000)]
Reintroduce "[SCCP] Propagate integer range info for parameters in IPSCCP."
This is r315288 & r315294, which were reverted due to stage2 bot
failures.
Summary:
This updates the SCCP solver to use of the ValueElement lattice for
parameters, which provides integer range information. The range
information is used to remove unneeded icmp instructions.
For the following function, f() can be optimized to `ret i32 2` with
this change
source_filename = "sccp.c"
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
; Function Attrs: norecurse nounwind readnone uwtable
define i32 @main() local_unnamed_addr #0 {
entry:
%call = tail call fastcc i32 @f(i32 1)
%call1 = tail call fastcc i32 @f(i32 47)
%add3 = add nsw i32 %call, %call1
ret i32 %add3
}
; Function Attrs: noinline norecurse nounwind readnone uwtable
define internal fastcc i32 @f(i32 %x) unnamed_addr #1 {
entry:
%c1 = icmp sle i32 %x, 100
%cmp = icmp sgt i32 %x, 300
%. = select i1 %cmp, i32 1, i32 2
ret i32 %.
}
attributes #1 = { noinline }
Reviewers: davide, sanjoy, efriedma, dberlin
Reviewed By: davide, dberlin
Subscribers: mcrosier, gberry, mssimpso, dberlin, llvm-commits
Differential Revision: https://reviews.llvm.org/D36656
llvm-svn: 315593
Lei Huang [Thu, 12 Oct 2017 16:43:33 +0000 (16:43 +0000)]
[PowerPC] Add profitablilty check for conversion to mtctr loops
Add profitability checks for modifying counted loops to use the mtctr instruction.
The latency of mtctr is only justified if there are more than 4 comparisons that
will be removed as a result. Usually counted loops are formed relatively early
and before unrolling, so most low trip count loops often don't survive. However
we want to ensure that if they do, we do not mistakenly update them to mtctr loops.
Use CodeMetrics to ensure we are only doing this for small loops with small trip counts.
Differential Revision: https://reviews.llvm.org/D38212
llvm-svn: 315592
Tim Renouf [Thu, 12 Oct 2017 16:16:41 +0000 (16:16 +0000)]
[AMDGPU] For amdpal, widen interpolation mode workaround
Summary:
The interpolation mode workaround ensures that at least one
interpolation mode is enabled in PSInputAddr. It does not also check
PSInputEna on the basis that the user might enable bits in that
depending on run-time state.
However, for amdpal os type, the user does not enable some bits after
compilation based on run-time states; the register values being
generated here are the final ones set in the hardware. Therefore, apply
the workaround to PSInputAddr and PSInputEnable together. (The case
where a bit is set in PSInputAddr but not in PSInputEnable is where the
frontend set up an input arg for a particular interpolation mode, but
nothing uses that input arg. Really we should have an earlier pass that
removes such an arg.)
Reviewers: arsenm, nhaehnle, dstuttard
Subscribers: kzhuravl, wdng, yaxunl, t-tye, llvm-commits
Differential Revision: https://reviews.llvm.org/D37758
llvm-svn: 315591
Don Hinton [Thu, 12 Oct 2017 16:16:06 +0000 (16:16 +0000)]
[dump] Remove NDEBUG from test to enable dump methods [NFC]
Summary:
Add LLVM_FORCE_ENABLE_DUMP cmake option, and use it along with
LLVM_ENABLE_ASSERTIONS to set LLVM_ENABLE_DUMP.
Remove NDEBUG and only use LLVM_ENABLE_DUMP to enable dump methods.
Move definition of LLVM_ENABLE_DUMP from config.h to llvm-config.h so
it'll be picked up by public headers.
Differential Revision: https://reviews.llvm.org/D38406
llvm-svn: 315590
Sanjay Patel [Thu, 12 Oct 2017 16:15:38 +0000 (16:15 +0000)]
[x86] replace isEqualTo with == for efficiency
This is a follow-up suggested in D37534.
Patch by Yulia Koval.
llvm-svn: 315589
Rafael Espindola [Thu, 12 Oct 2017 15:54:14 +0000 (15:54 +0000)]
Update comment.
The number 131076 didn't show up anywhere in the test.
llvm-svn: 315588
Simon Pilgrim [Thu, 12 Oct 2017 15:52:01 +0000 (15:52 +0000)]
[X86][SSE] Pull out repeated INSERT_VECTOR_ELT code from LowerBUILD_VECTOR v16i8/v8i16 insertion. NFCI.
llvm-svn: 315587
Alexey Bataev [Thu, 12 Oct 2017 15:18:41 +0000 (15:18 +0000)]
[OPENMP] Fix PR34926: Fix handling of the array sections passed as
function params.
Codegen could crash if the array section base expression is the
function parameter.
llvm-svn: 315586
Rafael Espindola [Thu, 12 Oct 2017 15:12:55 +0000 (15:12 +0000)]
Relax test.
The address of the .got section is not relevant for the test.
llvm-svn: 315585
Rafael Espindola [Thu, 12 Oct 2017 15:05:04 +0000 (15:05 +0000)]
Use 0 as sh_link when we don't have a dynamic symbol table.
It doesn't make sense to link from an alloc section to a non alloc
one as we were doing.
This matches the behavior of both gold and bfd.
llvm-svn: 315584
Kostya Kortchinsky [Thu, 12 Oct 2017 15:01:09 +0000 (15:01 +0000)]
[scudo] Allow for non-Android Shared TSD platforms, part 1
Summary:
This first part just prepares the grounds for part 2 and doesn't add any new
functionality. It mostly consists of small refactors:
- move the `pthread.h` include higher as it will be used in the headers;
- use `errno.h` in `scudo_allocator.cpp` instead of the sanitizer one, update
the `errno` assignments accordingly (otherwise it creates conflicts on some
platforms due to `pthread.h` including `errno.h`);
- introduce and use `getCurrentTSD` and `setCurrentTSD` for the shared TSD
model code;
Reviewers: alekseyshl
Reviewed By: alekseyshl
Subscribers: llvm-commits, srhines
Differential Revision: https://reviews.llvm.org/D38826
llvm-svn: 315583
Marshall Clow [Thu, 12 Oct 2017 14:48:09 +0000 (14:48 +0000)]
More fuzzing infastructre - regex
llvm-svn: 315582
Vlad Tsyrklevich [Thu, 12 Oct 2017 14:42:26 +0000 (14:42 +0000)]
[cfi-verify] Fix typo, actually check X86 target
The typo in r315556 disabled the cfi-verify unit tests from building
unconditionally, have it correctly check for the X86 target.
llvm-svn: 315581
Alexander Kornienko [Thu, 12 Oct 2017 14:25:16 +0000 (14:25 +0000)]
Revert "Fix nested namespaces in google-readability-nested-namespace-comments."
This reverts r315057. The revision introduces assertion failures:
assertion failed at llvm/tools/clang/include/clang/Basic/SourceManager.h:428 in
const clang::SrcMgr::ExpansionInfo &clang::SrcMgr::SLocEntry::getExpansion()
const: isExpansion() && "Not a macro expansion SLocEntry!"
Stack trace:
__assert_fail
clang::SrcMgr::SLocEntry::getExpansion()
clang::SourceManager::getExpansionLocSlowCase()
clang::SourceManager::getExpansionLoc()
clang::Lexer::getRawToken()
clang::tidy::readability::NamespaceCommentCheck::check()
clang::ast_matchers::internal::(anonymous namespace)::MatchASTVisitor::MatchVisitor::visitMatch()
clang::ast_matchers::internal::BoundNodesTreeBuilder::visitMatches()
clang::ast_matchers::internal::(anonymous namespace)::MatchASTVisitor::matchWithFilter()
clang::ast_matchers::internal::(anonymous namespace)::MatchASTVisitor::matchDispatch()
clang::ast_matchers::internal::(anonymous namespace)::MatchASTVisitor::TraverseDecl()
clang::RecursiveASTVisitor<>::TraverseDeclContextHelper()
clang::RecursiveASTVisitor<>::TraverseDecl()
clang::RecursiveASTVisitor<>::TraverseDeclContextHelper()
clang::RecursiveASTVisitor<>::TraverseDecl()
clang::RecursiveASTVisitor<>::TraverseDeclContextHelper()
clang::RecursiveASTVisitor<>::TraverseDecl()
clang::ast_matchers::MatchFinder::matchAST()
clang::MultiplexConsumer::HandleTranslationUnit()
clang::ParseAST()
clang::FrontendAction::Execute()
clang::CompilerInstance::ExecuteAction()
clang::tooling::FrontendActionFactory::runInvocation()
clang::tooling::ToolInvocation::runInvocation()
clang::tooling::ToolInvocation::run()
Still working on an isolated test case.
llvm-svn: 315580
Diana Picus [Thu, 12 Oct 2017 13:59:51 +0000 (13:59 +0000)]
MachineInstr: Make isEqual agree with getHashValue in MachineInstrExpressionTrait
MachineInstr::isIdenticalTo has a lot of logic for dealing with register
Defs (i.e. deciding whether to take them into account or ignore them).
This logic gets things wrong in some obscure cases, for instance if an
operand is not a Def for both the current MI and the one we are
comparing to.
I'm not sure if it's possible for this to happen for regular register
operands, but it may happen in the ARM backend for special operands
which use sentinel values for the register (i.e. 0, which is neither a
physical register nor a virtual one).
This causes MachineInstrExpressionTrait::isEqual (which uses
MachineInstr::isIdenticalTo) to return true for the following
instructions, which are the same except for the fact that one sets the
flags and the other one doesn't:
%1114 = ADDrsi %1113, %216, 17, 14, _, def _
%1115 = ADDrsi %1113, %216, 17, 14, _, _
OTOH, MachineInstrExpressionTrait::getHashValue returns different values
for the 2 instructions due to the different isDef on the last operand.
In practice this means that when trying to add those instructions to a
DenseMap, they will be considered different because of their different
hash values, but when growing the map we might get an assertion while
copying from the old buckets to the new buckets because isEqual
misleadingly returns true.
This patch makes sure that isEqual and getHashValue agree, by improving
the checks in MachineInstr::isIdenticalTo when we are ignoring virtual
register definitions (which is what the Trait uses). Firstly, instead of
checking isPhysicalRegister, we use !isVirtualRegister, so that we cover
both physical registers and sentinel values. Secondly, instead of
checking MachineOperand::isReg, we use MachineOperand::isIdenticalTo,
which checks isReg, isSubReg and isDef, which are the same values that
the hash function uses to compute the hash.
Note that the function is symmetric with this change, since if the
current operand is not a Def, we check MachineOperand::isIdenticalTo,
which returns false if the operands have different isDef's.
Differential Revision: https://reviews.llvm.org/D38789
llvm-svn: 315579
Alexey Bataev [Thu, 12 Oct 2017 13:51:32 +0000 (13:51 +0000)]
[OPENMP] Fix PR34925: Fix getting thread_id lvalue for inlined regions
in C.
If we try to get the lvalue for thread_id variables in inlined regions,
we did not use the correct version of function. Fixed this bug by adding
overrided version of the function getThreadIDVariableLValue for inlined
regions.
llvm-svn: 315578
Sam McCall [Thu, 12 Oct 2017 13:29:58 +0000 (13:29 +0000)]
[clangd] less boilerplate in RPC dispatch
Summary:
Make the ProtocolHandlers glue between JSONRPCDispatcher and
ClangdLSPServer generic.
Eliminate small differences between methods, de-emphasize the unimportant
distinction between notifications and methods.
ClangdLSPServer is no longer responsible for producing a complete
JSON-RPC response, just the JSON of the result object. (In future, we
should move that JSON serialization out, too).
Handler methods now take a context object that we may hang more
functionality off in the future.
Added documentation to ProtocolHandlers.
Reviewers: ilya-biryukov, bkramer
Reviewed By: ilya-biryukov
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D38464
llvm-svn: 315577
Daniel Jasper [Thu, 12 Oct 2017 13:25:05 +0000 (13:25 +0000)]
Reinstantiate old/bad deduplication logic that was removed in r315279.
While this shouldn't be necessary anymore, we have cases where we run
into the assertion below, i.e. cases with two non-fragment entries for the
same variable at different frame indices.
This should be fixed, but for now, we should revert to a version that
does not trigger asserts.
llvm-svn: 315576
Ivan A. Kosarev [Thu, 12 Oct 2017 11:29:46 +0000 (11:29 +0000)]
[CodeGen] Generate TBAA info along with LValue base info
This patch enables explicit generation of TBAA information in all
cases where LValue base info is propagated or constructed in
non-trivial ways. Eventually, we will consider each of these
cases to make sure the TBAA information is correct and not too
conservative. For now, we just fall back to generating TBAA info
from the access type.
This patch should not bring in any functional changes.
This is part of D38126 reworked to be a separate patch to
simplify review.
Differential Revision: https://reviews.llvm.org/D38733
llvm-svn: 315575
Alexander Kornienko [Thu, 12 Oct 2017 10:41:22 +0000 (10:41 +0000)]
Fix the google-readability-namespace-comments-cxx17 test after r315060.
Restore the file extension. Make the namespace longer than the
ShortNamespaceLines so that the check triggers.
llvm-svn: 315574
NAKAMURA Takumi [Thu, 12 Oct 2017 09:42:14 +0000 (09:42 +0000)]
Fix warnings. [-Wdocumentation]
llvm-svn: 315573
NAKAMURA Takumi [Thu, 12 Oct 2017 09:42:12 +0000 (09:42 +0000)]
SVal::getAsSymbol(bool IncludeBaseRegions): Follow clang/StaticAnalyzer/Core/PathSensitive/SVals.h, s/IncludeBaseRegion/IncludeBaseRegions/g [-Wdocumentation]
llvm-svn: 315572
Oliver Stannard [Thu, 12 Oct 2017 09:28:23 +0000 (09:28 +0000)]
[AsmParser] Suppress compile warning for targets with no register diags
This fixes the "switch statement contains 'default' but no 'case' labels"
warnings in table-generated code introduced in r315295.
llvm-svn: 315571
Roger Ferrer Ibanez [Thu, 12 Oct 2017 08:46:05 +0000 (08:46 +0000)]
Mark test as a long-test
Differential Revision: https://reviews.llvm.org/D38452
llvm-svn: 315570
George Rimar [Thu, 12 Oct 2017 08:40:12 +0000 (08:40 +0000)]
[ELF] - Linkerscript: Add `~` as separate math token.
Previously we did not support following:
foo = ~0xFF;
and had to add space before numeric value:
foo = ~ 0xFF
That was constistent with ld.bfd < 2.30, which shows:
script.txt:3: undefined symbol `~2' referenced in expression,
but inconsistent with gold.
It was fixed for ld.bfd 2.30 as well:
https://sourceware.org/bugzilla/show_bug.cgi?id=22267
Differential revision: https://reviews.llvm.org/D36508
llvm-svn: 315569
Sylvestre Ledru [Thu, 12 Oct 2017 08:07:53 +0000 (08:07 +0000)]
Split the AlignTrailingComments on several lines. The comments were applied to the right columns
llvm-svn: 315568
Martin Storsjo [Thu, 12 Oct 2017 07:05:37 +0000 (07:05 +0000)]
[COFF, ARM64] Add MS builtins __dmb, __dsb, __isb
Differential Revision: https://reviews.llvm.org/D38821
llvm-svn: 315567
NAKAMURA Takumi [Thu, 12 Oct 2017 06:39:44 +0000 (06:39 +0000)]
clang/module.modulemap: Create Clang_Frontend_CodeGenOptions to remove some dependencies in clangBasic.
- Clang_Analysis
- Clang_C
- Clang_Frontend
- Clang_Lex
- Clang_Sema
- Clang_Serialization
- Clang_StaticAnalyzer_Core
llvm-svn: 315566
Hiroshi Inoue [Thu, 12 Oct 2017 06:26:04 +0000 (06:26 +0000)]
[ScheduleDAGInstrs] fix behavior of getUnderlyingObjectsForCodeGen when no identifiable object found
This patch fixes the bug introduced in https://reviews.llvm.org/D35907; the bug is reported by http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-
20171002/491452.html.
Before D35907, when GetUnderlyingObjects fails to find an identifiable object, allMMOsOkay lambda in getUnderlyingObjectsForInstr returns false and Objects vector is cleared. This behavior is unintentionally changed by D35907.
This patch makes the behavior for such case same as the previous behavior.
Since D35907 introduced a wrapper function getUnderlyingObjectsForCodeGen around GetUnderlyingObjects, getUnderlyingObjectsForCodeGen is modified to return a boolean value to ask the caller to clear the Objects vector.
Differential Revision: https://reviews.llvm.org/D38735
llvm-svn: 315565
Mikael Holmen [Thu, 12 Oct 2017 06:21:28 +0000 (06:21 +0000)]
[RegisterCoalescer] Don't set read-undef in pruneValues, only clear
Summary:
The comments in the code said
// Remove <def,read-undef> flags. This def is now a partial redef.
but the code didn't just remove read-undef, it could introduce new ones which
could cause errors.
E.g. if we have something like
%vreg1<def> = IMPLICIT_DEF
%vreg2:subreg1<def, read-undef> = op %vreg3, %vreg4
%vreg2:subreg2<def> = op %vreg6, %vreg7
and we merge %vreg1 and %vreg2 then we should not set undef on the second subreg
def, which the old code did.
Now we solve this by actually do what the code comment says. We remove
read-undef flags rather than remove or introduce them.
Reviewers: qcolombet, MatzeB
Reviewed By: MatzeB
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D38616
llvm-svn: 315564
Martin Storsjo [Thu, 12 Oct 2017 05:37:18 +0000 (05:37 +0000)]
[MinGW] Hook up the --export-all-symbols and --output-def options
Differential Revision: https://reviews.llvm.org/D38761
llvm-svn: 315563
Martin Storsjo [Thu, 12 Oct 2017 05:37:13 +0000 (05:37 +0000)]
[COFF] Add support for automatically exporting all symbols
GNU ld automatically exports all symbols if no symbols have
been chosen to export via either def files or dllexport attributes.
The same behaviour can also be enabled via the GNU ld option
--export-all-symbols, in case some symbols are marked for export
via a def file or dllexport attribute.
The list of excluded symbols is from GNU ld, minus the
cygwin specific symbols.
Also add support for outputting the actual list of exported
symbols in a def file, as in the GNU ld option --output-def.
These options in GNU ld are documented in
https://sourceware.org/binutils/docs/ld/WIN32.html.
This currently exports all symbols from object files pulled in
from libmingw32 and libmingwex and other static libraries
that are linked in.
Differential Revision: https://reviews.llvm.org/D38760
llvm-svn: 315562
Martin Storsjo [Thu, 12 Oct 2017 05:37:06 +0000 (05:37 +0000)]
[COFF] Implement support for IMAGE_REL_ARM64_ADDR32NB
This is implemented in the same way as the other ADDR32NB relocations
for ARM and X64.
Differential Revision: https://reviews.llvm.org/D38815
llvm-svn: 315561
Rui Ueyama [Thu, 12 Oct 2017 05:32:52 +0000 (05:32 +0000)]
Start destructuring adjustExpr function.
adjustExpr became a mysterious function as it does too many things.
This patch is an attempt to destructure that function.
llvm-svn: 315560
Rui Ueyama [Thu, 12 Oct 2017 04:52:54 +0000 (04:52 +0000)]
Fix comment.
llvm-svn: 315559
Rui Ueyama [Thu, 12 Oct 2017 04:52:39 +0000 (04:52 +0000)]
Move more code out of scanRelocs().
llvm-svn: 315558
Justin Bogner [Thu, 12 Oct 2017 04:35:32 +0000 (04:35 +0000)]
Re-commit "llvm-isel-fuzzer: Handle a subset of backend flags in the exec name"
Here we add a secondary option parser to llvm-isel-fuzzer (and provide
it for use with other fuzzers). With this, you can copy the fuzzer to
a name like llvm-isel-fuzzer=aarch64-gisel for a fuzzer that fuzzer
AArch64 with GlobalISel enabled, or fuzzer=x86_64 to fuzz x86, with no
flags required. This should be useful for running these in OSS-Fuzz.
Note that this handrolls a subset of cl::opts to recognize, rather
than embedding a complete command parser for argv[0]. If we find we
really need the flexibility of handling arbitrary options at some
point we can rethink this.
This re-applies 315545 using "=" instead of ":" as a separator for
arguments.
llvm-svn: 315557
Vlad Tsyrklevich [Thu, 12 Oct 2017 04:17:33 +0000 (04:17 +0000)]
[cfi-verify] Fix unittest failures w/o x86 target
The llvm-cfi-verify unit tests fail if LLVM is built without the X86
target, disable the unit tests from being built unless X86 is enabled
for now.
llvm-svn: 315556
Rui Ueyama [Thu, 12 Oct 2017 04:02:02 +0000 (04:02 +0000)]
Make a function shorter.
llvm-svn: 315555
Hans Wennborg [Thu, 12 Oct 2017 03:32:09 +0000 (03:32 +0000)]
Revert r315545 "llvm-isel-fuzzer: Handle a subset of backend flags in the executable name"
It broke some tests on Windows:
Failing Tests (4):
LLVM :: tools/llvm-isel-fuzzer/execname-options.ll
LLVM :: tools/llvm-isel-fuzzer/missing-triple.ll
LLVM :: tools/llvm-isel-fuzzer/x86-empty-bc.ll
LLVM :: tools/llvm-isel-fuzzer/x86-empty.ll
> llvm-isel-fuzzer: Handle a subset of backend flags in the executable name
>
> Here we add a secondary option parser to llvm-isel-fuzzer (and provide
> it for use with other fuzzers). With this, you can copy the fuzzer to
> a name like llvm-isel-fuzzer:aarch64-gisel for a fuzzer that fuzzer
> AArch64 with GlobalISel enabled, or fuzzer:x86_64 to fuzz x86, with no
> flags required. This should be useful for running these in OSS-Fuzz.
>
> Note that this handrolls a subset of cl::opts to recognize, rather
> than embedding a complete command parser for argv[0]. If we find we
> really need the flexibility of handling arbitrary options at some
> point we can rethink this.
llvm-svn: 315554
Hans Wennborg [Thu, 12 Oct 2017 03:23:31 +0000 (03:23 +0000)]
Revert r315533 "Reland "[sanitizer] Introduce ReservedAddressRange to sanitizer_common""
The SanitizerCommon.ReservedAddressRangeUnmap test fails on Windows:
FAIL: SanitizerCommon-Unit :: ./Sanitizer-x86_64-Test.exe/SanitizerCommon.ReservedAddressRangeUnmap (34003 of 35554)
******************** TEST 'SanitizerCommon-Unit :: ./Sanitizer-x86_64-Test.exe/SanitizerCommon.ReservedAddressRangeUnmap' FAILED ********************
Note: Google Test filter = SanitizerCommon.ReservedAddressRangeUnmap
[==========] Running 1 test from 1 test case.
[----------] Global test environment set-up.
[----------] 1 test from SanitizerCommon
[ RUN ] SanitizerCommon.ReservedAddressRangeUnmap
==3780==ERROR: SanitizerTool failed to deallocate 0x1000 (4096) bytes at address 0x0000000c3000 (error code: 487)
==3780==Sanitizer CHECK failed: E:\b\build\slave\win_upload_clang\build\src\third_party\llvm\projects\compiler-rt\lib\sanitizer_common\sanitizer_win.cc:129 (("unable to unmap" && 0)) != (0) (0, 0)
********************
Testing: 0 .. 10.. 20.. 30.. 40.. 50.. 60.. 70.. 80.. 90..
Testing Time: 299.76s
********************
Failing Tests (1):
SanitizerCommon-Unit :: ./Sanitizer-x86_64-Test.exe/SanitizerCommon.ReservedAddressRangeUnmap
> In Fuchsia, MmapNoAccess/MmapFixedOrDie are implemented using a global
> VMAR, which means that MmapNoAccess can only be called once. This works
> for the sanitizer allocator but *not* for the Scudo allocator.
>
> Hence, this changeset introduces a new ReservedAddressRange object to
> serve as the new API for these calls. In this changeset, the object
> still calls into the old Mmap implementations.
>
> The next changeset two changesets will convert the sanitizer and scudo
> allocators to use the new APIs, respectively. (ReservedAddressRange will
> replace the SecondaryHeader in Scudo.)
>
> Finally, a last changeset will update the Fuchsia implementation.
>
> Patch by Julia Hansbrough
>
> Differential Revision: https://reviews.llvm.org/D38437
llvm-svn: 315553
Rui Ueyama [Thu, 12 Oct 2017 03:14:06 +0000 (03:14 +0000)]
Remove one parameter from Target::getRelExpr.
A section was passed to getRelExpr just to create an error message.
But if there's an invalid relocation, we would eventually report it
in relocateOne. So we don't have to pass a section to getRelExpr.
llvm-svn: 315552
Hongbin Zheng [Thu, 12 Oct 2017 02:54:11 +0000 (02:54 +0000)]
[SimplifyIndVar] Replace IVUsers with loop invariant whenever possible
Differential Revision: https://reviews.llvm.org/D38415
llvm-svn: 315551
Justin Bogner [Thu, 12 Oct 2017 02:28:26 +0000 (02:28 +0000)]
docs: Add some links to OSS Fuzz
I'd left a couple of stray links here in a previous commit rather than
writing a paragraph.
llvm-svn: 315550
Jim Ingham [Thu, 12 Oct 2017 02:21:41 +0000 (02:21 +0000)]
The save_crashlog command was still looking at lldb.target and
lldb.process. That hasn't worked for a long time. Convert it
to the form that takes an SBExecutionContext and use that instead.
llvm-svn: 315549
Rui Ueyama [Thu, 12 Oct 2017 02:09:11 +0000 (02:09 +0000)]
Rewrite comment.
llvm-svn: 315548
Craig Topper [Thu, 12 Oct 2017 02:06:17 +0000 (02:06 +0000)]
[X86] Remove a few unnecessary check lines from the predefined-arch-macros test.
These were testing OS macros and clang/llvm macros.
llvm-svn: 315547
Justin Bogner [Thu, 12 Oct 2017 02:04:39 +0000 (02:04 +0000)]
docs: Try to fix sphinx build
llvm-svn: 315546
Justin Bogner [Thu, 12 Oct 2017 01:57:49 +0000 (01:57 +0000)]
llvm-isel-fuzzer: Handle a subset of backend flags in the executable name
Here we add a secondary option parser to llvm-isel-fuzzer (and provide
it for use with other fuzzers). With this, you can copy the fuzzer to
a name like llvm-isel-fuzzer:aarch64-gisel for a fuzzer that fuzzer
AArch64 with GlobalISel enabled, or fuzzer:x86_64 to fuzz x86, with no
flags required. This should be useful for running these in OSS-Fuzz.
Note that this handrolls a subset of cl::opts to recognize, rather
than embedding a complete command parser for argv[0]. If we find we
really need the flexibility of handling arbitrary options at some
point we can rethink this.
llvm-svn: 315545
Justin Bogner [Thu, 12 Oct 2017 01:44:24 +0000 (01:44 +0000)]
docs: Add some information about Fuzzing LLVM itself
This splits some content out of the libFuzzer docs and adds a fair
amount of detail about the fuzzers in LLVM.
llvm-svn: 315544
Rui Ueyama [Thu, 12 Oct 2017 00:43:22 +0000 (00:43 +0000)]
Rename P -> Pieces.
Conventionally, an array of SectionPieces is named Pieces.
It is better to follow the convention.
llvm-svn: 315543
Reid Kleckner [Thu, 12 Oct 2017 00:28:28 +0000 (00:28 +0000)]
Speculative build fix 2
llvm-svn: 315542
Wei Mi [Thu, 12 Oct 2017 00:24:52 +0000 (00:24 +0000)]
Revert r307036 because of PR34919.
llvm-svn: 315540
Reid Kleckner [Thu, 12 Oct 2017 00:20:50 +0000 (00:20 +0000)]
Speculative build fix, apparently I built llc without my patch applied to test it
llvm-svn: 315539
Reid Kleckner [Thu, 12 Oct 2017 00:06:57 +0000 (00:06 +0000)]
[codeview] Disable FPO in functions using EH funclets
Funclets are emitted by WinException which doesn't have access to
X86TargetStreamer so it's hard to make a quick fix for this.
llvm-svn: 315538
NAKAMURA Takumi [Thu, 12 Oct 2017 00:04:24 +0000 (00:04 +0000)]
lld: Prune unused libdeps.
llvm-svn: 315537
Zachary Turner [Wed, 11 Oct 2017 23:54:34 +0000 (23:54 +0000)]
Revert "[ADT] Make Twine's copy constructor private."
This reverts commit
4e4ee1c507e2707bb3c208e1e1b6551c3015cbf5.
This is failing due to some code that isn't built on MSVC
so I didn't catch. Not immediately obvious how to fix this
at first glance, so I'm reverting for now.
llvm-svn: 315536
Reid Kleckner [Wed, 11 Oct 2017 23:53:36 +0000 (23:53 +0000)]
Fix AMDGPU build issue
llvm-svn: 315535
Reid Kleckner [Wed, 11 Oct 2017 23:53:12 +0000 (23:53 +0000)]
[X86] Sink X86AsmPrinter ctor into .cpp file, NFC
I keep adding and removing code here, so let's sink it.
llvm-svn: 315534
Petr Hosek [Wed, 11 Oct 2017 23:41:32 +0000 (23:41 +0000)]
Reland "[sanitizer] Introduce ReservedAddressRange to sanitizer_common"
In Fuchsia, MmapNoAccess/MmapFixedOrDie are implemented using a global
VMAR, which means that MmapNoAccess can only be called once. This works
for the sanitizer allocator but *not* for the Scudo allocator.
Hence, this changeset introduces a new ReservedAddressRange object to
serve as the new API for these calls. In this changeset, the object
still calls into the old Mmap implementations.
The next changeset two changesets will convert the sanitizer and scudo
allocators to use the new APIs, respectively. (ReservedAddressRange will
replace the SecondaryHeader in Scudo.)
Finally, a last changeset will update the Fuchsia implementation.
Patch by Julia Hansbrough
Differential Revision: https://reviews.llvm.org/D38437
llvm-svn: 315533
Lang Hames [Wed, 11 Oct 2017 23:35:27 +0000 (23:35 +0000)]
Update cc1as_main for MCCodeEmitter ownership change in r315531.
llvm-svn: 315532
Lang Hames [Wed, 11 Oct 2017 23:34:47 +0000 (23:34 +0000)]
[MC] Have MCObjectStreamer take its MCAsmBackend argument via unique_ptr.
MCObjectStreamer owns its MCCodeEmitter -- this fixes the types to reflect that,
and allows us to remove the last instance of MCObjectStreamer's weird "holding
ownership via someone else's reference" trick.
llvm-svn: 315531
Zachary Turner [Wed, 11 Oct 2017 23:33:06 +0000 (23:33 +0000)]
[ADT] Make Twine's copy constructor private.
There's a lot of misuse of Twine scattered around LLVM. This
ranges in severity from benign (returning a Twine from a function
by value that is just a string literal) to pretty sketchy (storing
a Twine by value in a class). While there are some uses for
copying Twines, most of the very compelling ones are confined
to the Twine class implementation itself, and other uses are
either dubious or easily worked around.
This patch makes Twine's copy constructor private, and fixes up
all callsites.
Differential Revision: https://reviews.llvm.org/D38767
llvm-svn: 315530
NAKAMURA Takumi [Wed, 11 Oct 2017 23:18:43 +0000 (23:18 +0000)]
lld: Reorder libdeps.
Differential Revision: https://reviews.llvm.org/D38828
llvm-svn: 315529
Vlad Tsyrklevich [Wed, 11 Oct 2017 23:17:29 +0000 (23:17 +0000)]
MC Helpers for llvm-cfi-verify.
Add instruction analysis and machinecode traversal helpers in
preparation for control flow graph generation implementation.
Reviewers: vlad.tsyrklevich
Reviewed By: vlad.tsyrklevich
Subscribers: mgorny, llvm-commits, pcc, kcc
Differential Revision: https://reviews.llvm.org/D38424
llvm-svn: 315528
NAKAMURA Takumi [Wed, 11 Oct 2017 23:03:05 +0000 (23:03 +0000)]
MachineOptimizationRemarkEmitter.h: Appease g++-4.8.2. See also rL313715.
llvm-svn: 315527
Konstantin Zhuravlyov [Wed, 11 Oct 2017 22:59:35 +0000 (22:59 +0000)]
AMDGPU/NFC: Minor clean ups in HSA metadata
- Use HSA metadata streamer directly from AMDGPUAsmPrinter
- Make naming consistent with PAL metadata
Differential Revision: https://reviews.llvm.org/D38746
llvm-svn: 315526
Rui Ueyama [Wed, 11 Oct 2017 22:49:24 +0000 (22:49 +0000)]
Define RelType to represent relocation types.
We were using uint32_t as the type of relocation kind. It has a
readability issue because what Type really means in `uint32_t Type`
is not obvious. It could be a section type, a symbol type or a
relocation type.
Since we do not do any arithemetic operations on relocation types
(e.g. adding one to R_X86_64_PC32 doesn't make sense), it would be
more natural if they are represented as enums. Unfortunately, that
is not doable because relocation type definitions are spread into
multiple header files.
So I decided to use typedef. This still should be better than the
plain uint32_t because the intended type is now obvious.
llvm-svn: 315525
Ted Woodward [Wed, 11 Oct 2017 22:42:21 +0000 (22:42 +0000)]
Add cases for new type DependentAddressSpace, added in r314649
llvm-svn: 315524
Konstantin Zhuravlyov [Wed, 11 Oct 2017 22:41:09 +0000 (22:41 +0000)]
AMDGPU/NFC: Minor clean ups in PAL metadata
- Move PAL metadata definitions to AMDGPUMetadata
- Make naming consistent with HSA metadata
Differential Revision: https://reviews.llvm.org/D38745
llvm-svn: 315523
Konstantin Zhuravlyov [Wed, 11 Oct 2017 22:18:53 +0000 (22:18 +0000)]
AMDGPU/NFC: Rename code object metadata as HSA metadata
- Rename AMDGPUCodeObjectMetadata to AMDGPUMetadata (PAL metadata will be included in this file in the follow up change)
- Rename AMDGPUCodeObjectMetadataStreamer to AMDGPUHSAMetadataStreamer
- Introduce HSAMD namespace
- Other minor name changes in function and test names
llvm-svn: 315522
Hans Wennborg [Wed, 11 Oct 2017 22:04:14 +0000 (22:04 +0000)]
Support: Work around missing SetFileInformationByHandle on Wine
In r315079, fs::rename was reimplemented in terms of CreateFile and
SetFileInformationByHandle. Unfortunately, the latter isn't supported by
Wine. This adds a fallback to MoveFileEx for that case.
Differential Revision: https://reviews.llvm.org/D38817
llvm-svn: 315520
Eugene Zelenko [Wed, 11 Oct 2017 21:56:44 +0000 (21:56 +0000)]
[Transforms] Revert r315516 changes in PredicateInfo to fix Windows build bots (NFC).
llvm-svn: 315519
Vedant Kumar [Wed, 11 Oct 2017 21:54:09 +0000 (21:54 +0000)]
[Driver] Export symbols needed to use profile runtime
Apple's API verification tool (tapi) checks that the symbols exported
from a program match a whitelist. When the program uses the profile
runtime, some additional symbols which are typically not part of the
regular whitelist must be exported.
If we're using symbol export directives along with the profile runtime
on Darwin, the driver needs to export the additional symbols to avoid
verification failures.
rdar://problem/
30067753
llvm-svn: 315518
Craig Topper [Wed, 11 Oct 2017 21:42:02 +0000 (21:42 +0000)]
[X86] Add support for 'amdfam17h' to __builtin_cpu_is to match gcc.
The compiler-rt implementation already supported it, it just wasn't exposed.
llvm-svn: 315517
Eugene Zelenko [Wed, 11 Oct 2017 21:41:43 +0000 (21:41 +0000)]
[Transforms] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC).
llvm-svn: 315516
Reid Kleckner [Wed, 11 Oct 2017 21:27:54 +0000 (21:27 +0000)]
Really fix llvm-rc include-paths.test
llvm-svn: 315515
Reid Kleckner [Wed, 11 Oct 2017 21:25:03 +0000 (21:25 +0000)]
Attempt to fix failing llvm-rc include-paths.text
llvm-svn: 315514
Reid Kleckner [Wed, 11 Oct 2017 21:24:33 +0000 (21:24 +0000)]
[codeview] Implement FPO data assembler directives
Summary:
This adds a set of new directives that describe 32-bit x86 prologues.
The directives are limited and do not expose the full complexity of
codeview FPO data. They are merely a convenience for the compiler to
generate more readable assembly so we don't need to generate tons of
labels in CodeGen. If our prologue emission changes in the future, we
can change the set of available directives to suit our needs. These are
modelled after the .seh_ directives, which use a different format that
interacts with exception handling.
The directives are:
.cv_fpo_proc _foo
.cv_fpo_pushreg ebp/ebx/etc
.cv_fpo_setframe ebp/esi/etc
.cv_fpo_stackalloc 200
.cv_fpo_endprologue
.cv_fpo_endproc
.cv_fpo_data _foo
I tried to follow the implementation of ARM EHABI CFI directives by
sinking most directives out of MCStreamer and into X86TargetStreamer.
This helps avoid polluting non-X86 code with WinCOFF specific logic.
I used cdb to confirm that this can show locals in parent CSRs in a few
cases, most importantly the one where we use ESI as a frame pointer,
i.e. the one in http://crbug.com/756153#c28
Once we have cdb integration in debuginfo-tests, we can add integration
tests there.
Reviewers: majnemer, hans
Subscribers: aemerson, mgorny, kristof.beyls, llvm-commits, hiraditya
Differential Revision: https://reviews.llvm.org/D38776
llvm-svn: 315513
Evgeniy Stepanov [Wed, 11 Oct 2017 21:22:45 +0000 (21:22 +0000)]
Disable TSan tests on Android.
They never passed. This change excludes them from 'check-all'.
llvm-svn: 315512
Evgeniy Stepanov [Wed, 11 Oct 2017 21:22:32 +0000 (21:22 +0000)]
Disable profile tests on Android.
They never actually worked, but this way they are not included in "check-all".
llvm-svn: 315511
Krzysztof Parzyszek [Wed, 11 Oct 2017 21:20:43 +0000 (21:20 +0000)]
[Hexagon] Make sure that new-value jump is packetized with producer
llvm-svn: 315510
Kostya Kortchinsky [Wed, 11 Oct 2017 21:20:04 +0000 (21:20 +0000)]
[sanitizer] Move the errno/ENOMEM allocator checks logic to separate .cc
Summary:
This is a new attempt at D38706, which had 2 issues.
The first one was that it broke TSan, because `sanitizer_errno.h` was not
directly included in `tsan_mman.cc`. This fixes the include.
The second one was that it broke the nolibc build, because `__errno_location`
couldn't be found. This adds the new .cc to the libcdep list instead of the
base one.
Reviewers: alekseyshl
Reviewed By: alekseyshl
Subscribers: kubamracek, mgorny, llvm-commits
Differential Revision: https://reviews.llvm.org/D38743
llvm-svn: 315509
George Karpenkov [Wed, 11 Oct 2017 20:53:01 +0000 (20:53 +0000)]
[Analyzer] Support bodyfarming libstdc++ implementation of std::call_once.
Differential Revision: https://reviews.llvm.org/D38810
llvm-svn: 315508