platform/upstream/llvm.git
6 years agoRemove "FIXME" from a comment.
Rui Ueyama [Fri, 23 Mar 2018 22:48:17 +0000 (22:48 +0000)]
Remove "FIXME" from a comment.

A bug in BFD linker is not our FIXME item.

llvm-svn: 328381

6 years agoChange for an LLVM header file move
David Blaikie [Fri, 23 Mar 2018 22:16:59 +0000 (22:16 +0000)]
Change for an LLVM header file move

llvm-svn: 328380

6 years agoFix Layering, move instrumentation transform headers into Instrumentation subdirectory
David Blaikie [Fri, 23 Mar 2018 22:11:06 +0000 (22:11 +0000)]
Fix Layering, move instrumentation transform headers into Instrumentation subdirectory

llvm-svn: 328379

6 years ago[Commands] Add a (currently empty) `stats` command.
Davide Italiano [Fri, 23 Mar 2018 21:55:48 +0000 (21:55 +0000)]
[Commands] Add a (currently empty) `stats` command.

This one will be used to print statistics about lldb sessions
(including, e.g. number of expression evaluation succeeded or
failed). I decided to commit the skeleton first so that we have
a clean reference on how a command should be implemented.
My future commits are going to populate this command and test
it.

<rdar://problem/36555975>

llvm-svn: 328378

6 years ago[PM][FunctionAttrs] add NoUnwind attribute inference to PostOrderFunctionAttrs pass
Fedor Sergeev [Fri, 23 Mar 2018 21:46:16 +0000 (21:46 +0000)]
[PM][FunctionAttrs] add NoUnwind attribute inference to PostOrderFunctionAttrs pass

Summary:
This was motivated by absence of PrunEH functionality in new PM.
It was decided that a proper way to do PruneEH is to add NoUnwind inference
into PostOrderFunctionAttrs and then perform normal SimplifyCFG on top.

This change generalizes attribute handling implemented for (a removal of)
Convergent attribute, by introducing a generic builder-like class
   AttributeInferer

It registers all the attribute inference requests, storing per-attribute
predicates into a vector, and then goes through an SCC Node, scanning all
the instructions for not breaking attribute assumptions.

The main idea is that as soon all the instructions from all the functions
of SCC Node conform to attribute assumptions then we are free to infer
the attribute as set for all the functions of SCC Node.

It handles two distinct cases of attributes:
   - those that might break due to derefinement of the function code

     for these attributes we are allowed to apply inference only if all the
     functions are "exact definitions". Example - NoUnwind.

   - those that do not care about derefinement

     for these attributes we are allowed to apply inference as soon as we see
     any function definition. Example - removal of Convergent attribute.

Also in this commit:
* Converted all the FunctionAttrs tests to use FileCheck and added new-PM
  invocations to them

* FunctionAttrs/convergent.ll test demonstrates a difference in behavior between
   new and old PM implementations. Marked with FIXME.

* PruneEH tests were converted to new-PM as well, using function-attrs+simplify-cfg
  combo as intended

* some of "other" tests were updated since function-attrs now infers 'nounwind'
  even for old PM pipeline

* -disable-nounwind-inference hidden option added as a possible workaround for a supposedly
  rare case when nounwind being inferred by default presents a problem

Reviewers: chandlerc, jlebar

Reviewed By: jlebar

Subscribers: eraman, llvm-commits

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

llvm-svn: 328377

6 years agoFreeBSD sanitizer common, intercept couple of more functions
Vitaly Buka [Fri, 23 Mar 2018 21:44:59 +0000 (21:44 +0000)]
FreeBSD sanitizer common, intercept couple of more functions

Summary:
Intercepts lstat, acct, access, faccessat and strlcpy/strlcat

Patch by David CARLIER

Reviewers: visa, vitalybuka

Subscribers: krytarowski, fedor.sergeev, srhines, kubamracek, llvm-commits, #sanitizers

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

llvm-svn: 328376

6 years agoRevert "Mmap interceptor providing mprotect support"
Vitaly Buka [Fri, 23 Mar 2018 21:44:59 +0000 (21:44 +0000)]
Revert "Mmap interceptor providing mprotect support"

Breaks Darwin.

This reverts commit r328369.

llvm-svn: 328375

6 years agoChange the darwin-debug target to build the standard
Jason Molenda [Fri, 23 Mar 2018 21:37:19 +0000 (21:37 +0000)]
Change the darwin-debug target to build the standard
archs.

llvm-svn: 328374

6 years ago[CMakeLists] Update file list after recent changes.
Davide Italiano [Fri, 23 Mar 2018 21:21:17 +0000 (21:21 +0000)]
[CMakeLists] Update file list after recent changes.

llvm-svn: 328373

6 years ago[InstCombine] simplify code for FP intrinsic shrinking; NFCI
Sanjay Patel [Fri, 23 Mar 2018 21:18:12 +0000 (21:18 +0000)]
[InstCombine] simplify code for FP intrinsic shrinking; NFCI

llvm-svn: 328372

6 years ago[InstCombine] increase test coverage for intrinsic shrinking; NFC
Sanjay Patel [Fri, 23 Mar 2018 21:13:53 +0000 (21:13 +0000)]
[InstCombine] increase test coverage for intrinsic shrinking; NFC

There were no tests with vector types before this.

llvm-svn: 328371

6 years ago[Commands] Remove dead code for unused `args` command.
Davide Italiano [Fri, 23 Mar 2018 21:04:34 +0000 (21:04 +0000)]
[Commands] Remove dead code for unused `args` command.

It wasn't even registered.

(lldb) apropos args
No commands found pertaining to 'args'. Try 'help' to see
a complete list of debugger commands.

llvm-svn: 328370

6 years agoMmap interceptor providing mprotect support
Vitaly Buka [Fri, 23 Mar 2018 20:59:51 +0000 (20:59 +0000)]
Mmap interceptor providing mprotect support

Summary:
- Intercepting mprotect calls.
- Fixing forgotten flag check.

Patch by David CARLIER

Reviewers: vitalybuka, vsk

Reviewed By: vitalybuka

Subscribers: srhines, kubamracek, llvm-commits, #sanitizers

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

llvm-svn: 328369

6 years ago[Command] Remove dead code for the syntax command.
Davide Italiano [Fri, 23 Mar 2018 20:58:05 +0000 (20:58 +0000)]
[Command] Remove dead code for the syntax command.

I'm going to add a new commend so I figured I could do
some spring cleaning.

llvm-svn: 328368

6 years ago[Hexagon] Make findLoopInstr member of HexagonInstrInfo
Krzysztof Parzyszek [Fri, 23 Mar 2018 20:43:02 +0000 (20:43 +0000)]
[Hexagon] Make findLoopInstr member of HexagonInstrInfo

llvm-svn: 328367

6 years ago[Hexagon] Correct update of instruction offet in HW loop fixup
Krzysztof Parzyszek [Fri, 23 Mar 2018 20:41:44 +0000 (20:41 +0000)]
[Hexagon] Correct update of instruction offet in HW loop fixup

llvm-svn: 328366

6 years agoLog ObjC Runtime messages only in verbose mode
Adrian Prantl [Fri, 23 Mar 2018 20:17:39 +0000 (20:17 +0000)]
Log ObjC Runtime messages only in verbose mode

llvm-svn: 328365

6 years ago[Hexagon] Boost profit for word-mask immediates, reduce for others
Krzysztof Parzyszek [Fri, 23 Mar 2018 20:11:00 +0000 (20:11 +0000)]
[Hexagon] Boost profit for word-mask immediates, reduce for others

This avoids unnecessary splitting due to uninteresting immediates.

llvm-svn: 328364

6 years ago[PDB] Resubmit "Support embedding natvis files in PDBs."
Zachary Turner [Fri, 23 Mar 2018 19:57:25 +0000 (19:57 +0000)]
[PDB] Resubmit "Support embedding natvis files in PDBs."

This was reverted several times due to what ultimately turned out
to be incompatibilities in our serialized hash table format.

Several changes went in prior to this to fix those issues since
they were more fundamental and independent of supporting injected
sources, so now that those are fixed this change should hopefully
pass.

llvm-svn: 328363

6 years ago[CUDA] Fixed false error reporting in case of calling H->G->HD->D.
Artem Belevich [Fri, 23 Mar 2018 19:49:03 +0000 (19:49 +0000)]
[CUDA] Fixed false error reporting in case of calling H->G->HD->D.

Launching a kernel from the host code does not generate code for the
kernel itself. This fixes an issue with clang erroneously reporting
an error for a HD->D call from within the kernel.

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

llvm-svn: 328362

6 years ago[HWASan] Port HWASan to Linux x86-64 (clang)
Alex Shlyapnikov [Fri, 23 Mar 2018 19:47:45 +0000 (19:47 +0000)]
[HWASan] Port HWASan to Linux x86-64 (clang)

Summary: Porting HWASan to Linux x86-64, the third of the three patches, clang part.

Reviewers: eugenis

Subscribers: cryptoad, cfe-commits

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

llvm-svn: 328361

6 years ago[Hexagon] Assume all extendable branches to be of size 8 in relaxation
Krzysztof Parzyszek [Fri, 23 Mar 2018 19:47:13 +0000 (19:47 +0000)]
[Hexagon] Assume all extendable branches to be of size 8 in relaxation

The branch relaxation pass collects sizes of all instructions at the
beginning, before any changes have been made. It then performs one pass
over all branches to see which ones need to be extended. It does not
account for the case when a previously valid branch becomes out-of-range
due to relaxing other branches.
This approach fixes this problem by assuming from the beginning that
all extendable branches have been extended. This may cause unneeded
relaxation in some cases, but avoids iteration and recomputing instruction
sizes.

llvm-svn: 328360

6 years ago[AMDGPU] Fix codegen for inline assembly
Yaxun Liu [Fri, 23 Mar 2018 19:43:42 +0000 (19:43 +0000)]
[AMDGPU] Fix codegen for inline assembly

Need to override convertConstraint to recognise amdgpu specific register names.

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

llvm-svn: 328359

6 years ago[llvm-mca] Split the InstructionInfoView from the SummaryView.
Andrea Di Biagio [Fri, 23 Mar 2018 19:40:04 +0000 (19:40 +0000)]
[llvm-mca] Split the InstructionInfoView from the SummaryView.

llvm-svn: 328358

6 years ago[Hexagon] Incorrectly removing dead flag and adding kill flag
Krzysztof Parzyszek [Fri, 23 Mar 2018 19:39:37 +0000 (19:39 +0000)]
[Hexagon] Incorrectly removing dead flag and adding kill flag

The HexagonExpandCondsets pass is incorrectly removing the dead
flag on a definition that is really dead, and adding a kill flag
to a use that is tied to a definition. This causes an assert later
during the machine scheduler when querying the live interval
information.

Patch by Brendon Cahoon.

llvm-svn: 328357

6 years ago[Hexagon] Silence unused variable warning in Release builds
Benjamin Kramer [Fri, 23 Mar 2018 19:39:16 +0000 (19:39 +0000)]
[Hexagon] Silence unused variable warning in Release builds

llvm-svn: 328356

6 years ago[Hexagon] Fold offset in base+immediate loads/stores
Krzysztof Parzyszek [Fri, 23 Mar 2018 19:30:34 +0000 (19:30 +0000)]
[Hexagon] Fold offset in base+immediate loads/stores

Optimize Ry = add(Rx,#n); memw(Ry+#0) = Rz  =>  memw(Rx,#n) = Rz.

Patch by Jyotsna Verma.

llvm-svn: 328355

6 years agoFix misuse of llvm::YAML in clangd test.
Jordan Rose [Fri, 23 Mar 2018 19:16:07 +0000 (19:16 +0000)]
Fix misuse of llvm::YAML in clangd test.

Caught by LLVM r328345!

llvm-svn: 328354

6 years ago[X86] Add itinerary to RCPSS*_Int and similar instructions.
Craig Topper [Fri, 23 Mar 2018 19:15:05 +0000 (19:15 +0000)]
[X86] Add itinerary to RCPSS*_Int and similar instructions.

llvm-svn: 328353

6 years ago[X86] Add itineraries to ADD.*_DB instructions to match their normal counterparts.
Craig Topper [Fri, 23 Mar 2018 19:15:03 +0000 (19:15 +0000)]
[X86] Add itineraries to ADD.*_DB instructions to match their normal counterparts.

llvm-svn: 328352

6 years ago[AMDGPU] Update OpenCL to use 48 bytes of implicit arguments for AMDGPU
Tony Tye [Fri, 23 Mar 2018 18:58:47 +0000 (18:58 +0000)]
[AMDGPU] Update OpenCL to use 48 bytes of implicit arguments for AMDGPU

Add two additional implicit arguments for OpenCL for the AMDGPU target using the AMDHSA runtime to support device enqueue.

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

llvm-svn: 328351

6 years ago[AMDGPU] Update OpenCL to use 48 bytes of implicit arguments for AMDGPU (CLANG)
Tony Tye [Fri, 23 Mar 2018 18:51:45 +0000 (18:51 +0000)]
[AMDGPU] Update OpenCL to use 48 bytes of implicit arguments for AMDGPU (CLANG)

Add two additional implicit arguments for OpenCL for the AMDGPU target using the AMDHSA runtime to support device enqueue.

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

llvm-svn: 328350

6 years ago[AMDGPU] Remove use of OpenCL triple environment and replace with function attribute...
Tony Tye [Fri, 23 Mar 2018 18:45:18 +0000 (18:45 +0000)]
[AMDGPU] Remove use of OpenCL triple environment and replace with function attribute for AMDGPU

- Remove use of the opencl and amdopencl environment member of the target triple for the AMDGPU target.
- Use function attribute to communicate to the AMDGPU backend to add implicit arguments for OpenCL kernels for the AMDHSA OS.

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

llvm-svn: 328349

6 years ago[PDB] Make our PDBs look more like MS PDBs.
Zachary Turner [Fri, 23 Mar 2018 18:43:39 +0000 (18:43 +0000)]
[PDB] Make our PDBs look more like MS PDBs.

When investigating bugs in PDB generation, the first step is
often to do the same link with link.exe and then compare PDBs.

But comparing PDBs is hard because two completely different byte
sequences can both be correct, so it hampers the investigation when
you also have to spend time figuring out not just which bytes are
different, but also if the difference is meaningful.

This patch fixes a couple of cases related to string table emission,
hash table emission, and the order in which we emit strings that
makes more of our bytes the same as the bytes generated by MS PDBs.

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

llvm-svn: 328348

6 years ago[AMDGPU] Remove use of OpenCL triple environment and replace with function attribute...
Tony Tye [Fri, 23 Mar 2018 18:43:15 +0000 (18:43 +0000)]
[AMDGPU] Remove use of OpenCL triple environment and replace with function attribute for AMDGPU (CLANG)

- Remove use of the opencl and amdopencl environment member of the target triple for the AMDGPU target.
- Use a function attribute to communicate to the AMDGPU backend.

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

llvm-svn: 328347

6 years ago[Hexagon] Always generate mux out of predicated transfers if possible
Krzysztof Parzyszek [Fri, 23 Mar 2018 18:43:09 +0000 (18:43 +0000)]
[Hexagon] Always generate mux out of predicated transfers if possible

HexagonGenMux would collapse pairs of predicated transfers if it assumed
that the predicated .new forms cannot be created. Turns out that generating
mux is preferable in almost all cases.
Introduce an option -hexagon-gen-mux-threshold that controls the minimum
distance between the instruction defining the predicate and the later of
the two transfers. If the distance is closer than the threshold, mux will
not be generated. Set the threshold to 0 by default.

llvm-svn: 328346

6 years agoDelete the copy constructor for llvm::yaml::Node
Jordan Rose [Fri, 23 Mar 2018 18:05:19 +0000 (18:05 +0000)]
Delete the copy constructor for llvm::yaml::Node

The nodes keep a reference back to the original document, but the
document is streamed, not read all into memory at once, and the
position is part of the state. If nodes are ever copied, the document
position can end up being advanced more than once.

This did not reveal any problems in LLVM or Clang but caught a handful
over in Swift!

llvm-svn: 328345

6 years ago[Hexagon] Avoid early if-conversion for one sided branches
Krzysztof Parzyszek [Fri, 23 Mar 2018 18:00:18 +0000 (18:00 +0000)]
[Hexagon] Avoid early if-conversion for one sided branches

Patch by Anand Kodnani.

llvm-svn: 328344

6 years ago[X86][Btver2] Cleanup TEST instructions to use JFPA (+JFPX on ymms) function unit
Simon Pilgrim [Fri, 23 Mar 2018 17:59:22 +0000 (17:59 +0000)]
[X86][Btver2] Cleanup TEST instructions to use JFPA (+JFPX on ymms) function unit

llvm-svn: 328343

6 years ago[HWASan] Port HWASan to Linux x86-64 (LLVM)
Alex Shlyapnikov [Fri, 23 Mar 2018 17:57:54 +0000 (17:57 +0000)]
[HWASan] Port HWASan to Linux x86-64 (LLVM)

Summary:
Porting HWASan to Linux x86-64, first of the three patches, LLVM part.

The approach is similar to ARM case, trap signal is used to communicate
memory tag check failure. int3 instruction is used to generate a signal,
access parameters are stored in nop [eax + offset] instruction immediately
following the int3 one.

One notable difference is that x86-64 has to untag the pointer before use
due to the lack of feature comparable to ARM's TBI (Top Byte Ignore).

Reviewers: eugenis

Subscribers: kristof.beyls, llvm-commits

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

llvm-svn: 328342

6 years ago[ARM] Fix "Constant pool entry out of range!" in Thumb1 mode
Ana Pazos [Fri, 23 Mar 2018 17:53:27 +0000 (17:53 +0000)]
[ARM] Fix "Constant pool entry out of range!" in Thumb1 mode

This patch fixes PR36658, "Constant pool entry out of range!" in Thumb1 mode.

In ARMConstantIslands::optimizeThumb2JumpTables() in Thumb1 mode,
adjustBBOffsetsAfter() is not calculating postOffset correctly by
properly accounting for the padding that is required for the constant pool
that immediately follows the jump table branch  instruction.

Reviewers: t.p.northover, eli.friedman

Reviewed By: t.p.northover

Subscribers: chrib, tstellar, javed.absar, kristof.beyls, llvm-commits

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

llvm-svn: 328341

6 years ago[llvm-mca] update the ResourcePressureView after r328335. NFC.
Andrea Di Biagio [Fri, 23 Mar 2018 17:53:02 +0000 (17:53 +0000)]
[llvm-mca] update the ResourcePressureView after r328335. NFC.

This should have been part of r328335. I forgot to svn add these files.

llvm-svn: 328340

6 years ago[Hexagon] Two fixes in early if-conversion
Krzysztof Parzyszek [Fri, 23 Mar 2018 17:46:09 +0000 (17:46 +0000)]
[Hexagon] Two fixes in early if-conversion

- Fix checking for vector predicate registers.
- Avoid speculating llvm.lifetime.end intrinsic.

Patch by Harsha Jagasia and Brendon Cahoon.

llvm-svn: 328339

6 years ago[X86][Btver2] Cleanup MOVMSK instructions to use JFPA function unit
Simon Pilgrim [Fri, 23 Mar 2018 17:38:59 +0000 (17:38 +0000)]
[X86][Btver2] Cleanup MOVMSK instructions to use JFPA function unit

Add missing non-VEX and (V)PMOVMSKB instructions to the pattern

llvm-svn: 328338

6 years ago[vfs] Don't bail out after a missing -ivfsoverlay file
Ben Langmuir [Fri, 23 Mar 2018 17:37:27 +0000 (17:37 +0000)]
[vfs] Don't bail out after a missing -ivfsoverlay file

This make -ivfsoverlay behave more like other fatal errors (e.g. missing
-include file) by skipping the missing file instead of bailing out of
the whole compilation. This makes it possible for libclang to still
provide some functionallity as well as to correctly produce the fatal
error diagnostic (previously we lost the diagnostic in libclang since
there was no TU to tie it to).

rdar://33385423

llvm-svn: 328337

6 years agoFix a block copying problem in LICM
Andrew Kaylor [Fri, 23 Mar 2018 17:36:18 +0000 (17:36 +0000)]
Fix a block copying problem in LICM

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

llvm-svn: 328336

6 years ago[llvm-mca] Make the resource cost a double.
Andrea Di Biagio [Fri, 23 Mar 2018 17:36:07 +0000 (17:36 +0000)]
[llvm-mca] Make the resource cost a double.

This is done in preparation for the fix for PR36874.
The number of cycles consumed for each pipe is now a double quantity. This
allows reuse of the resource pressure view to print out instruction tables.

llvm-svn: 328335

6 years ago[ADT] Simplify getMemory. NFC
Fangrui Song [Fri, 23 Mar 2018 17:26:12 +0000 (17:26 +0000)]
[ADT] Simplify getMemory. NFC

llvm-svn: 328334

6 years ago[Hexagon] Copy subregisters in HexagonStoreWiden
Krzysztof Parzyszek [Fri, 23 Mar 2018 17:22:55 +0000 (17:22 +0000)]
[Hexagon] Copy subregisters in HexagonStoreWiden

When converting an instruction to the wider version, copy any
subregisters if the original operand has a subregister.

Patch by Brendon Cahoon.

llvm-svn: 328333

6 years agoAdd a minimal fix for PR36878.
Rafael Espindola [Fri, 23 Mar 2018 17:19:18 +0000 (17:19 +0000)]
Add a minimal fix for PR36878.

When looking for the output section and the output offset the
expectation was that the caller had looked at Repl. That works fine
for InputSections, but in the case of MergeInputSections the caller
doesn't have the section that is actually replaced.

The original testcase was failing because getOutputSection was
returning null. The slightly extended testcase also checks that
getOffset also checks Repl.

I will send a refactoring separetelly.

llvm-svn: 328332

6 years ago[X86][Btver2] Vector permutes use a JFPU01 scheduler pipe and JFPX/JVALU function...
Simon Pilgrim [Fri, 23 Mar 2018 16:17:56 +0000 (16:17 +0000)]
[X86][Btver2] Vector permutes use a JFPU01 scheduler pipe and JFPX/JVALU function unit

llvm-svn: 328331

6 years ago[InstCombine] auto-generate checks; NFC
Sanjay Patel [Fri, 23 Mar 2018 15:39:03 +0000 (15:39 +0000)]
[InstCombine] auto-generate checks; NFC

llvm-svn: 328329

6 years ago[X86][Btver2] Vector store instructions use a JFPU1 scheduler pipe and JSAGU/JSTC...
Simon Pilgrim [Fri, 23 Mar 2018 15:35:13 +0000 (15:35 +0000)]
[X86][Btver2] Vector store instructions use a JFPU1 scheduler pipe and JSAGU/JSTC function units

llvm-svn: 328328

6 years ago[InstSimplify] regenerate checks, move tests; NFC
Sanjay Patel [Fri, 23 Mar 2018 15:31:31 +0000 (15:31 +0000)]
[InstSimplify] regenerate checks, move tests; NFC

llvm-svn: 328327

6 years agoRe-commit: [MachineLICM] Add functions to MachineLICM to hoist invariant stores
Zaara Syeda [Fri, 23 Mar 2018 15:28:15 +0000 (15:28 +0000)]
Re-commit: [MachineLICM] Add functions to MachineLICM to hoist invariant stores

This patch adds functions to allow MachineLICM to hoist invariant stores.
Currently, MachineLICM does not hoist any store instructions, however
when storing the same value to a constant spot on the stack, the store
instruction should be considered invariant and be hoisted. The function
isInvariantStore iterates each operand of the store instruction and checks
that each register operand satisfies isCallerPreservedPhysReg. The store
may be fed by a copy, which is hoisted by isCopyFeedingInvariantStore.
This patch also adds the PowerPC changes needed to consider the stack
register as caller preserved.

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

llvm-svn: 328326

6 years ago[InstCombine] regenerate test checks; NFC
Sanjay Patel [Fri, 23 Mar 2018 15:19:35 +0000 (15:19 +0000)]
[InstCombine] regenerate test checks; NFC

llvm-svn: 328325

6 years ago[X86][Btver2] Cleanup DPPS/DPPD instructions to use JFPA/JFPM function units
Simon Pilgrim [Fri, 23 Mar 2018 15:17:50 +0000 (15:17 +0000)]
[X86][Btver2] Cleanup DPPS/DPPD instructions to use JFPA/JFPM function units

llvm-svn: 328324

6 years ago[InstCombine] reduce code duplication; NFC
Sanjay Patel [Fri, 23 Mar 2018 15:07:35 +0000 (15:07 +0000)]
[InstCombine] reduce code duplication; NFC

llvm-svn: 328323

6 years ago[InstCombine] improve variable name; NFC
Sanjay Patel [Fri, 23 Mar 2018 14:48:31 +0000 (14:48 +0000)]
[InstCombine] improve variable name; NFC

llvm-svn: 328322

6 years ago[AArch64] Don't reduce the width of loads if it prevents combining a shift
John Brawn [Fri, 23 Mar 2018 14:47:07 +0000 (14:47 +0000)]
[AArch64] Don't reduce the width of loads if it prevents combining a shift

Loads and stores can only shift the offset register by the size of the value
being loaded, but currently the DAGCombiner will reduce the width of the load
if it's followed by a trunc making it impossible to later combine the shift.

Solve this by implementing shouldReduceLoadWidth for the AArch64 backend and
make it prevent the width reduction if this is what would happen, though do
allow it if reducing the load width will let us eliminate a later sign or zero
extend.

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

llvm-svn: 328321

6 years ago[X86][Btver2] Fix MicroOps counts for DPPS/YMM memory folded instructions
Simon Pilgrim [Fri, 23 Mar 2018 14:45:03 +0000 (14:45 +0000)]
[X86][Btver2] Fix MicroOps counts for DPPS/YMM memory folded instructions

This was due to a misunderstanding over what llvm calls a micro-op (retirement unit) is actually called a macro-op on the AMD/Jaguar target. Folded loads don't affect num macro ops.

llvm-svn: 328320

6 years ago[ELF] - Simplify. NFC.
George Rimar [Fri, 23 Mar 2018 14:43:51 +0000 (14:43 +0000)]
[ELF] - Simplify. NFC.

llvm-svn: 328319

6 years ago[X86][Btver2] Cleanup SSE42 PCMPISTR/PCMPESTR string instructions to correctly use...
Simon Pilgrim [Fri, 23 Mar 2018 14:27:26 +0000 (14:27 +0000)]
[X86][Btver2] Cleanup SSE42 PCMPISTR/PCMPESTR string instructions to correctly use JFPU1 scheduler pipe followed by JLAGU/JSAGU/JFPA/JVALU function units

Fixes throughput to match Agner/Fam16h-SoG as well.

llvm-svn: 328318

6 years agoRemove the deprecated single-alignment IRBuilder API for memcpy/memmove (NFC)
Daniel Neilson [Fri, 23 Mar 2018 14:25:35 +0000 (14:25 +0000)]
Remove the deprecated single-alignment IRBuilder API for memcpy/memmove (NFC)

Summary:
This change is part of step six in the series of changes to remove the alignment
argument from memcpy/memmove/memset in favour of alignment attributes. At this
point all users of the IRBuilder APIs for creating a memcpy/memmove call given
a single value for alignment have been updated. We want to discourage usage of
these old APIs in favour of the newer ones that allow for separate source and
destination alignments, so this patch deletes the old API.

Specifically, we remove from IRBuilder:
CallInst *CreateMemCpy(Value *Dst, Value *Src, uint64_t Size, unsigned Align,
                       bool isVolatile = false, MDNode *TBAATag = nullptr,
                       MDNode *TBAAStructTag = nullptr,
                       MDNode *ScopeTag = nullptr,
                       MDNode *NoAliasTag = nullptr)
CallInst *CreateMemCpy(Value *Dst, Value *Src, Value *Size, unsigned Align,
                       bool isVolatile = false, MDNode *TBAATag = nullptr,
                       MDNode *TBAAStructTag = nullptr,
                       MDNode *ScopeTag = nullptr,
                       MDNode *NoAliasTag = nullptr)
CallInst *CreateMemMove(Value *Dst, Value *Src, uint64_t Size, unsigned Align,
                        bool isVolatile = false, MDNode *TBAATag = nullptr,
                        MDNode *ScopeTag = nullptr,
                        MDNode *NoAliasTag = nullptr)
CallInst *CreateMemMove(Value *Dst, Value *Src, Value *Size, unsigned Align,
                        bool isVolatile = false, MDNode *TBAATag = nullptr,
                        MDNode *ScopeTag = nullptr,
                        MDNode *NoAliasTag = nullptr)

Steps:
Step 1) Remove alignment parameter and create alignment parameter attributes for
memcpy/memmove/memset. ( rL322965, rC322964, rL322963 )
Step 2) Expand the IRBuilder API to allow creation of memcpy/memmove with differing
source and dest alignments. ( rL323597 )
Step 3) Update Clang to use the new IRBuilder API. ( rC323617 )
Step 4) Update Polly to use the new IRBuilder API. ( rL323618 )
Step 5) Update LLVM passes that create memcpy/memmove calls to use the new IRBuilder API,
and those that use use MemIntrinsicInst::[get|set]Alignment() to use [get|set]DestAlignment()
and [get|set]SourceAlignment() instead. ( rL323886, rL323891, rL324148, rL324273, rL324278,
rL324384, rL324395, rL324402, rL324626, rL324642, rL324653, rL324654, rL324773, rL324774,
rL324781, rL324784, rL324955, rL324960, rL325816, rL327398, rL327421, rL328097 )
Step 6) Remove the single-alignment IRBuilder API for memcpy/memmove, and the
MemIntrinsicInst::[get|set]Alignment() methods.

Reference
   http://lists.llvm.org/pipermail/llvm-dev/2015-August/089384.html
   http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20151109/312083.html

llvm-svn: 328317

6 years ago[SLP] Stop counting cost of gather sequences with multiple uses
Matthew Simpson [Fri, 23 Mar 2018 14:18:27 +0000 (14:18 +0000)]
[SLP] Stop counting cost of gather sequences with multiple uses

When building the SLP tree, we look for reuse among the vectorized tree
entries. However, each gather sequence is represented by a unique tree entry,
even though the sequence may be identical to another one. This means, for
example, that a gather sequence with two uses will be counted twice when
computing the cost of the tree. We should only count the cost of the definition
of a gather sequence rather than its uses. During code generation, the
redundant gather sequences are emitted, but we optimize them away with CSE. So
it looks like this problem just affects the cost model.

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

llvm-svn: 328316

6 years agoRemove deprecated MemIntrinsic methods (NFC)
Daniel Neilson [Fri, 23 Mar 2018 14:02:54 +0000 (14:02 +0000)]
Remove deprecated MemIntrinsic methods (NFC)

Summary:
This change is part of step six in the series of changes to remove
the alignment argument from memcpy/memmove/memset in favour of
alignment attributes. At this point all uses of
MemIntrinsicInst::[get|set]Alignment() have been updated, so we now
remove these methods entirely to discourage their use.

Steps:
Step 1) Remove alignment parameter and create alignment parameter attributes for
memcpy/memmove/memset. ( rL322965, rC322964, rL322963 )
Step 2) Expand the IRBuilder API to allow creation of memcpy/memmove with differing
source and dest alignments. ( rL323597 )
Step 3) Update Clang to use the new IRBuilder API. ( rC323617 )
Step 4) Update Polly to use the new IRBuilder API. ( rL323618 )
Step 5) Update LLVM passes that create memcpy/memmove calls to use the new IRBuilder API,
and those that use use MemIntrinsicInst::[get|set]Alignment() to use [get|set]DestAlignment()
and [get|set]SourceAlignment() instead. ( rL323886, rL323891, rL324148, rL324273, rL324278,
rL324384, rL324395, rL324402, rL324626, rL324642, rL324653, rL324654, rL324773, rL324774,
rL324781, rL324784, rL324955, rL324960, rL325816, rL327398, rL327421, rL328097 )
Step 6) Remove the single-alignment IRBuilder API for memcpy/memmove, and the
MemIntrinsicInst::[get|set]Alignment() methods.

Reference
   http://lists.llvm.org/pipermail/llvm-dev/2015-August/089384.html
   http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20151109/312083.html

llvm-svn: 328315

6 years ago[DEBUGINFO] Add flag for DWARF2 to use sections as references.
Alexey Bataev [Fri, 23 Mar 2018 13:35:54 +0000 (13:35 +0000)]
[DEBUGINFO] Add flag for DWARF2 to use sections as references.

Summary:
Some targets does not support labels inside debug sections, but support
references in form `section+offset`. Patch adds initial support
for this.

Reviewers: echristo, probinson, jlebar

Subscribers: llvm-commits, JDevlieghere

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

llvm-svn: 328314

6 years ago[ARM] Support float literals under XO
Christof Douma [Fri, 23 Mar 2018 13:02:03 +0000 (13:02 +0000)]
[ARM] Support float literals under XO

When targeting execute-only and fp-armv8, float constants in a compare
resulted in instruction selection failures. This is now fixed by using
vmov.f32 where possible, otherwise the floating point constant is
lowered into a integer constant that is moved into a floating point
register.

This patch also restores using fpcmp with immediate 0 under fp-armv8.

Change-Id: Ie87229706f4ed879a0c0cf66631b6047ed6c6443
llvm-svn: 328313

6 years agoRevert r328307: [IPSCCP] Use constant range information for comparisons of parameters.
Florian Hahn [Fri, 23 Mar 2018 12:49:39 +0000 (12:49 +0000)]
Revert r328307: [IPSCCP] Use constant range information for comparisons of parameters.

Reverted for now, due to it causing verifier failures.

llvm-svn: 328312

6 years ago[GlobalISel] Fix legalizer combine to not use illegal input G_EXTRACT.
Amara Emerson [Fri, 23 Mar 2018 12:48:57 +0000 (12:48 +0000)]
[GlobalISel] Fix legalizer combine to not use illegal input G_EXTRACT.

This was being masked because GISel is enabled by default for -O0 and
the abort was disabled. Modified test to explicitly enable abort.

llvm-svn: 328311

6 years ago[test] Allow for optional No-Op Barrier Pass in O0 pipeline
Matthew Simpson [Fri, 23 Mar 2018 12:47:54 +0000 (12:47 +0000)]
[test] Allow for optional No-Op Barrier Pass in O0 pipeline

llvm-svn: 328310

6 years ago[X86][Znver1] Fix instregex entries that don't match any instructions (D44687)
Simon Pilgrim [Fri, 23 Mar 2018 12:08:23 +0000 (12:08 +0000)]
[X86][Znver1] Fix instregex entries that don't match any instructions (D44687)

Reviewed by @GGanesh and @craig.topper

llvm-svn: 328309

6 years ago[X86][SandyBridge] Fix missing comma that was causing string concatenation of 2 instr...
Simon Pilgrim [Fri, 23 Mar 2018 11:56:38 +0000 (11:56 +0000)]
[X86][SandyBridge] Fix missing comma that was causing string concatenation of 2 instregex entries

Found while updating D44687

llvm-svn: 328308

6 years ago[IPSCCP] Use constant range information for comparisons of parameters.
Florian Hahn [Fri, 23 Mar 2018 11:56:00 +0000 (11:56 +0000)]
[IPSCCP] Use constant range information for comparisons of parameters.

For comparisons with parameters, we can use the ParamState lattice
elements which also provide constant range information. This improves
the code for PR33253 further and gets us closer to use
ValueLatticeElement for all values.

Also, as we are using the range information in the solver directly, we
do not need tryToReplaceWithConstantRange afterwards anymore.

Reviewers: dberlin, mssimpso, davide, efriedma

Reviewed By: mssimpso

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

llvm-svn: 328307

6 years ago[llvm-mca] Pass the InstrBuilder to the constructor of Backend.
Andrea Di Biagio [Fri, 23 Mar 2018 11:50:43 +0000 (11:50 +0000)]
[llvm-mca] Pass the InstrBuilder to the constructor of Backend.

This is done in preparation for the fix for PR36784.
No functional change.

llvm-svn: 328306

6 years ago[llvm-mca] Add flag -resource-pressure to enable/disable printing of the resource...
Andrea Di Biagio [Fri, 23 Mar 2018 11:33:09 +0000 (11:33 +0000)]
[llvm-mca] Add flag -resource-pressure to enable/disable printing of the resource pressure view.

By default, the tool always enables the resource pressure view.
This flag lets user specify whether they want to add that view or not.

llvm-svn: 328305

6 years ago[X86][Btver2] Vector move/load/store instructions use a JFPU01 scheduler pipe and...
Simon Pilgrim [Fri, 23 Mar 2018 11:27:31 +0000 (11:27 +0000)]
[X86][Btver2] Vector move/load/store instructions use a JFPU01 scheduler pipe and JFPX/JVALU function unit as well as the AGUs

llvm-svn: 328304

6 years ago[AArch64] Clean-up a few over-eager regexps in models.
Florian Hahn [Fri, 23 Mar 2018 11:00:42 +0000 (11:00 +0000)]
[AArch64] Clean-up a few over-eager regexps in models.

Patch by Simon Pilgrim <llvm-dev@redking.me.uk>

That is a slightly modified version of the AArch64 changes from
Simon's D44687 .

llvm-svn: 328303

6 years ago[clangd] Remove 'static' from a function inside anonymous ns. NFC
Ilya Biryukov [Fri, 23 Mar 2018 10:39:15 +0000 (10:39 +0000)]
[clangd] Remove 'static' from a function inside anonymous ns. NFC

llvm-svn: 328302

6 years ago[LoopUnroll] Simplify induction variables after peeling too.
Florian Hahn [Fri, 23 Mar 2018 10:38:12 +0000 (10:38 +0000)]
[LoopUnroll] Simplify induction variables after peeling too.

Loop peeling also has an impact on the induction variables, so we should
benefit from induction variable simplification after peeling too.

Reviewers: sanjoy, bogner, mzolotukhin, efriedma

Reviewed By: efriedma

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

llvm-svn: 328301

6 years ago[ORC] Join materialization thread in unit test
Benjamin Kramer [Fri, 23 Mar 2018 10:14:19 +0000 (10:14 +0000)]
[ORC] Join materialization thread in unit test

There's are race between this thread and the destructor of the test ORC
components on the main threads. I saw flaky failures there in about 4%
of the runs of this unit test.

llvm-svn: 328300

6 years ago[ELF] - Another fix for "LLD crashes with --emit-relocs when trying to proccess ...
George Rimar [Fri, 23 Mar 2018 09:18:31 +0000 (09:18 +0000)]
[ELF] - Another fix for "LLD crashes with --emit-relocs when trying to proccess .eh_frame"

This fixes PR36367 which is about segfault when --emit-relocs is
used together with .eh_frame sections which happens because
of reordering of regular and .rel[a] sections.

Path changes loop that iterates over input sections to create
relocation target sections first.

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

llvm-svn: 328299

6 years ago[ARM] Error out on .arm assembler directives on windows
Martin Storsjo [Fri, 23 Mar 2018 09:10:03 +0000 (09:10 +0000)]
[ARM] Error out on .arm assembler directives on windows

Windows on arm is thumb only.

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

llvm-svn: 328298

6 years agoRevert "[DAGCombiner] Fold (zext (and/or/xor (shl/shr (load x), cst), cst))"
Martin Storsjo [Fri, 23 Mar 2018 08:36:47 +0000 (08:36 +0000)]
Revert "[DAGCombiner] Fold (zext (and/or/xor (shl/shr (load x), cst), cst))"

This reverts commit r328252. This change broke building a number
of projects when targeting ARM and AArch64, see PR36873.

llvm-svn: 328297

6 years ago[X86] Give VPCMPEQQ the same itinerary as its SSE counterpart.
Craig Topper [Fri, 23 Mar 2018 06:58:55 +0000 (06:58 +0000)]
[X86] Give VPCMPEQQ the same itinerary as its SSE counterpart.

llvm-svn: 328296

6 years ago[X86] Correct the latencies of SNB integer vector multiplies based on Agner's data...
Craig Topper [Fri, 23 Mar 2018 06:41:43 +0000 (06:41 +0000)]
[X86] Correct the latencies of SNB integer vector multiplies based on Agner's data. Add missing MMX multiplies.

llvm-svn: 328295

6 years ago[X86] Match vpblendvb/vblendvps/vblendvpd itineraries to the SSE equivalent. Change...
Craig Topper [Fri, 23 Mar 2018 06:41:41 +0000 (06:41 +0000)]
[X86] Match vpblendvb/vblendvps/vblendvpd itineraries to the SSE equivalent. Change pblendvb/blendvps/blendvpd to use WriteFVarBlend

llvm-svn: 328294

6 years ago[X86] Change VPSADBW itinerary to SSE_INTALU_ITINS_P to match the SSE version.
Craig Topper [Fri, 23 Mar 2018 06:41:40 +0000 (06:41 +0000)]
[X86] Change VPSADBW itinerary to SSE_INTALU_ITINS_P to match the SSE version.

llvm-svn: 328293

6 years ago[X86] Give VLDDQUrm and LDDQUrm the same itinerary.
Craig Topper [Fri, 23 Mar 2018 06:41:39 +0000 (06:41 +0000)]
[X86] Give VLDDQUrm and LDDQUrm the same itinerary.

llvm-svn: 328292

6 years ago[X86] Merge VMOVMSKBrr and MOVMSKBrr in the SNB sheduler model.
Craig Topper [Fri, 23 Mar 2018 06:41:38 +0000 (06:41 +0000)]
[X86] Merge VMOVMSKBrr and MOVMSKBrr in the SNB sheduler model.

The VMOVMSKBrr was in a separate InstRW with a lower latency, but I assume they should be the same and the higher latency matches Agners table so I'm going with that.

llvm-svn: 328291

6 years ago[X86] Add VEXTRB/W/D/Q to Zen scheduler model.
Craig Topper [Fri, 23 Mar 2018 06:41:36 +0000 (06:41 +0000)]
[X86] Add VEXTRB/W/D/Q to Zen scheduler model.

The SSE versions were present, but not the VEX version.

llvm-svn: 328290

6 years ago[X86] Fix the itinerary for vextractps to match extractps.
Craig Topper [Fri, 23 Mar 2018 06:41:35 +0000 (06:41 +0000)]
[X86] Fix the itinerary for vextractps to match extractps.

llvm-svn: 328289

6 years agoBring r328238 back with a fix.
Rafael Espindola [Fri, 23 Mar 2018 01:36:23 +0000 (01:36 +0000)]
Bring r328238 back with a fix.

The issues was that we were setting hidden visibility if, when
processing a hidden class, we found out that we needed to emit a
reference to a vtable provided by the standard library.

Original message:

Set dso_local on vtables.

llvm-svn: 328288

6 years ago[DAG] Fix node id invalidation in Instruction Selection.
Nirav Dave [Fri, 23 Mar 2018 01:22:39 +0000 (01:22 +0000)]
[DAG] Fix node id invalidation in Instruction Selection.

Invalidation should be bit negation. Add missing negation.

llvm-svn: 328287

6 years agoRemove problematic PrettyStackTrace entry added in r328276
Jordan Rose [Fri, 23 Mar 2018 01:12:09 +0000 (01:12 +0000)]
Remove problematic PrettyStackTrace entry added in r328276

I'm not sure /why/ this is causing issues for libclang, but it is.
Unbreak the buildbots since it's already consumed an hour of my time.

llvm-svn: 328286

6 years agoFix the MSVC build.
Rafael Espindola [Fri, 23 Mar 2018 00:42:47 +0000 (00:42 +0000)]
Fix the MSVC build.

llvm-svn: 328285

6 years agoFix PR36793.
Rafael Espindola [Fri, 23 Mar 2018 00:35:27 +0000 (00:35 +0000)]
Fix PR36793.

With this patch lld will iterate over compile units to find the line
tables instead of assuming there is only one at offset 0.

llvm-svn: 328284

6 years ago[Modules] Update test to mention it requires C++14.
Volodymyr Sapsai [Fri, 23 Mar 2018 00:16:06 +0000 (00:16 +0000)]
[Modules] Update test to mention it requires C++14.

llvm-svn: 328283

6 years ago[analyzer] Trust _Nonnull annotations for system framework
George Karpenkov [Fri, 23 Mar 2018 00:16:03 +0000 (00:16 +0000)]
[analyzer] Trust _Nonnull annotations for system framework

Changes the analyzer to believe that methods annotated with _Nonnull
from system frameworks indeed return non null objects.
Local methods with such annotation are still distrusted.
rdar://24291919

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

llvm-svn: 328282

6 years ago[analyzer] Extend GCDAntipatternChecker to match group_enter/group_leave pattern
George Karpenkov [Fri, 23 Mar 2018 00:16:02 +0000 (00:16 +0000)]
[analyzer] Extend GCDAntipatternChecker to match group_enter/group_leave pattern

rdar://38480416

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

llvm-svn: 328281