Douglas Yung [Fri, 20 Apr 2018 15:23:57 +0000 (15:23 +0000)]
Fix test by allowing it to accept an upper or lower case letter as the first character.
Windows for some reason uses a lower case letter, while linux uses upper case.
llvm-svn: 330438
Sanjay Patel [Fri, 20 Apr 2018 15:07:55 +0000 (15:07 +0000)]
[DAGCombine] (float)((int) f) --> ftrunc (PR36617)
This was originally committed at rL328921 and reverted at rL329920 to
investigate failures in Chrome. This time I've added to the ReleaseNotes
to warn users of the potential of exposing UB and let me repeat that
here for more exposure:
Optimization of floating-point casts is improved. This may cause surprising
results for code that is relying on undefined behavior. Code sanitizers can
be used to detect affected patterns such as this:
int main() {
float x =
4294967296.0f;
x = (float)((int)x);
printf("junk in the ftrunc: %f\n", x);
return 0;
}
$ clang -O1 ftrunc.c -fsanitize=undefined ; ./a.out
ftrunc.c:5:15: runtime error: 4.29497e+09 is outside the range of
representable values of type 'int'
junk in the ftrunc: 0.000000
Original commit message:
fptosi / fptoui round towards zero, and that's the same behavior as ISD::FTRUNC,
so replace a pair of casts with the equivalent node. We don't have to account for
special cases (NaN, INF) because out-of-range casts are undefined.
Differential Revision: https://reviews.llvm.org/D44909
llvm-svn: 330437
Simon Pilgrim [Fri, 20 Apr 2018 15:01:03 +0000 (15:01 +0000)]
[CostModel][X86] Add srem/urem constant cost tests
llvm-svn: 330436
Simon Pilgrim [Fri, 20 Apr 2018 14:50:34 +0000 (14:50 +0000)]
[CostModel][X86] Add SLM/GLM/BtVer2 compare + division/remainder cost tests
llvm-svn: 330435
Michael Zolotukhin [Fri, 20 Apr 2018 13:51:36 +0000 (13:51 +0000)]
Fix typo in a test.
llvm-svn: 330434
Simon Pilgrim [Fri, 20 Apr 2018 13:50:33 +0000 (13:50 +0000)]
[CostModel][X86] Split off BtVer2 cost checks
llvm-svn: 330433
Simon Pilgrim [Fri, 20 Apr 2018 13:42:53 +0000 (13:42 +0000)]
[CostModel][X86] Add GoldmontPlus cost tests
Just reuses goldmont costs atm
llvm-svn: 330432
Michael Zolotukhin [Fri, 20 Apr 2018 13:34:32 +0000 (13:34 +0000)]
Revert "Revert r330403 and r330413."
Reapply the patches with a fix. Thanks Ilya and Hans for the reproducer!
This reverts commit r330416.
The issue was that removing predecessors invalidated uses that we stored
for rewrite. The fix is to finish manipulating with CFG before we select
uses for rewrite.
llvm-svn: 330431
Jonas Hahnfeld [Fri, 20 Apr 2018 13:26:03 +0000 (13:26 +0000)]
[docs] Regenerate command line reference
This will correctly sort some manually added entries which should
generally be avoided!
llvm-svn: 330430
Jonas Hahnfeld [Fri, 20 Apr 2018 13:25:59 +0000 (13:25 +0000)]
[OpenMP] Hide -fopenmp-cuda-mode
This is an advanced flag that should show up neither in clang --help
nor in the ClangCommandLineReference.
llvm-svn: 330429
Simon Pilgrim [Fri, 20 Apr 2018 13:12:04 +0000 (13:12 +0000)]
[X86][BtVer2] Cleanup some old FIXMEs from the model. NFCI.
llvm-svn: 330428
Nico Weber [Fri, 20 Apr 2018 13:10:44 +0000 (13:10 +0000)]
clang-cl: Accept (and ignore) /Zc:__cplusplus.
See https://blogs.msdn.microsoft.com/vcblog/2018/04/09/msvc-now-correctly-reports-__cplusplus/
clang-cl already sets __cplusplus to the correct value, so we can just ignore this flag.
Also add test coverage for a few more accepted-but-ignored flags.
https://reviews.llvm.org/D45877
llvm-svn: 330427
Jonas Hahnfeld [Fri, 20 Apr 2018 13:04:54 +0000 (13:04 +0000)]
[CUDA] Document recent changes
* Finding installations via ptxas binary
* Relocatable device code
Differential Revision: https://reviews.llvm.org/D45449
llvm-svn: 330426
Jonas Hahnfeld [Fri, 20 Apr 2018 13:04:45 +0000 (13:04 +0000)]
[CUDA] Register relocatable GPU binaries
nvcc generates a unique registration function for each object file
that contains relocatable device code. Unique names are achieved
with a module id that is also reflected in the function's name.
Differential Revision: https://reviews.llvm.org/D42922
llvm-svn: 330425
Simon Pilgrim [Fri, 20 Apr 2018 12:54:53 +0000 (12:54 +0000)]
[X86] Tag CLDEMOTE instruction with WriteLoad scheduling class
Same as other cacheline instructions
llvm-svn: 330424
Sander de Smalen [Fri, 20 Apr 2018 12:52:01 +0000 (12:52 +0000)]
[AArch64][SVE] Asm: Support for contiguous LD1 (scalar+scalar) load instructions.
This is patch [4/4] in a series to add assembler/disassembler support for
SVE's contiguous LD1 (scalar+scalar) instructions:
- Patch [1/4]: https://reviews.llvm.org/D45687
- Patch [2/4]: https://reviews.llvm.org/D45688
- Patch [3/4]: https://reviews.llvm.org/D45689
- Patch [4/4]: https://reviews.llvm.org/D45690
Reviewers: fhahn, rengolin, javed.absar, huntergr, SjoerdMeijer, t.p.northover, echristo, evandro
Reviewed By: fhahn
Differential Revision: https://reviews.llvm.org/D45690
llvm-svn: 330423
Florian Hahn [Fri, 20 Apr 2018 12:50:10 +0000 (12:50 +0000)]
[Driver] Support for -save-stats in AddGoldPlugin.
This patch updates AddGoldPlugin to pass stats-file to the Gold plugin,
if -save-stats is passed. It also moves the save-stats option handling
to a helper function tools::getStatsFileName.
Reviewers: tejohnson, mehdi_amini, compnerd
Reviewed By: tejohnson, compnerd
Differential Revision: https://reviews.llvm.org/D45771
llvm-svn: 330422
Jonas Devlieghere [Fri, 20 Apr 2018 12:33:49 +0000 (12:33 +0000)]
[ObjectYAML] Add ability for DWARFYAML to calculate DIE lengths
This patch adds the ability for the ObjectYAML DWARFEmitter to calculate
the lengths of DIEs. This is accomplished by creating a DIEFixupVisitor
class which traverses the DWARF DIEs to calculate and fix up the lengths
in the Compile Unit header.
The DIEFixupVisitor can be extended in the future to enable more complex
fix ups which will enable simplified YAML string representations.
This is also very useful when using the YAML format in unit tests
because you no longer need to know the length of the compile unit when
writing the YAML string.
Differential commandeered from Chris Bieneman (beanz)
Differential revision: https://reviews.llvm.org/D30666
llvm-svn: 330421
Ivan A. Kosarev [Fri, 20 Apr 2018 12:09:25 +0000 (12:09 +0000)]
[NEON] Add a comment explaining the situation with vget_high_f16() and vget_low_f16() intrinsics
Related differential revision: https://reviews.llvm.org/D45668
llvm-svn: 330420
Greg Bedwell [Fri, 20 Apr 2018 11:38:11 +0000 (11:38 +0000)]
[UpdateTestChecks] Fix update_mca_test_checks.py slowness issue
The script was using Python's difflib module to calculate the number of
lines changed so that it could report it in its status output. It turns
out this can be very very slow on large sets of lines (Python bug 6931).
It's not worth the cost, so just remove the usage of difflib entirely.
llvm-svn: 330419
Sam McCall [Fri, 20 Apr 2018 11:35:17 +0000 (11:35 +0000)]
Parse .h files as objective-c++ if we don't have a compile command.
Summary: This makes C++/objC not totally broken, without hurting C files too much.
Reviewers: ilya-biryukov
Subscribers: klimek, jkorous-apple, ioeric, cfe-commits
Differential Revision: https://reviews.llvm.org/D45442
llvm-svn: 330418
Florian Hahn [Fri, 20 Apr 2018 11:21:13 +0000 (11:21 +0000)]
Require asserts for stats-file-option tests.
llvm-svn: 330417
Ilya Biryukov [Fri, 20 Apr 2018 10:52:54 +0000 (10:52 +0000)]
Revert r330403 and r330413.
Revert r330413: "[SSAUpdaterBulk] Use SmallVector instead of DenseMap for storing rewrites."
Revert r330403 "Reapply "[PR16756] Use SSAUpdaterBulk in JumpThreading." one more time."
r330403 commit seems to crash clang during our integrate while doing PGO build with the following stacktrace:
#2 llvm::SSAUpdaterBulk::RewriteAllUses(llvm::DominatorTree*, llvm::SmallVectorImpl<llvm::PHINode*>*)
#3 llvm::JumpThreadingPass::ThreadEdge(llvm::BasicBlock*, llvm::SmallVectorImpl<llvm::BasicBlock*> const&, llvm::BasicBlock*)
#4 llvm::JumpThreadingPass::ProcessThreadableEdges(llvm::Value*, llvm::BasicBlock*, llvm::jumpthreading::ConstantPreference, llvm::Instruction*)
#5 llvm::JumpThreadingPass::ProcessBlock(llvm::BasicBlock*)
The crash happens while compiling 'lib/Analysis/CallGraph.cpp'.
r3340413 is reverted due to conflicting changes.
llvm-svn: 330416
Roman Lebedev [Fri, 20 Apr 2018 10:49:19 +0000 (10:49 +0000)]
[NFC][InstCombine] Regenerate two tests that are affected by folding masked merge
llvm-svn: 330415
Andrew Ng [Fri, 20 Apr 2018 10:44:42 +0000 (10:44 +0000)]
[DebugInfo] Fix for split dwarf test on Windows (NFC)
On Windows, %llc_dwarf automatically adds -mtriple causing this test to
error. Changed %llc_dwarf to llc.
Differential Revision: https://reviews.llvm.org/D45869
llvm-svn: 330414
Michael Zolotukhin [Fri, 20 Apr 2018 10:31:06 +0000 (10:31 +0000)]
[SSAUpdaterBulk] Use SmallVector instead of DenseMap for storing rewrites.
llvm-svn: 330413
Ilya Biryukov [Fri, 20 Apr 2018 10:19:38 +0000 (10:19 +0000)]
[Dockerfiles] Split checkout and build scripts into separate files.
Summary:
This is a small refactoring to extract the svn checkout code from the
build script used inside the docker image.
This would give more flexibility if more than a single invocation of
cmake is needed inside the docker image.
User-facing interface (build_docker_image.sh) hasn't changed, only the
internal scripts running inside the build container are affected.
Reviewers: ioeric
Reviewed By: ioeric
Subscribers: mehdi_amini, llvm-commits
Differential Revision: https://reviews.llvm.org/D45868
llvm-svn: 330412
Florian Hahn [Fri, 20 Apr 2018 10:18:36 +0000 (10:18 +0000)]
[LTO] Add stats-file option to LTO/Config.h.
This patch adds a StatsFile option to LTO/Config.h and updates both
LLVMGold and llvm-lto2 to set it.
Reviewers: MatzeB, tejohnson, espindola
Reviewed By: tejohnson
Differential Revision: https://reviews.llvm.org/D45531
llvm-svn: 330411
Andrea Di Biagio [Fri, 20 Apr 2018 10:16:31 +0000 (10:16 +0000)]
CODE_OWNERS: Take code ownership of llvm-mca.
llvm-svn: 330410
Dan Liew [Fri, 20 Apr 2018 10:11:41 +0000 (10:11 +0000)]
[lit] Fix a bug where UNRESOLVED tests were not handled in the XUnit
XML printer.
A test has been added that tries to comprehensively test emitting
XUnit XML output for shell tests.
Differential Revision: https://reviews.llvm.org/D45567
llvm-svn: 330409
Andrea Di Biagio [Fri, 20 Apr 2018 09:47:03 +0000 (09:47 +0000)]
Fix -Wunused-variable warnings after r330377.
llvm-svn: 330408
Sander de Smalen [Fri, 20 Apr 2018 09:45:50 +0000 (09:45 +0000)]
[AArch64][SVE] Fix diagnostic for SVE LD4 instructions:
Diagnostic:
'index must be multiple of 3 in range [-32, 28]'
Must be:
'index must be multiple of 4 in range [-32, 28]'
llvm-svn: 330407
Sander de Smalen [Fri, 20 Apr 2018 08:54:49 +0000 (08:54 +0000)]
[AArch64][SVE] Added GPR64shifted and GPR64NoXZRshifted register classes.
Summary:
This is patch [3/4] in a series to add assembler/disassembler support for
SVE's contiguous LD1 (scalar+scalar) instructions:
- Patch [1/4]: https://reviews.llvm.org/D45687
- Patch [2/4]: https://reviews.llvm.org/D45688
- Patch [3/4]: https://reviews.llvm.org/D45689
- Patch [4/4]: https://reviews.llvm.org/D45690
Reviewers: fhahn, rengolin, javed.absar, huntergr, SjoerdMeijer, t.p.northover, echristo, evandro
Reviewed By: SjoerdMeijer
Subscribers: tschuett, kristof.beyls, llvm-commits
Differential Revision: https://reviews.llvm.org/D45689
llvm-svn: 330406
Pavel Labath [Fri, 20 Apr 2018 08:27:27 +0000 (08:27 +0000)]
Move FileSpecTest to Utility
FileSpec class was moved to the Utility module a while ago, but the test
file was left behind. This corrects that.
llvm-svn: 330405
Alexey Sotkin [Fri, 20 Apr 2018 08:08:04 +0000 (08:08 +0000)]
[OpenCL] Add 'denorms-are-zero' function attribute
Summary:
Generate attribute 'denorms-are-zero'='true' if '-cl-denorms-are-zero'
compile option was specified and 'denorms-are-zero'='false' otherwise.
Patch by krisb
Reviewers: Anastasia, yaxunl
Reviewed By: yaxunl
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D45808
llvm-svn: 330404
Michael Zolotukhin [Fri, 20 Apr 2018 08:01:08 +0000 (08:01 +0000)]
Reapply "[PR16756] Use SSAUpdaterBulk in JumpThreading." one more time.
Hopefully, changing set to vector removes nondeterminism detected by
some bots, or the new assert will catch something.
This reverts commit r330180.
llvm-svn: 330403
Michael Zolotukhin [Fri, 20 Apr 2018 07:59:57 +0000 (07:59 +0000)]
[SSAUpdaterBulk] Add an assert.
llvm-svn: 330402
Daniel Cederman [Fri, 20 Apr 2018 07:59:13 +0000 (07:59 +0000)]
Add SPARC support to update_llc_test_checks.py
Reviewers: spatel, jyknight
Reviewed By: spatel
Subscribers: fedor.sergeev, llvm-commits
Differential Revision: https://reviews.llvm.org/D45809
llvm-svn: 330401
Michael Zolotukhin [Fri, 20 Apr 2018 07:58:54 +0000 (07:58 +0000)]
[SSAUpdaterBulk] Add * and & to auto.
llvm-svn: 330400
Michael Zolotukhin [Fri, 20 Apr 2018 07:57:24 +0000 (07:57 +0000)]
[SSAUpdaterBulk] Use PredCache in ComputeLiveInBlocks.
llvm-svn: 330399
Michael Zolotukhin [Fri, 20 Apr 2018 07:56:00 +0000 (07:56 +0000)]
[SSAUpdaterBulk] Use SmallVector instead of SmallPtrSet for uses.
llvm-svn: 330398
Daniel Cederman [Fri, 20 Apr 2018 07:53:27 +0000 (07:53 +0000)]
Revert "This pass, fixing an erratum in some LEON 2 processors..."
Summary:
Reading Atmel's AT697E errata document this does not seem like a valid
workaround. While the text only mentions SDIV, it says that the ICC flags
can be wrong, and those are only generated by SDIVcc. Verification on
hardware shows that simply replacing SDIV with SDIVcc does not avoid
the bug with negative operands.
This reverts r283727.
Reviewers: lero_chris, jyknight
Reviewed By: jyknight
Subscribers: fedor.sergeev, jrtc27, llvm-commits
Differential Revision: https://reviews.llvm.org/D45813
llvm-svn: 330397
Daniel Cederman [Fri, 20 Apr 2018 07:47:12 +0000 (07:47 +0000)]
[Sparc] Use synthetic instruction clr to zero register instead of sethi
Using `clr reg`/`mov %g0, reg`/`or %g0, %g0, reg` to zero a register
looks much better than `sethi 0, reg`.
Reviewers: jyknight, venkatra
Reviewed By: jyknight
Subscribers: eraman, fedor.sergeev, jrtc27, llvm-commits
Differential Revision: https://reviews.llvm.org/D45810
llvm-svn: 330396
Hans Wennborg [Fri, 20 Apr 2018 07:34:59 +0000 (07:34 +0000)]
Revert r330376 "[sanitizer] Generalize atomic_uint8_t, atomic_uint16_t, ... into a template. NFC."
This broke the Windows build, see e.g. http://lab.llvm.org:8011/builders/clang-x64-ninja-win7/builds/10130
> Differential Revision: https://reviews.llvm.org/D44246
llvm-svn: 330395
Sander de Smalen [Fri, 20 Apr 2018 07:24:20 +0000 (07:24 +0000)]
[AArch64][AsmParser] Extend RegOp with integrated 'shift/extend'.
Summary:
In some cases the shift/extend needs to be explicitly parsed together
with the register, rather than as a separate operand. This is needed
for addressing modes where the instruction as a whole dictates the
scaling/extend, rather than specific bits in the instruction.
By parsing them as a single operand, we avoid the need to pass an
extra operand in all CodeGen patterns (because all operands need to
have an associated value), and we avoid the need to update TableGen to
accept operands that have no associated bits in the instruction.
An added benefit of parsing them together is that the assembler
can give a sensible diagnostic if the scaling is not correct.
This is patch [2/4] in a series to add assembler/disassembler support for
SVE's contiguous LD1 (scalar+scalar) instructions:
- Patch [1/4]: https://reviews.llvm.org/D45687
- Patch [2/4]: https://reviews.llvm.org/D45688
- Patch [3/4]: https://reviews.llvm.org/D45689
- Patch [4/4]: https://reviews.llvm.org/D45690
Reviewers: fhahn, rengolin, javed.absar, huntergr, SjoerdMeijer, t.p.northover, echristo, evandro
Reviewed By: fhahn, SjoerdMeijer
Subscribers: kristof.beyls, llvm-commits
Differential Revision: https://reviews.llvm.org/D45688
llvm-svn: 330394
Nicolai Haehnle [Fri, 20 Apr 2018 07:14:25 +0000 (07:14 +0000)]
AMDGPU: Legalize the operand of SI_INIT_M0
Summary:
This fixes a case where the argument to a sendmsg intrinsic
ends up in a VGPR, for whatever reason.
The underlying performance issue is that a multiplication that
can be an s_mul_i32 is instead needlessly generated as
v_mul_u32_u24, but this is not addressed by this patch.
Change-Id: I61fd4034314d5acdf6074632c30b65364dfa7328
Reviewers: arsenm, rampitec
Subscribers: kzhuravl, wdng, yaxunl, dstuttard, tpr, t-tye, llvm-commits
Differential Revision: https://reviews.llvm.org/D45826
llvm-svn: 330393
Daniel Cederman [Fri, 20 Apr 2018 06:57:49 +0000 (06:57 +0000)]
[Sparc] Fix addressing mode when using 64-bit values in inline assembly
Summary:
If a 64-bit register is used as an operand in inline assembly together
with a memory reference, the memory addressing will be wrong. The
addressing will be a single reg, instead of reg+reg or reg+imm. This
will generate a bad offset value or an exception in printMemOperand().
For example:
```
long long int val = 5;
long long int mem;
__asm__ volatile ("std %1, %0":"=m"(mem):"r"(val));
```
becomes:
```
std %i0, [%i2+589833]
```
The problem is that SelectInlineAsmMemoryOperand() is never called for
the memory references if one of the operands is a 64-bit register.
By calling SelectInlineAsmMemoryOperands() in tryInlineAsm() the Sparc
version of SelectInlineAsmMemoryOperand() gets called for each memory
reference.
Reviewers: jyknight, venkatra
Reviewed By: jyknight
Subscribers: eraman, fedor.sergeev, jrtc27, llvm-commits
Differential Revision: https://reviews.llvm.org/D45761
llvm-svn: 330392
Dan Liew [Fri, 20 Apr 2018 06:46:19 +0000 (06:46 +0000)]
[LibFuzzer] Report when custom counters are available.
This upstreams a feature from the JFS solver's fork of LibFuzzer.
Differential Revision: https://reviews.llvm.org/D45675
llvm-svn: 330391
Dan Liew [Fri, 20 Apr 2018 06:46:14 +0000 (06:46 +0000)]
[LibFuzzer] Try to unbreak the `FuzzerMutate.ShuffleBytes1` unit test.
This test is failing on my Linux box. Just increasing the number of
iterations works around this. The divergence is likely due to
our reliance on `std::shuffle()` which is not guaranteed to have
the same behaviour across platforms.
This is a strong argument for us to implement our own shuffle
function to avoid divergence in behaviour across platforms.
Differential Revision: https://reviews.llvm.org/D45767
llvm-svn: 330390
Dan Liew [Fri, 20 Apr 2018 06:46:09 +0000 (06:46 +0000)]
[LibFuzzer] Unbreak the `trace-malloc-unbalanced.test` when using Python 3.
The `unbalanced_allocs.py` script uses Python 2 print statement
and `iteritems()`. Running `2to3` over the script fixes these.
Differential Revision: https://reviews.llvm.org/D45765
llvm-svn: 330389
Vlad Tsyrklevich [Fri, 20 Apr 2018 02:26:12 +0000 (02:26 +0000)]
Fix build failures for r330387 on buildbots that don't build the X86 target
llvm-svn: 330388
Vlad Tsyrklevich [Fri, 20 Apr 2018 01:36:48 +0000 (01:36 +0000)]
LowerTypeTests: Propagate symver directives
Summary:
This change fixes https://crbug.com/834474, a build failure caused by
LowerTypeTests not preserving .symver symbol versioning directives for
exported functions. Emit symver information to ThinLTO summary data and
then propagate symver directives for exported functions to the merged
module.
Emitting symver information to the summaries increases the size of
intermediate build artifacts for a Chromium build by less than 0.2%.
Reviewers: pcc
Reviewed By: pcc
Subscribers: tejohnson, mehdi_amini, eraman, llvm-commits, eugenis, kcc
Differential Revision: https://reviews.llvm.org/D45798
llvm-svn: 330387
Rafael Espindola [Fri, 20 Apr 2018 01:21:24 +0000 (01:21 +0000)]
Fix trap instruction on pp64.
The test was passing on a big endian host, but just because od with x4
was compensating for it.
llvm-svn: 330386
Davide Italiano [Fri, 20 Apr 2018 00:44:33 +0000 (00:44 +0000)]
[DWARFASTParserClang] Remove dead code. NFCI.
llvm-svn: 330385
Amara Emerson [Fri, 20 Apr 2018 00:42:46 +0000 (00:42 +0000)]
Move a dump() implementation out of line.
Fixes some link issues.
llvm-svn: 330384
Petr Hosek [Fri, 20 Apr 2018 00:41:06 +0000 (00:41 +0000)]
[Fuzzer] Add a missing header in Fuchsia implementation
This is needed for fd_set.
Differential Revision: https://reviews.llvm.org/D45852
llvm-svn: 330383
Artem Dergachev [Thu, 19 Apr 2018 23:30:15 +0000 (23:30 +0000)]
[CFG] [analyzer] Add construction contexts for loop condition variables.
Loop condition variables, eg.
while (shared_ptr<int> P = getIntPtr()) { ... })
weren't handled in r324794 because they don't go through the common
CFGBuilder::VisitDeclStmt method. Which means that they regressed
after r324800.
Fix the regression by duplicating the necessary construction context scan in
the loop visiting code.
Differential Revision: https://reviews.llvm.org/D45706
llvm-svn: 330382
Artem Dergachev [Thu, 19 Apr 2018 23:24:32 +0000 (23:24 +0000)]
[analyzer] When we fail to evaluate a pointer cast, escape the pointer.
If a pointer cast fails (evaluates to an UnknownVal, i.e. not implemented in the
analyzer) and such cast is in fact the last use of the pointer, the pointer
symbol is no longer referenced by the program state and a leak is
(mis-)diagnosed.
"Escape" the pointer upon a failed cast, i.e. inform the checker that we can no
longer reliably track it.
Differential Revision: https://reviews.llvm.org/D45698
llvm-svn: 330380
Fangrui Song [Thu, 19 Apr 2018 23:23:23 +0000 (23:23 +0000)]
[ELF] Increase NextGroupId with --end-group
Reviewers: ruiu, espindola
Subscribers: emaste, arichardson, llvm-commits
Differential Revision: https://reviews.llvm.org/D45846
llvm-svn: 330379
Saleem Abdulrasool [Thu, 19 Apr 2018 23:14:57 +0000 (23:14 +0000)]
Implement proper support for `-falign-functions`
This implements support for the previously ignored flag
`-falign-functions`. This allows the frontend to request alignment on
function definitions in the translation unit where they are not
explicitly requested in code. This is compatible with the GCC behaviour
and the ICC behaviour.
The scalar value passed to `-falign-functions` aligns functions to a
power-of-two boundary. If flag is used, the functions are aligned to
16-byte boundaries. If the scalar is specified, it must be an integer
less than or equal to 4096. If the value is not a power-of-two, the
driver will round it up to the nearest power of two.
llvm-svn: 330378
Artem Dergachev [Thu, 19 Apr 2018 23:09:22 +0000 (23:09 +0000)]
[CFG] [analyzer] Don't treat argument constructors as temporary constructors.
Function argument constructors (that are used for passing objects into functions
by value) are completely unlike temporary object constructors, but we were
treating them as such because they are also wrapped into a CXXBindTemporaryExpr.
This patch adds a partial construction context layer for call argument values,
but doesn't proceed to transform it into an actual construction context yet.
This is tells the clients that we aren't supporting these constructors yet.
Differential Revision: https://reviews.llvm.org/D45650
llvm-svn: 330377
Kuba Mracek [Thu, 19 Apr 2018 23:00:43 +0000 (23:00 +0000)]
[sanitizer] Generalize atomic_uint8_t, atomic_uint16_t, ... into a template. NFC.
Differential Revision: https://reviews.llvm.org/D44246
llvm-svn: 330376
Artem Dergachev [Thu, 19 Apr 2018 23:00:22 +0000 (23:00 +0000)]
[analyzer] RetainCount: Accept more "safe" CFRetain wrappers.
r315736 added support for the misplaced CF_RETURNS_RETAINED annotation on
CFRetain() wrappers. It works by trusting the function's name (seeing if it
confirms to the CoreFoundation naming convention) rather than the annotation.
There are more false positives caused by users using a different naming
convention, namely starting the function name with "retain" or "release"
rather than suffixing it with "retain" or "release" respectively.
Because this isn't according to the naming convention, these functions
are usually inlined and the annotation is therefore ignored, which is correct.
But sometimes we run out of inlining stack depth and the function is
evaluated conservatively and then the annotation is trusted.
Add support for the "alternative" naming convention and test the situation when
we're running out of inlining stack depth.
rdar://problem/
18270122
Differential Revision: https://reviews.llvm.org/D45117
llvm-svn: 330375
Sam Clegg [Thu, 19 Apr 2018 22:48:03 +0000 (22:48 +0000)]
[WebAssembly] Fix bug where reloc addends were written as unsigned
Relocation addends can be negative so should be written as
signed LEBs. This bug meant that writing value between 64
and 128 would be incorrectly interpreted as negative by the
object file readers.
Differential Revision: https://reviews.llvm.org/D45825
llvm-svn: 330374
Jessica Paquette [Thu, 19 Apr 2018 22:17:07 +0000 (22:17 +0000)]
[MachineOutliner] NFC: Move EnableLinkOnceODROutlining into MachineOutliner.cpp
This moves the EnableLinkOnceODROutlining flag from TargetPassConfig.cpp into
MachineOutliner.cpp. It also removes OutlineFromLinkOnceODRs from the
MachineOutliner constructor. This is now handled by the moved command-line
flag.
llvm-svn: 330373
Reid Kleckner [Thu, 19 Apr 2018 22:12:10 +0000 (22:12 +0000)]
Don't do aligned allocations on MSVCRT before 19.12 (update 15.3)
Reviewers: EricWF, pcc
Subscribers: christof, cfe-commits
Differential Revision: https://reviews.llvm.org/D45836
llvm-svn: 330372
Simon Pilgrim [Thu, 19 Apr 2018 22:11:58 +0000 (22:11 +0000)]
[llvm-mca][X86] Add prefetch instruction resource tests
llvm-svn: 330371
Sam Clegg [Thu, 19 Apr 2018 22:00:53 +0000 (22:00 +0000)]
[WebAssembly] Enabled -triple=wasm32-unknown-unknown-wasm path using ELF directive parser.
This is a temporary solution until a proper WASM implementation of
MCAsmParserExtension is in place, but at least for now will unblock this
path.
Added test to make sure this path works with the WASM Assembler.
Patch By Wouter van Oortmerssen!
Differential Revision: https://reviews.llvm.org/D45386
llvm-svn: 330370
Rafael Espindola [Thu, 19 Apr 2018 21:58:28 +0000 (21:58 +0000)]
Add a test. NFC.
We have relatively few tests on the contents of non alloc
sections. This one would have found a bug in a patch I am working on.
llvm-svn: 330369
Sanjay Patel [Thu, 19 Apr 2018 21:56:17 +0000 (21:56 +0000)]
[Reassociate] add baseline tests for binop swapping; NFC
Similar to rL330086, I don't know if we want to do these
transforms here, but we might as well have the tests
here either way to show that this pass is missing
potential functionality (intentionally or not).
llvm-svn: 330368
Peter Collingbourne [Thu, 19 Apr 2018 21:48:37 +0000 (21:48 +0000)]
COFF: Remove OutputSection::getPermissions() and getCharacteristics().
All callers can just access the header directly.
Differential Revision: https://reviews.llvm.org/D45800
llvm-svn: 330367
Simon Pilgrim [Thu, 19 Apr 2018 21:32:22 +0000 (21:32 +0000)]
[llvm-mca][FMA] Add FMA resource tests
llvm-svn: 330366
Stanislav Mekhanoshin [Thu, 19 Apr 2018 21:16:50 +0000 (21:16 +0000)]
[AMDGPU] Use packed literals with zero either lower or hi part
Differential Revision: https://reviews.llvm.org/D45790
llvm-svn: 330365
Gerolf Hoflehner [Thu, 19 Apr 2018 20:48:35 +0000 (20:48 +0000)]
[llvm-objdump] Issue error message when object file cannot be created
llvm-svn: 330364
Craig Topper [Thu, 19 Apr 2018 20:44:15 +0000 (20:44 +0000)]
[X86] Remove non-existant instruction name from X86DisassemblerTables.cpp.
This instruction was removed a long time so we don't need to check for it here.
llvm-svn: 330363
Jin Lin [Thu, 19 Apr 2018 20:29:43 +0000 (20:29 +0000)]
Refine the loop rotation's API
Summary:
The following changes addresses the following two issues.
1) The existing loop rotation pass contains both loop latch simplification and loop rotation. So one flag RotationOnly is added to be passed to the loop rotation pass.
2) The threshold value is initialized with MAX_UINT since the loop rotation utility should not have threshold limit.
Reviewers: dmgreen, efriedma
Reviewed By: efriedma
Differential Revision: https://reviews.llvm.org/D45582
llvm-svn: 330362
Peter Collingbourne [Thu, 19 Apr 2018 20:03:24 +0000 (20:03 +0000)]
COFF: Rename Chunk::getPermissions to getOutputCharacteristics.
In an upcoming change I will need to make a distinction between section
type (code, data, bss) and permissions. The term that I use for both
of these things is "output characteristics".
Differential Revision: https://reviews.llvm.org/D45799
llvm-svn: 330361
Reid Kleckner [Thu, 19 Apr 2018 19:40:12 +0000 (19:40 +0000)]
Remove impossible _MSC_VER check
Summary:
It is immediately preceded by this check:
#if _MSC_VER < 1900
#error "MSVC versions prior to Visual Studio 2015 are not supported"
#endif
Reviewers: EricWF
Subscribers: christof, cfe-commits
Differential Revision: https://reviews.llvm.org/D45829
llvm-svn: 330360
Lang Hames [Thu, 19 Apr 2018 19:30:35 +0000 (19:30 +0000)]
[ORC] Fix an assertion condition from r329934.
Thanks to Alexander Ivchenko for finding the issue!
llvm-svn: 330359
Craig Topper [Thu, 19 Apr 2018 19:25:24 +0000 (19:25 +0000)]
[X86] Enable popcnt false dependency breaking on Silvermont and Goldmont.
Silvermont and Goldmont have the same issue on popcnt as Sandy Bridge, Haswell, Broadwell, and Skylake. Believe it is fixed in Goldmont Plus.
llvm-svn: 330358
Chandler Carruth [Thu, 19 Apr 2018 18:44:25 +0000 (18:44 +0000)]
[PM/LoopUnswitch] Detect irreducible control flow within loops and skip unswitching non-trivial edges.
Summary:
This fixes the bug pointed out in review with non-trivial unswitching.
This also provides a basis that should make it pretty easy to finish
fleshing out a routine to scan an entire function body for irreducible
control flow, but this patch remains minimal for disabling loop
unswitch.
Reviewers: sanjoy, fedor.sergeev
Subscribers: mcrosier, hiraditya, llvm-commits
Differential Revision: https://reviews.llvm.org/D45754
llvm-svn: 330357
Lang Hames [Thu, 19 Apr 2018 18:42:49 +0000 (18:42 +0000)]
[ORC] Make VSO symbol resolution/finalization operations private.
This forces these operations to be carried out via a
MaterializationResponsibility instance, ensuring responsibility is explicitly
tracked.
llvm-svn: 330356
Kostya Kortchinsky [Thu, 19 Apr 2018 18:38:15 +0000 (18:38 +0000)]
[sanitizer] Minor refactor of some ReservedAddressRange functions
Summary:
Some of the functions had spurious conditional statements and checks, and some
intermediary variables that I feel made the code more complicated than it needs
to be. Also, when unmapping the whole range, the range size would be 0, but
the base was set to the address of the end of the range, which sounds prone to
error. I think nulling out the base in this scenario is a better way to go.
Reviewers: alekseyshl, flowerhack
Reviewed By: alekseyshl
Subscribers: kubamracek, delcypher, #sanitizers, llvm-commits
Differential Revision: https://reviews.llvm.org/D45775
llvm-svn: 330355
Adrian McCarthy [Thu, 19 Apr 2018 18:31:57 +0000 (18:31 +0000)]
Fix narrowing warning by appending `f` to literal constant.
llvm-svn: 330354
David Zarzycki [Thu, 19 Apr 2018 18:19:02 +0000 (18:19 +0000)]
[UnitTests] NFC/build-perf: Break up nontrivial compile jobs
RecursiveASTVisitorTest.cpp is one of the longest compile jobs and a
build bottleneck on many-core machines. This patch breaks that file and
some peer files up into smaller files to increase build concurrency and
overall rebuild performance.
llvm-svn: 330353
Simon Pilgrim [Thu, 19 Apr 2018 18:08:10 +0000 (18:08 +0000)]
[llvm-mca][X86] Add resource test for every out-of-order scheduler model
I've copied and regenerated a resource file from btver2 to every x86 scheduler model supported by llvm-mca so we have at least some basic coverage.
For most this has been the avx1 tests, but for silvermont I've used sse42 as thats the latest it supports.
More will be added later.
llvm-svn: 330352
Simon Pilgrim [Thu, 19 Apr 2018 18:01:52 +0000 (18:01 +0000)]
[X86][SLM] Fix typo using SandyBridge resources.
Luckily this was on instructions not supported on Silvermont....
llvm-svn: 330351
Rafael Espindola [Thu, 19 Apr 2018 18:00:46 +0000 (18:00 +0000)]
Define InputSection::getOffset inline.
This is much simpler than the other section types and there are many
places where the section type is statically know.
llvm-svn: 330350
Craig Topper [Thu, 19 Apr 2018 18:00:17 +0000 (18:00 +0000)]
[X86] Correct the scheduling data for register forms of XCHG and XADD on Intel CPUs.
The XCHG16rr/XCHG32rr/XCHG64rr instructions should be 3 uops just like XCHG8rr. I believe they're just implemented as 3 move uops with a temporary register.
XADD is probably 2 moves and an add also using a temporary register.
Change the latency for both from 2 cycles to 3 cycles. Only 2 of the uops are serialized in their execution, the move into the temporary and the move out of the temporary. The move from one GPR to the other should be able to go in parallel with this if there are ALU resources available.
llvm-svn: 330349
Sanjay Patel [Thu, 19 Apr 2018 17:56:36 +0000 (17:56 +0000)]
[Reassociate] fix formatting; NFC
llvm-svn: 330348
Simon Pilgrim [Thu, 19 Apr 2018 17:32:10 +0000 (17:32 +0000)]
[X86] Merge some MMX instregex
There's a lot more but I'd prefer focussing on removing unnecessary InstRWs first.
llvm-svn: 330347
Rafael Espindola [Thu, 19 Apr 2018 17:26:50 +0000 (17:26 +0000)]
Simplify Repl handling.
Now that we don't ICF synthetic sections, we can go back to the old
logic on whose responsibility it is to check Repl.
The idea is that Sec->something() will not check Repl. It is the
responsibility of the caller to find the correct Sec.
llvm-svn: 330346
Krzysztof Parzyszek [Thu, 19 Apr 2018 17:26:46 +0000 (17:26 +0000)]
[if-converter] Handle BBs that terminate in ret during diamond conversion
This fixes https://llvm.org/PR36825.
Original patch by Valentin Churavy (D45218).
Differential Revision: https://reviews.llvm.org/D45731
llvm-svn: 330345
Krzysztof Parzyszek [Thu, 19 Apr 2018 17:11:58 +0000 (17:11 +0000)]
[Hexagon] Use legal types when lowering CONCAT_VECTORS via BUILD_VECTOR
llvm-svn: 330344
Francis Visoiu Mistrih [Thu, 19 Apr 2018 17:05:03 +0000 (17:05 +0000)]
[llvm-objdump] Remove test object file
Forgot to remove it from the previous commit.
llvm-svn: 330343
Francis Visoiu Mistrih [Thu, 19 Apr 2018 17:02:57 +0000 (17:02 +0000)]
[llvm-objdump] Print "..." instead of random data for virtual sections
When disassembling with -D, skip virtual sections by printing "..." for
each symbol.
This patch also implements `MachOObjectFile::isSectionVirtual`.
Test case comes from:
```
.zerofill __DATA,__common,_data64unsigned,472,3
```
Differential Revision: https://reviews.llvm.org/D45824
llvm-svn: 330342
Teresa Johnson [Thu, 19 Apr 2018 16:55:13 +0000 (16:55 +0000)]
[gold/ThinLTO] Invoke llvm_shutdown when exiting after ThinLTO indexing
Summary:
Instead of manually invoking PrintStatistics, simply invoke
llvm_shutdown which will take care of destroying managed statics, and as
a side effect will destroy the StatisticInfo ManagedStatic, invoking
PrintStatistics when needed.
Reviewers: fhahn
Subscribers: inglorion, llvm-commits
Differential Revision: https://reviews.llvm.org/D45820
llvm-svn: 330341
Rafael Espindola [Thu, 19 Apr 2018 16:54:30 +0000 (16:54 +0000)]
Simplify getOffset for synthetic sections.
We had a single symbol using -1 with a synthetic section. It is
simpler to just update its value.
This is not a big will by itself, but will allow having a simple
getOffset for InputSeciton.
llvm-svn: 330340
Rafael Espindola [Thu, 19 Apr 2018 16:05:07 +0000 (16:05 +0000)]
Rename MergeInputSection::getOffset.
Unlike the getOffset in the base class, this one computes the offset
in the parent synthetic section, not the final output section.
llvm-svn: 330339
Steven Wu [Thu, 19 Apr 2018 15:46:43 +0000 (15:46 +0000)]
[CXX] Templates specialization visibility can be wrong
Summary:
Under some conditions, LinkageComputer can get the visibility for
ClassTemplateSpecializationDecl wrong because it failed to find the Decl
that has the explicit visibility.
This fixes:
llvm.org/bugs/pr36810
rdar://problem/
38080953
Reviewers: rsmith, arphaman, doug.gregor
Reviewed By: doug.gregor
Subscribers: doug.gregor, cfe-commits
Differential Revision: https://reviews.llvm.org/D44670
llvm-svn: 330338