152764 Commits

Author SHA1 Message Date
Nirav Dave
53e7817cd8 [TableGen] AsmMatcher: fix OpIdx computation when HasOptionalOperands is true
Consider the following instruction: "inst.eq $dst, $src" where ".eq"
is an optional flag operand.  The $src and $dst operands are
registers.  If we parse the instruction "inst r0, r1", the flag is not
present and it will be marked in the "OptionalOperandsMask" variable.
After the matching is complete we call the "convertToMCInst" method.

The current implementation works only if the optional operands are at
the end of the array.  The "Operands" array looks like [token:"inst",
reg:r0, reg:r1].  The first operand that must be added to the MCInst
is the destination, the r0 register.  The "OpIdx" (in the Operands
array) for this register is 2.  However, since the flag is not present
in the Operands, the actual index for r0 should be 1.  The flag is not
present since we rely on the default value.

This patch removes the "NumDefaults" variable and replaces it with an
array (DefaultsOffset).  This array contains an index for each operand
(excluding the mnemonic).  At each index, the array contains the
number of optional operands that should be subtracted.  For the
previous example, this array looks like this: [0, 1, 1].  When we need
to access the r0 register, we compute its index as 2 -
DefaultsOffset[1] = 1.

Patch by Alexandru Guduleasa!

Reviewers: SamWot, nhaustov, niravd

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309949 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-03 15:40:21 +00:00
Sanjay Patel
9360b2e1ac [NewGVN] fix typos; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309946 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-03 15:18:27 +00:00
Sanjay Patel
34ac720fa2 [BDCE] add tests to show invalid/incomplete transforms
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309945 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-03 15:07:37 +00:00
Florian Hahn
c580a5c5db [GlobalISel] Only merge memory ops for mayLoad or mayStore instrs.
Summary:
We only need to merge memory operands for instructions that access
 memory. This slightly reduces the number of actions executed. 

Reviewers: MatzeB, rovka, dsanders

Reviewed By: dsanders

Subscribers: aemerson, igorb, kristof.beyls, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309944 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-03 14:48:22 +00:00
Robert Lougher
b587c9efc5 [LiveDebugVariables] Use lexical scope to trim debug value live intervals
The debug value live intervals computed by Live Debug Variables may extend
beyond the range of the debug location's lexical scope. In this case,
splitting of an interval can result in an interval outside of the scope being
created, causing extra unnecessary DBG_VALUEs to be emitted. To prevent this,
trim the intervals to the lexical scope.

This resolves PR33730.

Reviewers: aprantl

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309933 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-03 11:54:02 +00:00
NAKAMURA Takumi
7b9531eb3a Prune linefeed at eof.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309932 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-03 11:36:44 +00:00
NAKAMURA Takumi
dd3b410ff3 llvm/Support/CodeGenCWrappers.h: Add missing "llvm/ADT/Optional.h", to fix modules build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309931 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-03 11:36:42 +00:00
Simon Dardis
441e1a2fef [SelectionDAG] Resolve PR33978.
rL306209 taught SelectionDAG how to add the dereferenceable flag when
expanding memcpy and memmove. The fix however contained a nit where
the offset + size was constructed as an APInt of PointerSize rather
than PointerSizeInBits.

This lead to isDereferenceableAndAlignedPointer() get truncated values or
values which would be sign extended within that function leading to
incorrect results.

Thanks to Alex Crichton for reporting the issue!

This resolves PR33978.

Reviewers: inouehrs

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309930 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-03 09:38:46 +00:00
Max Kazantsev
f133b32f8e Removed unused variabled from unit test
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309929 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-03 09:25:44 +00:00
Ewan Crawford
6eeae175e1 [Cloning] Move distinct GlobalVariable debug info metadata in CloneModule
Duplicating the distinct Subprogram and CU metadata nodes seems like the incorrect thing to do in CloneModule for GlobalVariable debug info. As it results in the scope of the GlobalVariable DI no longer being consistent with the rest of the module, and the new CU is absent from llvm.dbg.cu.

Fixed by adding RF_MoveDistinctMDs to MapMetadata flags for GlobalVariables.

Current unit test IR after clone:
```
@gv = global i32 1, comdat($comdat), !dbg !0, !type !5

define private void @f() comdat($comdat) personality void ()* @persfn !dbg !14 {

!llvm.dbg.cu = !{!10}

!0 = !DIGlobalVariableExpression(var: !1)
!1 = distinct !DIGlobalVariable(name: "gv", linkageName: "gv", scope: !2, file: !3, line: 1, type: !9, isLocal: false, isDefinition: true)
!2 = distinct !DISubprogram(name: "f", linkageName: "f", scope: null, file: !3, line: 4, type: !4, isLocal: true, isDefinition: true, scopeLine: 3, isOptimized: false, unit: !6, variables: !5)
!3 = !DIFile(filename: "filename.c", directory: "/file/dir/")
!4 = !DISubroutineType(types: !5)
!5 = !{}
!6 = distinct !DICompileUnit(language: DW_LANG_C99, file: !7, producer: "CloneModule", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !5, globals: !8)
!7 = !DIFile(filename: "filename.c", directory: "/file/dir")
!8 = !{!0}
!9 = !DIBasicType(tag: DW_TAG_unspecified_type, name: "decltype(nullptr)")
!10 = distinct !DICompileUnit(language: DW_LANG_C99, file: !7, producer: "CloneModule", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !5, globals: !11)
!11 = !{!12}
!12 = !DIGlobalVariableExpression(var: !13)
!13 = distinct !DIGlobalVariable(name: "gv", linkageName: "gv", scope: !14, file: !3, line: 1, type: !9, isLocal: false, isDefinition: true)
!14 = distinct !DISubprogram(name: "f", linkageName: "f", scope: null, file: !3, line: 4, type: !4, isLocal: true, isDefinition: true, scopeLine: 3, isOptimized: false, unit: !10, variables: !5)
```

Patched IR after clone:
```
@gv = global i32 1, comdat($comdat), !dbg !0, !type !5

define private void @f() comdat($comdat) personality void ()* @persfn !dbg !2 {

!llvm.dbg.cu = !{!6}

!0 = !DIGlobalVariableExpression(var: !1)
!1 = distinct !DIGlobalVariable(name: "gv", linkageName: "gv", scope: !2, file: !3, line: 1, type: !9, isLocal: false, isDefinition: true)
!2 = distinct !DISubprogram(name: "f", linkageName: "f", scope: null, file: !3, line: 4, type: !4, isLocal: true, isDefinition: true, scopeLine: 3, isOptimized: false, unit: !6, variables: !5)
!3 = !DIFile(filename: "filename.c", directory: "/file/dir/")
!4 = !DISubroutineType(types: !5)
!5 = !{}
!6 = distinct !DICompileUnit(language: DW_LANG_C99, file: !7, producer: "CloneModule", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !5, globals: !8)
!7 = !DIFile(filename: "filename.c", directory: "/file/dir")
!8 = !{!0}
!9 = !DIBasicType(tag: DW_TAG_unspecified_type, name: "decltype(nullptr)")
```

Reviewers: aprantl, probinson, dblaikie, echristo, loladiro
Reviewed By: aprantl
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D36082


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309928 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-03 09:23:03 +00:00
Diana Picus
14dbdbf7e4 [ARM] GlobalISel: Select simple G_GLOBAL_VALUE instructions
Add support in the instruction selector for G_GLOBAL_VALUE for ELF and
MachO for the static relocation model. We don't handle Windows yet
because that's Thumb-only, and we don't handle Thumb in general at the
moment.

Support for PIC, ROPI, RWPI and TLS will be added in subsequent commits.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309927 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-03 09:14:59 +00:00
Dinar Temirbulatov
47af16ef51 [X86] SET0 to use XMM registers where possible PR26018 PR32862
Differential Revision: https://reviews.llvm.org/D35965


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309926 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-03 08:50:18 +00:00
Max Kazantsev
511c1a306c [SCEV] Re-enable "Cache results of computeExitLimit"
The patch rL309080 was reverted because it did not clean up the cache on "forgetValue"
method call. This patch re-enables this change, adds the missing check and introduces
two new unit tests that make sure that the cache is cleaned properly.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309925 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-03 08:41:30 +00:00
Daniel Sanders
daeea6f68d [globalisel][tablegen] Update a comment to use the name of the constant rather than the value.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309924 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-03 08:38:04 +00:00
Roger Ferrer Ibanez
0e06563a62 [ARM] Use ADDCARRY / SUBCARRY
This patch:

- makes nodes ISD::ADDCARRY and ISD::SUBCARRY legal for i32
- lowering is done by first converting the boolean value into the carry flag
  using (_, C) <- (ARMISD::ADDC R, -1) and converted back to an integer value
  using (R, _) <- (ARMISD::ADDE 0, 0, C). An ARMISD::ADDE between the two
  operations does the actual addition.
- for subtraction, given that ISD::SUBCARRY second result is actually a
  borrow, we need to invert the value of the second operand and result before
  and after using ARMISD::SUBE. We need to invert the carry result of
  ARMISD::SUBE to preserve the semantics.
- given that the generic combiner may lower ISD::ADDCARRY and
  ISD::SUBCARRY into ISD::UADDO and ISD::USUBO we need to update their lowering
  as well otherwise i64 operations now would require branches. This implies
  updating the corresponding test for unsigned.
- add new combiner to remove the redundant conversions from/to carry flags
  to/from boolean values (ARMISD::ADDC (ARMISD::ADDE 0, 0, C), -1) -> C

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309923 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-03 07:45:10 +00:00
Daniel Jasper
dfd6a10efb Fix WebAssembly target after r309911.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309922 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-03 05:15:53 +00:00
Rafael Espindola
a3b3711292 Fix the ppc jit tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309921 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-03 04:52:45 +00:00
Tobias Grosser
98bb5a4f2a [unittest] Remove TODO comment which caused concern
Remove the second part of the TODO comment that highlighted an issue with
possibly connecting all nodes to the exit of the CFG. This caused concerns
with Jakub Kuderski regarding its feasability, hence we remove it. Such
points are better discussed outside of CFG. If connecting all nodes makes
sense and what the impact is is currently part of an active review discussion.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309919 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-03 04:17:58 +00:00
Rafael Espindola
cec5ec447c Add LLVM_FALLTHROUGH.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309918 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-03 03:52:34 +00:00
Sameer AbuAsal
37ca700397 [RegisterCoalescer] Add wrapper for Erasing Instructions
Summary:
      To delete an instruction the coalescer needs to call eraseFromParent()
      on the MachineInstr, insert it in the ErasedInstrs list and update the
      Live Ranges structure. This patch re-factors the code to do all that in
      one function. This will also fix cases where previous code wasn't
      inserting deleted instructions in the ErasedList.

Reviewers: qcolombet, kparzysz

Reviewed By: qcolombet

Subscribers: MatzeB, llvm-commits, qcolombet

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309915 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-03 02:41:17 +00:00
Rafael Espindola
9aafb854cc Delete Default and JITDefault code models
IMHO it is an antipattern to have a enum value that is Default.

At any given piece of code it is not clear if we have to handle
Default or if has already been mapped to a concrete value. In this
case in particular, only the target can do the mapping and it is nice
to make sure it is always done.

This deletes the two default enum values of CodeModel and uses an
explicit Optional<CodeModel> when it is possible that it is
unspecified.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309911 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-03 02:16:21 +00:00
Javed Absar
65d41d8235 [ARM] Tidy up banked registers encoding
Moves encoding (SYSm) information of banked registers to ARMSystemRegister.td,
where it rightly belongs and forms a single point of reference in the code.

Reviewed by: @fhahn, @rovka, @olista01
Differential Revision: https://reviews.llvm.org/D36219



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309910 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-03 01:24:12 +00:00
Dehao Chen
ca9f2fdb19 Fix the bug when SampleProfileWriter writes out number of callsites.
Summary: As we support multiple callsites for the same location, we need to traverse all locations to get the number of callsites.

Reviewers: davidxl

Reviewed By: davidxl

Subscribers: sanjoy, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309907 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-03 00:09:18 +00:00
Vedant Kumar
d7247b5f8f Move two functions to a nicer spot. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309906 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-02 23:35:27 +00:00
Vedant Kumar
c563b0447b Rely on autobrief, remove \briefs from a header. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309905 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-02 23:35:26 +00:00
Vedant Kumar
a8dfa81a14 [Coverage] Add an API to retrive all instantiations of a function (NFC)
The CoverageMapping::getInstantiations() API retrieved all function
records corresponding to functions with more than one instantiation (e.g
template functions with multiple specializations). However, there was no
simple way to determine *which* function a given record was an
instantiation of. This was an oversight, since it's useful to aggregate
coverage information over all instantiations of a function.

llvm-cov works around this by building a mapping of source locations to
instantiation sets, but this duplicates logic that libCoverage already
has (see FunctionInstantiationSetCollector).

This change adds a new API, CoverageMapping::getInstantiationGroups(),
which returns a list of InstantiationGroups. A group contains records
for each instantiation of some particular function, and also provides
utilities to get the total execution count within the group, the source
location of the common definition, etc.

This lets removes some hacky logic in llvm-cov by reusing
FunctionInstantiationSetCollector and makes the CoverageMapping API
friendlier for other clients.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309904 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-02 23:35:25 +00:00
Vedant Kumar
f6b53455df [llvm-cov] Respect the value of the -show-instantiations option
Make `-show-instantiations=false` actually skip displaying instantiation
sub-views, instead of simply ignoring the option.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309903 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-02 23:35:24 +00:00
George Karpenkov
51c4734828 Revert "[libFuzzer tests] Use substring comparison in libFuzzer tests"
This reverts commit 3592d8049660dcdd07f7c2e797f2de9790f93111.

Breaks the bots, reverting for now.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309899 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-02 23:09:57 +00:00
Tom Stellard
58dd3a3775 AMDGPU/GlobalISel: Mark 32-bit G_FMUL as legal
Reviewers: arsenm

Reviewed By: arsenm

Subscribers: kzhuravl, wdng, nhaehnle, yaxunl, rovka, kristof.beyls, igorb, dstuttard, tpr, llvm-commits, t-tye

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309898 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-02 22:56:30 +00:00
Zachary Turner
50b0dc9e5b [pdb/lld] Write a valid FPM.
The PDB reserves certain blocks for the FPM that describe which
blocks in the file are allocated and which are free.  We weren't
filling that out at all, and in some cases we were even stomping
it with incorrect data.  This patch writes a correct FPM.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309896 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-02 22:31:39 +00:00
Zachary Turner
11625a0d5e [MSF] Move MSF unit tests to their own unittest target.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309895 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-02 22:26:09 +00:00
Zachary Turner
34173def44 [pdbutil] Add a command to dump the FPM.
Recently problems have been discovered in the way we write the FPM
(free page map).  In order to fix this, we first need to establish
a baseline about what a correct FPM looks like using an MSVC
generated PDB, so that we can then make our own generated PDBs
match.  And in order to do this, the dumper needs a mode where it
can dump an FPM so that we can write tests for it.

This patch adds a command to dump the FPM, as well as a test against
a known-good PDB.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309894 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-02 22:25:52 +00:00
Tom Stellard
cd14d227ff AMDGPU/R600: Initialize more passes
Reviewers: arsenm

Reviewed By: arsenm

Subscribers: kzhuravl, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309893 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-02 22:19:45 +00:00
Keith Wyss
630a4acf81 Xray docs with description of Flight Data Recorder binary format.
Summary:
Adding a new restructuredText file to document the trace format produced with
an FDR mode handler and read by llvm-xray toolset.

Fixed two problems in the documentation from differential review. One bad table
and a missing link in the toc.

Original commit was e97c5836a77db803fe53319c53f3bf8e8b26d2b7.

Reviewers: dberris, pelikan

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309891 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-02 21:47:27 +00:00
Matt Arsenault
c8df92092d LV: Don't insert runtime ptr checks on divergent targets
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309890 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-02 21:43:08 +00:00
George Karpenkov
6795f26af5 [libFuzzer tests] Use substring comparison in libFuzzer tests
LIT launches executables with absolute, and not relative, path.
strncmp would try to do exact comparison and fail.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309889 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-02 21:38:50 +00:00
Craig Topper
ef45a1fe1b [InstCombine] Remove unnecessary temporary APInt. NFCI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309887 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-02 21:05:40 +00:00
Teresa Johnson
99dd11f7e8 [PM] Split LoopUnrollPass and make partial unroller a function pass
Summary:
This is largely NFC*, in preparation for utilizing ProfileSummaryInfo
and BranchFrequencyInfo analyses. In this patch I am only doing the
splitting for the New PM, but I can do the same for the legacy PM as
a follow-on if this looks good.

*Not NFC since for partial unrolling we lose the updates done to the
loop traversal (adding new sibling and child loops) - according to
Chandler this is not very useful for partial unrolling, but it also
means that the debugging flag -unroll-revisit-child-loops no longer
works for partial unrolling.

Reviewers: chandlerc

Subscribers: mehdi_amini, mzolotukhin, eraman, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309886 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-02 20:35:29 +00:00
Rafael Espindola
2600a677c9 Don't pass the code model to MC
I was surprised to see the code model being passed to MC. After all,
it assembles code, it doesn't create it.

The one place it is used is in the expansion of .cfi directives to
handle .eh_frame being more that 2gb away from the code.

As far as I can tell, gnu assembler doesn't even have an option to
enable this. Compiling a c file with gcc -mcmodel=large produces a
regular looking .eh_frame. This is probably because in practice linker
parse and recreate .eh_frames.

In llvm this is used because the JIT can place the code and .eh_frame
very far apart. Ideally we would fix the jit and delete this
option. This is hard.

Apart from confusion another problem with the current interface is
that most callers pass CodeModel::Default, which is bad since MC has
no way to map it to the target default if it actually needed to.

This patch then replaces the argument with a boolean with a default
value. The vast majority of users don't ever need to look at it. In
fact, only CodeGen and llvm-mc use it and llvm-mc just to enable more
testing.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309884 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-02 20:32:26 +00:00
Craig Topper
43b62b6cb8 [InstCombine] Remove explicit code for folding (xor(zext(cmp)), 1) and (xor(sext(cmp)), -1) to ext(!cmp).
As far as I can tell this should be handled by foldCastedBitwiseLogic which is called later in visitXor.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309882 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-02 20:30:27 +00:00
Craig Topper
80b5f5982a [InstCombine] Support sext in foldLogicCastConstant
This adds support for sext in foldLogicCastConstant. This is a prerequisite for D36214.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309880 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-02 20:25:56 +00:00
David Blaikie
61dba579be DebugInfo: Test & handle (differently) non-zero DW_AT_ranges_base
Followup to r309570, fixing it slightly differently (ranges_base and
addr_base should never be read from a DWO file - so there shouldn't be
any issue with 'overriding' the values - conditionalize the code and
assert that the values aren't being overriden).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309879 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-02 20:16:22 +00:00
Stefan Pintilie
07635d3971 [Power9] Exploit vector absolute difference instructions on Power 9
Power 9 has instructions to do absolute difference (VABSDUB, VABSDUH, VABSDUW)
for byte, halfword and word. We should take advantage of these.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309876 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-02 20:07:21 +00:00
Davide Italiano
82f73ee5b3 [NewGVN] Now that load coercion is enable, we pass this test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309872 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-02 19:47:37 +00:00
Evandro Menezes
7fee9f87f4 [AArch64] Add Exynos M2 feature test (NFC)
Test fusion of AES operations.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309855 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-02 18:55:34 +00:00
Jakub Kuderski
95e74fa238 [Dominators] Teach LoopDeletion to use the new incremental API
Summary:
This patch makes LoopDeletion use the incremental DominatorTree API.

We modify LoopDeletion to perform the deletion in 5 steps:
1. Create a new dummy edge from the preheader to the exit, by adding a conditional branch.
2. Inform the DomTree about the new edge.
3. Remove the conditional branch and replace it with an unconditional edge to the exit. This removes the edge to the loop header, making it unreachable.
4. Inform the DomTree about the deleted edge.
5. Remove the unreachable block from the function.

Creating the dummy conditional branch is necessary to perform incremental DomTree update.
We should consider using the batch updater when it's ready.

Reviewers: dberlin, davide, grosser, sanjoy

Reviewed By: dberlin, grosser

Subscribers: mzolotukhin, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309850 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-02 18:17:52 +00:00
Hiroshi Inoue
f49a981211 [StackColoring] Update AliasAnalysis information in stack coloring pass (part 2)
This patch is update after the first patch (https://reviews.llvm.org/rL309651) based on the post-commit comments.

Stack coloring pass need to maintain AliasAnalysis information when merging stack slots of different types.
Actually, there is a FIXME comment in StackColoring.cpp

// FIXME: In order to enable the use of TBAA when using AA in CodeGen,
// we'll also need to update the TBAA nodes in MMOs with values
// derived from the merged allocas.

But, TBAA has been already enabled in CodeGen without fixing this pass.
The incorrect TBAA metadata results in recent failures in bootstrap test on ppc64le (PR33928) by allowing unsafe instruction scheduling.
Although we observed the problem on ppc64le, this is a platform neutral issue.

This patch makes the stack coloring pass maintains AliasAnalysis information when merging multiple stack slots.

This patch fixes PR33928.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309849 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-02 18:16:32 +00:00
Keith Wyss
3e9e87e5ea Revert "Xray docs with description of Flight Data Recorder binary format."
This reverts commit 3462b8ad41a840fd54dbbd0d3f2a514c5ad6f656.

The docs-llvm-html target failed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309842 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-02 17:36:52 +00:00
Coby Tayree
fac03ed36c [AsmParser][GAS-compatibility] Ignore an empty 'p2align' directive
GAS ignores the aforementioned issue
this patch aligns LLVM + throws in an appropriate warning

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309841 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-02 17:36:10 +00:00
Craig Topper
dbf7ec5b15 [InstCombine] Add missing test case for (xor (sext (cmp)), -1) -> (sext (!cmp)).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309839 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-02 17:33:02 +00:00