Commit Graph

264445 Commits

Author SHA1 Message Date
Saleem Abdulrasool d1c2302fc5 cxa_demangle: fix -Wimplicit-fallthrough for GCC:7
Use the C++11 (formalised in C++17) tag to indicate a fallthrough in the
switch case.  Silences a -Wimplicit-fallthrough warning with gcc:7

llvm-svn: 305173
2017-06-11 22:57:31 +00:00
Saleem Abdulrasool 52bb919615 private_typeinfo: add missing field initializers
Cleanup the -Wmissing-field-initializers warnings from gcc:7 builds.
NFC.

llvm-svn: 305172
2017-06-11 22:57:26 +00:00
Sanjay Patel dcbfbb11d9 [x86] use vperm2f128 rather than vinsertf128 when there's a chance to fold a 32-byte load
I was looking closer at the x86 test diffs in D33866, and the first change seems like it 
shouldn't happen in the first place. So this patch will resolve that.

Using Agner's tables and AMD docs, vperm2f128 and vinsertf128 have identical timing for 
any given CPU model, so we should be able to interchange those without affecting perf. 
But as we can see in some of the diffs here, using vperm2f128 allows load folding, so 
we should take that opportunity to reduce code size and register pressure.

A secondary advantage is making AVX1 and AVX2 codegen more similar. Given that vperm2f128 
was introduced with AVX1, we should be selecting it in all of the same situations that we 
would with AVX2. If there's some reason that an AVX1 CPU would not want to use this 
instruction, that should be fixed up in a later pass.

Differential Revision: https://reviews.llvm.org/D33938

llvm-svn: 305171
2017-06-11 21:18:58 +00:00
Xinliang David Li 7ed6cd32ea [PartialInlining] Support shrinkwrap life_range markers
Differential Revision: http://reviews.llvm.org/D33847

llvm-svn: 305170
2017-06-11 20:46:05 +00:00
John McCall cb731548fa Don't crash when forming a destructor name on an incomplete type.
Fixes PR25156.

Patch by Don Hinton!

llvm-svn: 305169
2017-06-11 20:33:00 +00:00
Francis Ricci dcfc0413ab [ADT] Use LLVM_ATTRIBUTE_USED instead of __attribute__ for unit test
llvm-svn: 305168
2017-06-11 19:28:21 +00:00
Saleem Abdulrasool 617034da8f test: attempt to repair build bots
Split the no-ias tests and give them a target to ensure that they go
down the GNU toolchain path.  Adjust the no compression support tests.

llvm-svn: 305167
2017-06-11 18:55:17 +00:00
Francis Ricci a5b6157297 [ADT] Suppress unused attribute warning in unit test
llvm-svn: 305166
2017-06-11 18:52:25 +00:00
Saleem Abdulrasool 7289ba9165 Driver: add support for `-gz` and `-gz=`
These options control the behaviour of the compression of debug info
sections on ELF targets.  Our behaviour slightly diverges from the
behaviour of GCC.  `-gz` maps to the `-compress-debug-sections` rather
than `-compress-debug-sections=zlib` or
`-compress-debug-sections=zlib-gnu`.  This small divergence allows us to
be compatible across versions of binutils (=zlib support was introduced
in 2.26, while earlier versions only support =zlib-gnu).  This also
allows users to not have to worry about the version of the assembler
they may be using if they are not using the IAS.  Previously, users
would have had to go through the internal option
`-compress-debug-sectionss` and pass that through to the assembler,
which is no longer needed.

llvm-svn: 305165
2017-06-11 17:49:23 +00:00
Saleem Abdulrasool d3ba0ac2a5 Driver: pass along [-]-[no]compress-debug-sections unfiltered
Rather than validating the flags, pass them through without any
validation.  Arguments passed via -Wa or -Xassembler are passed directly
to the assembler without validation.  The validation was previously
required since we did not provide proper driver level support for
controlling the debug compression on ELF targets.  A subsequent change
will add support for the `-gz` and `-gz=` flags which provide proper
driver level control of the ELF compressed debug sections.

llvm-svn: 305164
2017-06-11 17:49:17 +00:00
Simon Pilgrim 516938452f Fix unused variable warning on non-debug EXPENSIVE_CHECKS builds
llvm-svn: 305163
2017-06-11 12:49:29 +00:00
Amaury Sechet 2127452ff7 [DAGCombine] Make sure we check the ResNo from UADDO before combining
Summary: UADDO has 2 result, and one must check the result no before doing any kind of combine. Without it, the transform is invalid.

Reviewers: joerg

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D34088

llvm-svn: 305162
2017-06-11 11:36:38 +00:00
Tobias Grosser 0b103d92c1 [isl-cpp] Remove isl/mat.h and add insert_partial_schedule
The isl/mat.h functionality was incomplete (we returned 'void *' instead of
'isl::mat') and is likely not needed.

*.insert_partial_schedule was until know not exported in the bindings, but will
be needed in the next step.

llvm-svn: 305161
2017-06-11 04:39:21 +00:00
Davide Italiano 83122058cf [MemorySSA] preservesAll() implies preserves<MemorySSA>(). NFCI.
llvm-svn: 305160
2017-06-11 01:05:45 +00:00
NAKAMURA Takumi 000658f071 TableGen.cmake: Try to fix build breakage introduce in r305142.
LLVM_TABLEGEN_TARGET is undefined in clang standalone build.
STREQUAL cannot omit LHS. Then I saw an error;

  CMake Error at /path/to/install/llvm/lib/cmake/llvm/TableGen.cmake:40 (if):
      if given arguments:
        "STREQUAL" "/path/to/install/llvm/bin/llvm-tblgen.exe"
      Unknown arguments specified

llvm-svn: 305159
2017-06-11 00:57:30 +00:00
Davide Italiano d87d9e906b [SmallVector] Reinstate the typedefs.
They're unused with recent versions of libstdc++ but older ones
(e.g. libstdc++ 4.9 still requires them). Maybe we should bump
the requirements on the minimum version to make GCC 7 happy, but
in the meanwhile we need to live with the warning.

llvm-svn: 305158
2017-06-10 23:18:32 +00:00
Davide Italiano 77485bc89b [SmallVector] Remove unused typedefs, spotted by GCC 7. NFCI.
llvm-svn: 305157
2017-06-10 23:00:23 +00:00
Rafael Espindola 7ff9329b7c Move clearOutputSections before createPhdrs. NFC.
llvm-svn: 305156
2017-06-10 22:12:32 +00:00
Brian Gesiak 701386d531 [opt-viewer] Include default values in help output
Summary:
Python's argparse module includes a `%(default)s` format specifier that
can be used to print the default value of an option in its help text.
Use this for opt-viewer utilities' `--jobs` arguments.

Reviewers: anemet

Reviewed By: anemet

Subscribers: llvm-commits, fhahn

Differential Revision: https://reviews.llvm.org/D34081

llvm-svn: 305155
2017-06-10 21:33:27 +00:00
Simon Pilgrim 8622f51e94 [X86][SSE] Extended PR32368 to SSE/AVX1/AVX2
llvm-svn: 305154
2017-06-10 21:13:01 +00:00
Simon Pilgrim 46619359db [X86][AVX512] Added test case for PR32368
llvm-svn: 305153
2017-06-10 20:58:43 +00:00
David Blaikie a91885a08c dwarfdump: Handle relocs to zlib (.zdebug*) compressed sections
llvm-svn: 305152
2017-06-10 19:32:50 +00:00
Simon Pilgrim 448c2290f1 [X86][SLM] Add SLM arithmetic vectorization tests
As discussed on D33983, as SLM has so many custom costs its worth testing as well.

llvm-svn: 305151
2017-06-10 19:16:09 +00:00
Galina Kistanova b644814c28 Break seems serve better here.
llvm-svn: 305150
2017-06-10 18:26:19 +00:00
Vedant Kumar c6e9e3007b Fix a ubsan failure introduced by r305092
lib/Object/WindowsResource.cpp:578:3: runtime error: store to
misaligned address 0x7fa09aedebbe for type 'unsigned int', which
requires 4 byte alignment
0x7fa09aedebbe: note: pointer points here
00 00 03 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00  00 00
            ^

llvm-svn: 305149
2017-06-10 18:07:24 +00:00
Roman Lebedev 5806d9f205 Revert "[clang] Implement -Wcast-qual for C++"
Breaks -Werror builders.

llvm-svn: 305148
2017-06-10 17:49:23 +00:00
Roman Lebedev b0120740c4 [clang] Implement -Wcast-qual for C++
Summary:
This way, the behavior of that warning flag
more closely resembles that of GCC.

Do note that there is at least one false-negative (see FIXME in tests).

Fixes PR4802.

Testing:
```
ninja check-clang-sema check-clang-semacxx
```

Reviewers: dblaikie, majnemer, rnk

Reviewed By: dblaikie, rnk

Subscribers: cfe-commits, alexfh, rnk

Differential Revision: https://reviews.llvm.org/D33102

llvm-svn: 305147
2017-06-10 17:19:19 +00:00
Geoff Berry 3cca1da20c [EarlyCSE] Add option to use MemorySSA for function simplification run of EarlyCSE (off by default).
Summary:
Use MemorySSA for memory dependency checking in the EarlyCSE pass at the
start of the function simplification portion of the pipeline.  We rely
on the fact that GVNHoist runs just after this pass of EarlyCSE to
amortize the MemorySSA construction cost since GVNHoist uses MemorySSA
and EarlyCSE preserves it.

This is turned off by default.  A follow-up change will turn it on to
allow for easier reversion in case it breaks something.

llvm-svn: 305146
2017-06-10 15:20:03 +00:00
Galina Kistanova 0c10465a57 Added LLVM_FALLTHROUGH to address warning: this statement may fall through. NFC.
llvm-svn: 305145
2017-06-10 08:06:17 +00:00
Galina Kistanova cc29dbfc62 Added llvm_unreachable to address warning: this statement may fall through. NFC.
llvm-svn: 305144
2017-06-10 08:04:51 +00:00
Galina Kistanova 038f9854ec Added llvm_unreachable as ReportError cannot be specified as noreturn.
llvm-svn: 305143
2017-06-10 07:50:14 +00:00
Galina Kistanova aeae905f71 Added dependency on the TableGen executable file.
For the case when LLVM_OPTIMIZED_TABLEGEN is ON (enables LLVM_USE_HOST_TOOLS),
we need both _TABLEGEN_TARGET and _TABLEGEN_EXE in the  DEPENDS list
to have .inc files rebuilt on a tablegen change, as cmake does not propagate
file-level dependencies of custom targets.

We could always have just one dependency on both the target and
the file, but the 2 cases would produce cleaner cmake files.

llvm-svn: 305142
2017-06-10 07:48:49 +00:00
Craig Topper 900012b39d [IR] Remove stale comment from HungoffOperandTraits. NFC
llvm-svn: 305141
2017-06-10 06:58:26 +00:00
Craig Topper 3d4a6c2bd8 [IR] Delete operator new(size_t, unsigned) for ShuffleVector making it consistent with other instructions that declare another operator new with a different signature. NFC
llvm-svn: 305140
2017-06-10 06:58:24 +00:00
Craig Topper 64f354553d [IR] Put a comment back on a function it belongs to. NFC
Looks like the function was moved to a different part of the class in December, but the comment didn't move with it.

llvm-svn: 305139
2017-06-10 06:58:22 +00:00
Craig Topper 4cb94e7831 [IR] Remove unnecessary override of operator new in ExtractValueInst. It's already inherited from UnaryInstruction. NFC
llvm-svn: 305138
2017-06-10 06:58:19 +00:00
Wei Ding 7c3e5115a5 AMDGPU : Fix ISA Version Definitions.
Differential Revision: http://reviews.llvm.org/D28531

llvm-svn: 305137
2017-06-10 03:53:19 +00:00
Marshall Clow e948ba1cd1 Implement the non-parallel versions of exclusive_scan and transform_exclusive_scan. Reviewed as https://reviews.llvm.org/D34038.
llvm-svn: 305136
2017-06-10 02:22:13 +00:00
Rafael Espindola 07c8741644 Relax the overflow checking of R_386_PC16.
Currently the freebsd early boot code fails to link. The issue reduces
to 16 bit code at position 0x7000 wanting to jump to position
0x9000. That is represented in the .o file as a relocation with no
symbol and an addend of 0x9000 - 2 (The -2 is because i386 uses the ip
after the current instruction for jumps).

If the addend is interpreted as signed (it should), it is -28674. In a
32 bit architecture, that is the address 0xffff8ffe. To get there from
0x7000 we have to add 4294909950 (too big) or subtract 57346 (too
small). We then produce an error.

What lld is missing is the fact that at runtime this will actually be
a 16 bit architecture and adding 0x1ffe produces 0x8ffe which is the
correct result in 16 bits (-28674).

Since we have a 16 bit addend and a 16 bit PC, the relocation can move
the PC to any 16 bit address and that is the only thing we really need
to check: if the address we are pointing to fits in 16 bits. This is
unfortunately hard to do since we have to delay subtracting the PC and
if we want to do that outside of Target.cpp, we have to move the
overflow check out too.  An incomplete patch that tries to do that is
at https://reviews.llvm.org/D34070

This patch instead just relaxes the check. Since the value we have is
the destination minus the PC and the PC is 16 bits, it should fit in
17 bits if the destination fits in 16 too.

bfd had a similar issue for some time and got a similar fix:
https://sourceware.org/ml/binutils/2005-08/msg00001.html

llvm-svn: 305135
2017-06-10 01:56:58 +00:00
Rui Ueyama 1c837b5fb1 [ICF] Ignore SHF_GROUP flag when comparing two sections.
SHF_GROUP bit doesn't make sense in executables or DSOs, so linkers are
expected to remove that bit from section flags. We did that when we create
output sections.

This patch is to do that earlier than before. Now the flag is dropped when
we instantiate input section objects.

This change improves ICF. Previously, two sections that differ only in
SHF_GROUP flag were not merged, because when the control reached ICF,
the flag was still there. Now the flag is dropped before reaching to ICF,
so the difference is ignored naturally.

This issue was found by pcc.

Differential Revision: https://reviews.llvm.org/D34074

llvm-svn: 305134
2017-06-10 00:38:55 +00:00
Vedant Kumar c7672d66ba Mark a sancov test as unsupported on x86_64h-darwin
Failing bot: http://lab.llvm.org:8080/green/job/clang-stage1-cmake-RA-expensive/6891

llvm-svn: 305133
2017-06-10 00:12:11 +00:00
Andrew Kaylor 647025f9e1 [InstSimplify] Don't constant fold or DCE calls that are marked nobuiltin
Differential Revision: https://reviews.llvm.org/D33737

llvm-svn: 305132
2017-06-09 23:18:11 +00:00
Sanjay Patel dd96270472 [PowerPC] add memcmp test with one constant operand and equality cmp; NFC
llvm-svn: 305131
2017-06-09 23:15:14 +00:00
Richard Trieu be5cb93088 Revert r305110 to fix buildbot
llvm-svn: 305130
2017-06-09 23:03:40 +00:00
Sanjay Patel 2843cad435 [CGP] add a reference to DataLayout in MemCmpExpansion; NFCI
We're currently passing endian-ness around as a param (and not uniformly),
so this eliminates the need for that. I'd like to add a constant fold
call too, and that requires a DL.

llvm-svn: 305129
2017-06-09 23:01:05 +00:00
Erich Keane 3cf69bce69 Support operator keywords used in Windows SDK(fix ubsan)
UBSan found an issue with a nullptr being assigned to a reference.
This was because a following function went back and checked the 
identifier in the CPPOperatorName case.  This patch corrects that
location with the original logic as well.

llvm-svn: 305128
2017-06-09 22:50:02 +00:00
I-Jui (Ray) Sung 21fde385fa [AArch64] Add fallback in FastISel fp16 conversions
Summary:
- Fix assertion failures on F16 to/from int types in FastISel by falling
  back to regular ISel
- Add a testcase of various conversion cases with FastISel (-O0)

Reviewers: kristof.beyls, jmolloy, SjoerdMeijer

Reviewed By: SjoerdMeijer

Subscribers: SjoerdMeijer, llvm-commits, srhines, pirama, aemerson, rengolin, javed.absar, kristof.beyls

Differential Revision: https://reviews.llvm.org/D33734

llvm-svn: 305127
2017-06-09 22:40:50 +00:00
Richard Smith 01e4a7f29b 27037: Use correct CVR qualifier on an upcast on method pointer call
Patch by Taiju Tsuiki!

Differential Revision: https://reviews.llvm.org/D33875

llvm-svn: 305126
2017-06-09 22:25:28 +00:00
Vassil Vassilev c4c33ce097 [clang-tidy] D33930: Do not pick up by default the LLVM style if passing -format.
This adds a new flag -style which is passed to clang-apply-replacements and
defaults to file meaning it would pick up the closest .clang-format file in tree.

llvm-svn: 305125
2017-06-09 22:23:03 +00:00
Alexander Shaposhnikov f3e877017b [clang] Cleanup fixit.c
This diff removes temporary file t2 in fixit.c and updates the test command accordingly.
NFC.

Test plan:
make check-all

Differential revision: https://reviews.llvm.org/D34066

llvm-svn: 305124
2017-06-09 22:20:52 +00:00