Commit Graph

270333 Commits

Author SHA1 Message Date
Matt Arsenault d664315ae8 IPRA: Don't assume called function is first call operand
Fixes not finding the called global for AMDGPU
call pseudoinstructions, which prevented IPRA
from doing much.

llvm-svn: 311637
2017-08-24 07:55:15 +00:00
Matt Arsenault 00459e4a06 IPRA: Exit early on functions without calls
llvm-svn: 311636
2017-08-24 07:55:13 +00:00
Sjoerd Meijer 046a969360 [AArch64] fix for fcos and frem f16 promotion
Fix for copy-paste mistake in r311154; setOperationAction for fcos and frem f16
operands appeared twice (and it should be set to 'promote').

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

llvm-svn: 311635
2017-08-24 07:43:52 +00:00
Chandler Carruth dc2556934c [x86] NFC: Clean up two tests and generate precise checks for them.
Mostly this involved giving unnamed values names and running the IR
through `opt` to re-format it but merging in any important comments in
the original. I then deleted pointless comments and inlined the function
attributes for ease of reading and editting.

All of this is to make it much easier to see the instructions being
generated here and evaluate any updates to the tests.

llvm-svn: 311634
2017-08-24 07:38:36 +00:00
Igor Breger 47be5fbbe9 [GlobalISel][X86] Support G_IMPLICIT_DEF.
Summary: Support G_IMPLICIT_DEF.

Reviewers: zvi, guyblank, t.p.northover

Reviewed By: guyblank

Subscribers: rovka, llvm-commits, kristof.beyls

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

llvm-svn: 311633
2017-08-24 07:06:27 +00:00
Lang Hames cbe694be03 [docs] In the CMake primer, correct the description of the ARGV/ARGN variables.
ARGN is the sublist of unnamed arguments, not the count of the arguments.

llvm-svn: 311632
2017-08-24 05:38:39 +00:00
Lang Hames 7febf2baff [Support] Rewrite handleAllErrors in terms of cantFail.
This just switches handleAllErrors from using custom assertions that all errors
have been handled to using cantFail. This change involves moving some of the
class and function definitions around though.

llvm-svn: 311631
2017-08-24 05:35:27 +00:00
Wei Ding a131d3fb29 Add ‘llvm.experimental.constrained.fma‘ Intrinsic.
Differential Revision: http://reviews.llvm.org/D36335

llvm-svn: 311629
2017-08-24 04:18:24 +00:00
Adam Nemet 0ada0d5b21 Support all integer types in DiagnosticInfoOptimizationBase::Argument
We were missing size_t (unsigned long) on macOS.

llvm-svn: 311628
2017-08-24 04:04:49 +00:00
Jason Molenda 9ff294f039 Change the ftag x87 register from being 8-bits wide to 16-bits wide
to match the changes Saleem Abdulrasool committed in r311579.  Fixes
a testsuite failure now that the testsuite expects a 16 bit return
value for thsi reg.

llvm-svn: 311627
2017-08-24 03:22:08 +00:00
Daniel Berlin f948603a15 NewGVN: We weren't properly simplifying selects with equal arguments due to a thinko.
llvm-svn: 311626
2017-08-24 02:43:17 +00:00
Eric Beckmann b85172f6ff Fix bug 34051 by handling empty .res files gracefully.
Summary:
Previously, llvm-cvtres crashes on .res files which are empty except for
the null header.  This allows the library to simply pass over them.

Subscribers: llvm-commits, hiraditya

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

llvm-svn: 311625
2017-08-24 02:36:50 +00:00
Leo Li 23bb21cb92 [Driver] Register effective triple before get arm float abi.
Summary:
We need to register effective triple before calling `getARMFloatABI`.
Add missing code when `--print-libgcc-file-name` is passed.

Reviewers: atanasyan, rsmith, mgorny, peter.smith, kristof.beyls, compnerd, jroelofs

Reviewed By: compnerd

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

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

llvm-svn: 311624
2017-08-24 01:51:51 +00:00
Hans Wennborg c39ec95d88 [DAG] Fix Node Replacement in PromoteIntBinOp
When one operand is a user of another in a promoted binary operation
we may replace and delete the returned value before returning
triggering an assertion. Reorder node replacements to prevent this.

Fixes PR34137.

Landing on behalf of Nirav.

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

llvm-svn: 311623
2017-08-24 01:08:27 +00:00
Jason Molenda c064881a36 When parsing the DBGSourcePathRemapping plist entries
in a dSYM, and it's a version 2 DBGSourcePathRemapping,
in addition to the build/source paths specified, add 
build/source paths with the last two filename components
removed.  This more generic remapping can sometimes
help lldb to find the correct source file in complex
projects.
<rdar://problem/33973545> 

llvm-svn: 311622
2017-08-24 00:58:14 +00:00
George Karpenkov 8d15bbb019 Fix ClangFormatFuzzer.
llvm-svn: 311621
2017-08-24 00:30:28 +00:00
Dylan McKay 4f5002198b [AVR] Use the correct register classes for 16-bit atomic operations
llvm-svn: 311620
2017-08-24 00:14:38 +00:00
Andreas Simbuerger e478e2de83 [Polly][WIP] Scalar fully indexed expansion
Summary:
This patch comes directly after https://reviews.llvm.org/D34982 which allows fully indexed expansion of MemoryKind::Array. This patch allows expansion for MemoryKind::Value and MemoryKind::PHI.

MemoryKind::Value seems to be working with no majors modifications of D34982. A test case has been added. Unfortunatly, no "run time" checks can be done for now because as @Meinersbur explains in a comment on D34982, DependenceInfo need to be cleared and reset to take expansion into account in the remaining part of the Polly pipeline. There is no way to do that in Polly for now.

MemoryKind::PHI is not working. Test case is in place, but not working. To expand MemoryKind::Array, we expand first the write and then after the reads. For MemoryKind::PHI, the idea of the current implementation is to exchange the "roles" of the read and write and expand first the read according to its domain and after the writes.
But with this strategy, I still encounter the problem of union_map in new access map.
For example with the following source code (source code of the test case) :

```
void mse(double A[Ni], double B[Nj]) {
  int i,j;
  double tmp = 6;
  for (i = 0; i < Ni; i++) {
    for (int j = 0; j<Nj; j++) {
      tmp = tmp + 2;
    }
    B[i] = tmp;
  }
}
```

Polly gives us the following statements and memory accesses :

```
    Statements {
    	Stmt_for_body
            Domain :=
                { Stmt_for_body[i0] : 0 <= i0 <= 9999 };
            Schedule :=
                { Stmt_for_body[i0] -> [i0, 0, 0] };
            ReadAccess :=	[Reduction Type: NONE] [Scalar: 1]
                { Stmt_for_body[i0] -> MemRef_tmp_04__phi[] };
            MustWriteAccess :=	[Reduction Type: NONE] [Scalar: 1]
                { Stmt_for_body[i0] -> MemRef_tmp_11__phi[] };
            Instructions {
                  %tmp.04 = phi double [ 6.000000e+00, %entry.split ], [ %add.lcssa, %for.end ]
            }
    	Stmt_for_inc
            Domain :=
                { Stmt_for_inc[i0, i1] : 0 <= i0 <= 9999 and 0 <= i1 <= 9999 };
            Schedule :=
                { Stmt_for_inc[i0, i1] -> [i0, 1, i1] };
            MustWriteAccess :=	[Reduction Type: NONE] [Scalar: 1]
                { Stmt_for_inc[i0, i1] -> MemRef_tmp_11__phi[] };
            ReadAccess :=	[Reduction Type: NONE] [Scalar: 1]
                { Stmt_for_inc[i0, i1] -> MemRef_tmp_11__phi[] };
            MustWriteAccess :=	[Reduction Type: NONE] [Scalar: 1]
                { Stmt_for_inc[i0, i1] -> MemRef_add_lcssa__phi[] };
            Instructions {
                  %tmp.11 = phi double [ %tmp.04, %for.body ], [ %add, %for.inc ]
                  %add = fadd double %tmp.11, 2.000000e+00
                  %exitcond = icmp ne i32 %inc, 10000
            }
    	Stmt_for_end
            Domain :=
                { Stmt_for_end[i0] : 0 <= i0 <= 9999 };
            Schedule :=
                { Stmt_for_end[i0] -> [i0, 2, 0] };
            MustWriteAccess :=	[Reduction Type: NONE] [Scalar: 1]
                { Stmt_for_end[i0] -> MemRef_tmp_04__phi[] };
            ReadAccess :=	[Reduction Type: NONE] [Scalar: 1]
                { Stmt_for_end[i0] -> MemRef_add_lcssa__phi[] };
            MustWriteAccess :=	[Reduction Type: NONE] [Scalar: 0]
                { Stmt_for_end[i0] -> MemRef_B[i0] };
            Instructions {
                  %add.lcssa = phi double [ %add, %for.inc ]
                  store double %add.lcssa, double* %arrayidx, align 8
                  %exitcond5 = icmp ne i64 %indvars.iv.next, 10000
            }
    }

```

and the following dependences :
```
{ Stmt_for_inc[i0, 9999] -> Stmt_for_end[i0] : 0 <= i0 <= 9999;
Stmt_for_inc[i0, i1] -> Stmt_for_inc[i0, 1 + i1] : 0 <= i0 <= 9999 and 0 <= i1 <= 9998;
Stmt_for_body[i0] -> Stmt_for_inc[i0, 0] : 0 <= i0 <= 9999;
Stmt_for_end[i0] -> Stmt_for_body[1 + i0] : 0 <= i0 <= 9998 }
```

When trying to expand this memory access :
```
{ Stmt_for_inc[i0, i1] -> MemRef_tmp_11__phi[] };
```

The new access map would look like this :
```
{ Stmt_for_inc[i0, 9999] -> MemRef_tmp_11__phi_exp[i0] : 0 <= i0 <= 9999; Stmt_for_inc[i0, i1] ->MemRef_tmp_11__phi_exp[i0, 1 + i1] : 0 <= i0 <= 9999 and 0 <= i1 <= 9998 }
```

The idea to implement the expansion for PHI access is an idea from @Meinersbur and I don't understand why my implementation does not work. I should have miss something in the understanding of the idea.

Contributed by: Nicolas Bonfante <nicolas.bonfante@gmail.com>

Reviewers: Meinersbur, simbuerg, bollu

Reviewed By: Meinersbur

Subscribers: llvm-commits, pollydev, Meinersbur

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

llvm-svn: 311619
2017-08-24 00:04:45 +00:00
Dehao Chen b2d1de5a7c Add test to cover accurate-sample-profile.
Summary: This patch adds test to cover the logic guarded by "accurate-sample-profile" flag.

Reviewers: davidxl

Reviewed By: davidxl

Subscribers: sanjoy, llvm-commits, eraman

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

llvm-svn: 311618
2017-08-23 23:19:11 +00:00
Saleem Abdulrasool 5a3e50a3e6 ObjC++: decorate ObjC interfaces in MSABI properly
`id` needs to be handled specially since it is a `TypedefType` which is
sugar for an `ObjCObjectPointerType` whose pointee is an
`ObjCObjectType` with base `BuiltinType::ObjCIdType` and no protocols
and the first level of pointer gets it own type implementation.  `Class`
is similar with the `ObjCClassType` as the base instead.

The qualifiers on the base type of the `ObjCObjectType` need to be
dropped because the innermost `mangleType` will handle the qualifiers
itself.

`id` is desugared to `struct objc_object *` which should be encoded as
`PAUobjc_object@@`.  `Class` is desugared to `struct objc_class *` which
should be encoded as `PAUobjc_class@@`.

We were previously applying an extra modifier `A` which will be handled
during the recursive call.

This now properly decorates interface types as well as `Class` and `id`.
This corrects the interactions between C++ and ObjC++ for the type
specifier decoration.

llvm-svn: 311617
2017-08-23 22:38:58 +00:00
Richard Smith 39eca9b95a Fix mangling for dependent "type { expr-list }" expressions, and add mangling for designated initializers matching recent cxx-abi-dev discussion.
llvm-svn: 311612
2017-08-23 22:12:08 +00:00
Tim Northover 4bafa16748 ARM: use internal relocations for local symbols after all.
Switching to external relocations for ARM-mode branches (to allow Thumb
interworking when the offset is unencodable) causes calls to temporary symbols
to be miscompiled and instead go to the parent externally visible symbol.

Calling a temporary never happens in compiled code, but can occasionally in
hand-written assembly.

llvm-svn: 311611
2017-08-23 22:07:10 +00:00
Adrian Prantl 7db6b5e2b3 Retire the llvm.dbg.mir hack after r311594.
llvm-svn: 311610
2017-08-23 22:02:36 +00:00
Aditya Nandakumar 850b983455 Fix Verifier test - add REQUIRES aarch64-registered-target
llvm-svn: 311609
2017-08-23 21:55:36 +00:00
Adrian Prantl 33aa8acb40 Add a Verifier check for DILocation's scopes.
Found via https://bugs.llvm.org/show_bug.cgi?id=33997.

llvm-svn: 311608
2017-08-23 21:52:24 +00:00
Xinliang David Li c7c5303fa3 [Profile] create a copy of profile file name from environment
Original patch by Max Moroz.

Differential Revsion: http://reviews.llvm.org/D36903

llvm-svn: 311607
2017-08-23 21:39:33 +00:00
Jonas Devlieghere a845167dca [WebAssembly] Fix overflow for input with missing version
Differential revision: https://reviews.llvm.org/D37070

llvm-svn: 311605
2017-08-23 21:36:04 +00:00
Rong Xu 15848e5977 [PGO] Set edge weights for indirectbr instruction with profile counts
Current PGO only annotates the edge weight for branch and switch instructions
with profile counts. We should also annotate the indirectbr instruction as
all the information is there. This patch enables the annotating for indirectbr
instructions. Also uses this annotation in branch probability analysis.

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

llvm-svn: 311604
2017-08-23 21:36:02 +00:00
Adrian Prantl 8040a215c9 Fix a bug in CGDebugInfo::EmitInlineFunctionStart causing DILocations to be
parented in function declarations.

Fixes PR33997.
https://bugs.llvm.org/show_bug.cgi?id=33997

llvm-svn: 311601
2017-08-23 21:24:12 +00:00
Geoff Berry 90bef32219 [AArch64][Falkor] Fix bug in Falkor HWPF tag collision avoidance
LDPDi was incorrectly marked as ignoring the destination register in the
prefetcher tag.

llvm-svn: 311599
2017-08-23 21:11:28 +00:00
Pete Couperus ed9569dac8 Test commit.
Fix instrinsic -> intrinsic typo.

llvm-svn: 311598
2017-08-23 20:58:22 +00:00
Aditya Nandakumar efd8a84cd5 [GISEl]: Translate phi into G_PHI
G_PHI has the same semantics as PHI but also has types.
This lets us verify that the types in the G_PHI are consistent.
This also allows specifying legalization actions for G_PHIs.

https://reviews.llvm.org/D36990

llvm-svn: 311596
2017-08-23 20:45:48 +00:00
Reid Kleckner 950567aac4 Attempt to fix the BUILD_SHARED_LIBS build after the DIExpression change
llvm-svn: 311595
2017-08-23 20:39:35 +00:00
Reid Kleckner 6d353348e5 Parse and print DIExpressions inline to ease IR and MIR testing
Summary:
Most DIExpressions are empty or very simple. When they are complex, they
tend to be unique, so checking them inline is reasonable.

This also avoids the need for CodeGen passes to append to the
llvm.dbg.mir named md node.

See also PR22780, for making DIExpression not be an MDNode.

Reviewers: aprantl, dexonsmith, dblaikie

Subscribers: qcolombet, javed.absar, eraman, hiraditya, llvm-commits

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

llvm-svn: 311594
2017-08-23 20:31:27 +00:00
Matt Morehouse c01994b5fe [clang-proto-fuzzer] Fix clang-proto-to-cxx build.
llvm-svn: 311592
2017-08-23 19:58:07 +00:00
Jim Ingham a4bb80b211 Log whether we found a step out plan or not.
llvm-svn: 311590
2017-08-23 19:40:21 +00:00
Richard Smith e3a5e8f03d [ubsan] PR34266: When sanitizing the 'this' value for a member function that happens to be a lambda call operator, use the lambda's 'this' pointer, not the captured enclosing 'this' pointer (if any).
llvm-svn: 311589
2017-08-23 19:39:04 +00:00
Lei Huang 0cb591fc4c Update branch coalescing to be a PowerPC specific pass
Implementing this pass as a PowerPC specific pass.  Branch coalescing utilizes
the analyzeBranch method which currently does not include any implicit operands.
This is not an issue on PPC but must be handled on other targets.

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

llvm-svn: 311588
2017-08-23 19:25:04 +00:00
Sam Clegg 7dbd1fd73b Update comments: parallel_for_each -> parallelForEach
Also remove unused include of raw_ostream.h

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

llvm-svn: 311587
2017-08-23 19:03:20 +00:00
Petr Hosek b93c5b9f7e [ELF] Don't output headers into a segment if there's no space for them
Currently, LLD checks whether there's enough space for headers by
checking if headers fit below the address of the first allocated
section. However, that's always thue if the binary doesn't start
at zero which means that LLD always emits a segment for headers,
even if no other sections belong to that segment.

This is a problem in cases when linker script is being used with a
non-zero start address when we don't want to make the headers visible
by not leaving enough space for them. This pattern is common in
embedded programming but doesn't work in LLD.

This patch changes the behavior of LLD in case when linker script
is being to match the behavior of BFD ld and gold, which is to only
place headers into a segment when they're covered by some output
section.

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

llvm-svn: 311586
2017-08-23 18:44:34 +00:00
Saleem Abdulrasool 5b7cc3600a test: fix missed test
I had built without python bindings and did not find this in the grep
output.  Adjust the test output for the printing format update.

llvm-svn: 311582
2017-08-23 18:05:19 +00:00
Greg Clayton 27bfabaf82 Updated my email address.
llvm-svn: 311581
2017-08-23 18:00:07 +00:00
Benjamin Kramer 3c56b0bb8f [X86] Fix -Wenum-compare warning
lib/Target/X86/X86ISelLowering.cpp:34613:25: error: enumeral mismatch in
conditional expression: 'llvm::ISD::NodeType' vs
'llvm::X86ISD::NodeType'

llvm-svn: 311580
2017-08-23 17:50:46 +00:00
Saleem Abdulrasool bf2a8a2878 Process: fix FXSAVE on x86
The FXSAVE member `ftw` (FPU Tag Word) was given the wrong size (8-bit)
instead of the correct width (16-bit) as per the x87 Programmer's
Manual.  Adjust this to ensure that we print out the complete value for
the register.

llvm-svn: 311579
2017-08-23 17:23:12 +00:00
Saleem Abdulrasool fe3a5bfb25 ObjC: fix some -Wpedantic warnings by removing ';'
Remove some stray ';' that were in the source code.  NFC.

llvm-svn: 311577
2017-08-23 17:00:14 +00:00
Saleem Abdulrasool 65101adb16 Headers: explicitly specify double-word alignment
GCC will interpret `__attribute__((__aligned__))` as 8-byte alignment on
ARM, but clang will not.  Explicitly specify the alignment.  This
mirrors the declaration in libunwind.

llvm-svn: 311576
2017-08-23 16:57:55 +00:00
Johannes Altmanninger 38df0fa640 [clang-diff] Properly clear the selection in HTML diff
Reviewers: arphaman

Subscribers: cfe-commits

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

llvm-svn: 311575
2017-08-23 16:52:15 +00:00
Saleem Abdulrasool f8774f1d73 ARM: explicitly specify the 8-byte alignment
It seems that GCC interprets `__attribute__((__aligned__))` as 8-byte
alignment on ARM, but clang does not.  Explicitly specify the
double-word alignment value to ensure that the structure is properly
aligned.

llvm-svn: 311574
2017-08-23 16:50:27 +00:00
Craig Topper 853a8d9ffc [AVX512] Don't create SHRUNKBLEND SDNodes for 512-bit vectors
There are no 512-bit blend instructions so we shouldn't create SHRUNKBLEND for them.

On a side note, it looks like there may be a missed opportunity for constant folding TESTM when LHS and RHS are equal.

This fixes PR34139.

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

llvm-svn: 311572
2017-08-23 16:41:02 +00:00
Johannes Altmanninger a3c4923a53 [clang-diff] Reformat test, NFC
llvm-svn: 311571
2017-08-23 16:32:35 +00:00