158953 Commits

Author SHA1 Message Date
Benjamin Kramer
2dfb403481 Creating branches/google/stable and tags/google/stable/2018-01-11 from r321963
git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/google/stable@322302 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-11 18:20:17 +00:00
Hal Finkel
f0c5b1c6c7 [LV][VPlan] NFC patch to move LoopVectorizationPlanner class out of LoopVectorize.cpp
Another small step forward to move VPlan stuff outside of LoopVectorize.cpp.

VPlanBuilder.h is renamed to LoopVectorizationPlanner.h
LoopVectorizationPlanner class is moved from LoopVectorize.cpp to
LoopVectorizationPlanner.h LoopVectorizationCostModel::VectorizationFactor
class is moved to LoopVectorizationPlanner.h (used by the planner class) ---
this needs further streamlining work in later patches and thus all I did was
take it out of the CostModel class and moved to the header file.  The callback
function had to stay inside LoopVectorize.cpp since it calls an
InnerLoopVectorizer member function declared in it.  Next Steps: Make
InnerLoopVectorizer, LoopVectorizationCostModel, and other classes more modular
and more aligned with VPlan direction, in small increments.

Previous step was: r320900 (https://reviews.llvm.org/D41045)

Patch by Hideki Saito, thanks!

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321962 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-07 16:02:58 +00:00
Florian Hahn
8eaf38e0eb [CodeExtractor] Use subset of function attributes for extracted function.
In addition to target-dependent attributes, we can also preserve a
white-listed subset of target independent function attributes. The white-list
excludes problematic attributes, most prominently:

* attributes related to memory accesses, as alloca instructions
  could be moved in/out of the extracted block

* control-flow dependent attributes, like no_return or thunk, as the
  relerelevant instructions might or might not get extracted.

Thanks @efriedma and @aemerson for providing a set of attributes that cannot be
propagated.


Reviewers: efriedma, davidxl, davide, silvas

Reviewed By: efriedma

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321961 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-07 11:22:25 +00:00
Craig Topper
3f6f6c2f6d [PowerPC] Add an ISD::TRUNCATE to the legalization for ppc_is_decremented_ctr_nonzero
Summary:
I believe legalization is really expecting that ReplaceNodeResults will return something with the same type as the thing that's being legalized. Ultimately, it uses the output to replace the uses in the DAG so the type should match to make that work.

There are two relevant cases here. When crbits are enabled, then i1 is a legal type and getSetCCResultType should return i1. In this case, the truncate will be between i1 and i1 and should be removed (SelectionDAG::getNode does this). Otherwise, getSetCCResultType will be i32 and the legalizer will promote the truncate to be i32 -> i32 which will be similarly removed.

With this fixed we can remove some code from PromoteIntRes_SETCC that seemed to only exist to deal with the intrinsic being replaced with a larger type without changing the other operand. With the truncate being used for connectivity this doesn't happen anymore.

Reviewers: hfinkel

Reviewed By: hfinkel

Subscribers: nemanjai, llvm-commits, kbarton

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321959 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-07 07:51:36 +00:00
Craig Topper
f8f7710cb8 [X86] Add the 16 and 8-bit CRC32 instructions to the load folding tables.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321958 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-07 06:48:20 +00:00
Craig Topper
de0191914f [X86] Correct the load folding flags for xmm fp->mmx conversion instructions.
The instructions that load 64-bits or an xmm register should be TB_NO_REVERSE to avoid the load being widened during unfold. The instructions that load 128-bits need to ensure 128-bit alignment.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321956 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-07 06:24:30 +00:00
Craig Topper
5faf7a61e0 [X86] Add TB_NO_REVERSE to some scalar intrinsic instructions in the load folding table.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321955 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-07 06:24:29 +00:00
Craig Topper
a325c91bc7 [X86] Don't put any EVEX_B instructions in the tablegen generated load folding tables.
EVEX_B means different things for memory and register forms. The instructions should not be considered equivalent.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321954 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-07 06:24:28 +00:00
Craig Topper
82ce446218 [X86] Add 128 and 256-bit VPOPCNTD/Q instructions to load folding tables.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321953 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-07 06:24:27 +00:00
Craig Topper
f43fba24c5 [X86] Add some 8 and 16-bit instructions to the load folding tables.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321952 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-07 06:24:25 +00:00
Craig Topper
c303d203b8 [X86] Add EVEX vcvtph2ps to the load folding tables.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321951 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-07 06:24:24 +00:00
Craig Topper
1d84174569 [X86] Remove cvtps2ph xmm->xmm from store folding tables. Add the evex versions of cvtps2ph to the store folding tables.
The memory form of the xmm->xmm version only writes 64-bits. If we use it in the folding tables and its get used for a stack spill, only half the slot will be written. Then a reload may read all 128-bits which will pull in garbage. But without the spill the upper bits of the register would have been zero. By not folding we would preserve the zeros.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321950 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-07 06:24:23 +00:00
Craig Topper
72bb1a1f8b [X86] Add CMP8ri8 to load folding tables.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321949 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-07 06:24:21 +00:00
Craig Topper
586db08a0c [X86] Remove assembler predicates from all AVX512 related feature flags.
We don't do fine grained feature control like this on features prior to AVX512.

We do still have checks in place in the assembly parser itself that prevents %zmm references or %xmm16-31 from being parsed without at least -mattr=avx512f. Same for rounding control and mask operands. That will prevent the table matcher from matching for any instructions that need those features and that's probably good enough.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321947 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-06 21:45:30 +00:00
Craig Topper
d71f891c9b [X86] Remove memory forms of EVEX encoded vcvttss2si/vcvttsd2si from asm matcher table.
This is also needed to fix PR35837.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321946 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-06 21:27:25 +00:00
Craig Topper
fb75f48283 [X86] Add load folding pattern to EVEX vcvttss2si/vcvtsd2si.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321945 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-06 21:02:26 +00:00
Craig Topper
b2ac80f2c2 [X86] Remove an unnecessary VCVTTSD2SIrrb/VCVTSS2SIrrb instruction with no isel pattern that only existed for the assembler. Use VCVTTSD2SIrrb_Int instead.
For consistency use the _Int version of VCVTTSD2SIrr_Int and VCVTTSD2SIrm_Int for the assembler as well.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321944 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-06 21:02:22 +00:00
Florian Hahn
bb854af99f [InlineFunction] Preserve calling convention when forwarding VarArgs.
Reviewers: efriedma, rnk, davide

Reviewed By: rnk, davide

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321943 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-06 20:56:27 +00:00
Florian Hahn
d9fc780bef [InlineFunction] Preserve attributes when forwarding VarArgs.
Reviewers: rnk, efriedma

Reviewed By: rnk

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321942 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-06 20:46:00 +00:00
Lang Hames
f8f6c8dfc7 [ORC] Remove AsynchronousSymbolQuery while I debug an issue on one of the
builders.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321941 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-06 20:14:22 +00:00
Florian Hahn
7b0cf7929a [InlineFunction] Inline vararg functions that do not access varargs.
If the varargs are not accessed by a function, we can inline the
function.

Reviewers: dblaikie, chandlerc, davide, efriedma, rnk, hfinkel

Reviewed By: efriedma

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321940 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-06 19:45:40 +00:00
Craig Topper
d9c9e989f5 [X86] Remove memory forms of EVEX encoded vcvtsd2si/vcvtss2si from the assembler matcher table
We should always prefer the VEX encoded version of these instructions. There is no advantage to the EVEX version.

Fixes PR35837.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321939 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-06 19:20:33 +00:00
Craig Topper
baa93cde89 [TableGen] Make the ambiguous match debug messages from the AsmMatcherEmitter slightly more useful.
Don't report ambiguous matches on different variants. Print the variant number in the output.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321938 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-06 19:20:32 +00:00
Sanjay Patel
536ffae2c4 [InstCombine] relax use constraint for min/max (~a, ~b) --> ~min/max(a, b)
In the minimal case, this won't remove instructions, but it still improves
uses of existing values.

In the motivating example from PR35834, it does remove instructions, and
sets that case up to be optimized by something like D41603:
https://reviews.llvm.org/D41603


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321936 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-06 17:34:22 +00:00
Sanjay Patel
82c67ea483 [InstCombine] add more tests for max(~a, ~b) and PR35834; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321935 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-06 17:14:46 +00:00
Sanjay Patel
df87029dcf [x86, MemCmpExpansion] allow 2 pairs of loads per block (PR33325)
This is the last step needed to fix PR33325:
https://bugs.llvm.org/show_bug.cgi?id=33325

We're trading branch and compares for loads and logic ops. 
This makes the code smaller and hopefully faster in most cases.

The 24-byte test shows an interesting construct: we load the trailing scalar 
elements into vector registers and generate the same pcmpeq+movmsk code that 
we expected for a pair of full vector elements (see the 32- and 64-byte tests).

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321934 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-06 16:16:04 +00:00
Craig Topper
0179ddc7fa [X86] Rename the EVEX encoded GFNI instructions to start with a 'V'. NFC
This makes the names consistent with the mnemonics like every other instruction.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321931 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-06 07:18:08 +00:00
Craig Topper
c161097e5f [X86] When parsing rounding mode operands, provide a proper end location so we don't crash when trying to print an error message using it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321930 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-06 06:41:07 +00:00
Craig Topper
5013a6d16e [X86] Call lowerShuffleAsRepeatedMaskAndLanePermute from lowerV4I64VectorShuffle.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321929 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-06 06:08:04 +00:00
Craig Topper
ee663094e4 [X86] Run dos2unix on a test file. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321928 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-06 06:08:02 +00:00
Lang Hames
173be72e84 [ORC] Yet more debugging output to diagnose test failures.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321927 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-06 05:19:07 +00:00
Lang Hames
be7a10d44b [ORC] Fix the counter type on SymbolStringPool entries.
Hopefully this will fix the build failure in
http://lab.llvm.org:8011/builders/llvm-mips-linux/builds/3417

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321926 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-06 05:19:06 +00:00
Lang Hames
05ff361a4f [ORC] More debugging output to track down tester failures.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321925 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-06 04:35:51 +00:00
Lang Hames
972c9575f0 [ORC] Temporarily adding some redundant asserts / debug output to aid in
debugging a tester failure.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321920 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-06 01:06:07 +00:00
Lang Hames
adae88fe6f [ORC] Fix a think-o in the current AsynchronousSymbolQuery test.
This *should* be a no-op as far as the current failure is concerned, but needs
to be fixed anyway.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321919 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-06 01:06:05 +00:00
Vedant Kumar
0434c3b4d6 [Debugify] Handled unsized types
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321918 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-06 00:37:01 +00:00
Vedant Kumar
a9f4d0d67c [Utils] Simplify salvageDebugInfo, NFCI
Having a single call to findDbgUsers() allows salvageDebugInfo() to
return earlier.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321915 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-05 23:27:02 +00:00
Craig Topper
cd244770af [X86] Add vcvtsd2sil/vcvtsd2siq etc. InstAliases to the EVEX-encoded instructions.
This matches their VEX equivalents.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321912 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-05 23:13:54 +00:00
Adrian McCarthy
ced21a6948 Re-land "Fix faulty assertion in debug info"
This had been reverted because the new test failed on non-X86 bots.  I moved
the new test to the appropriate subdirectory to correct this.

Differential Revision: https://reviews.llvm.org/D41264
Original submission:  r321122 (which was reverted by r321125)

This reverts commit 3c1639b5703c387a0d8cba2862803b4e68dff436.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321911 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-05 23:01:04 +00:00
Lang Hames
cac7dd493a [ORC] Re-apply just the AsynchronousSymbolLookup class from r321838 while I
investigate builder / test failures.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321910 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-05 22:50:43 +00:00
Krzysztof Parzyszek
ac780ae7ed [Hexagon] Even simpler patterns for sign- and zero-extending HVX vectors
Recommit r321897 with updated testcases.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321908 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-05 22:31:11 +00:00
Bjorn Pettersson
39ebb68152 [DebugInfo] Align comments in debug_loc section
Summary:
This commit updates the BufferByteStreamer, used by DebugLocStream
to buffer bytes/comments to put in the debug_loc section, to
make sure that the Buffer and Comments vectors are synced.
Previously, when an SLEB128 or ULEB128 was emitted together with
a comment, the vectors could be out-of-sync if the LEB encoding
added several entries to the Buffer vectors, while we only added
a single entry to the Comments vector.

The goal with this is to get the comments in the debug_loc
section in the .s file correctly aligned.

Example (using ARM as target):
Instead of

  .byte 144                     @ sub-register DW_OP_regx
  .byte 128                     @ 256
  .byte 2                       @ DW_OP_piece
  .byte 147                     @ 8
  .byte 8                       @ sub-register DW_OP_regx
  .byte 144                     @ 257
  .byte 129                     @ DW_OP_piece
  .byte 2                       @ 8
  .byte 147                     @
  .byte 8                       @

we now get

  .byte 144                     @ sub-register DW_OP_regx
  .byte 128                     @ 256
  .byte 2                       @
  .byte 147                     @ DW_OP_piece
  .byte 8                       @ 8
  .byte 144                     @ sub-register DW_OP_regx
  .byte 129                     @ 257
  .byte 2                       @
  .byte 147                     @ DW_OP_piece
  .byte 8                       @ 8

Reviewers: JDevlieghere, rnk, aprantl

Reviewed By: aprantl

Subscribers: davide, Ka-Ka, uabelho, aemerson, javed.absar, kristof.beyls, llvm-commits, JDevlieghere

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321907 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-05 22:20:30 +00:00
Zachary Turner
135e942bcb Fix some opt-viewer test issues and disable on Windows.
Differential Revision: https://reviews.llvm.org/D41784

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321905 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-05 22:05:13 +00:00
Krzysztof Parzyszek
2dd4edf571 Revert r321894: it requires a part of another commit that is not ready yet
Commit message:
[Hexagon] Add patterns for sext_inreg of HVX vector types


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321904 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-05 21:57:43 +00:00
Craig Topper
510c34022e [X86] Add InstAliases for 'vmovd' with GR64 registers to select EVEX encoded instructions as well.
Without this we allow "vmovd %rax, %xmm0", but not "vmovd %rax, %xmm16"

This exists due to continue a silly bug where really old versions of the GNU assembler required movd instead of movq on these instructions. This compatibility hack then crept forward to avx version too, but we didn't propagate it to avx512.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321903 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-05 21:57:23 +00:00
Krzysztof Parzyszek
96332f0c46 Revert r321897: affected testcases were not updated
Commit message:
[Hexagon] Even simpler patterns for sign- and zero-extending HVX vectors


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321902 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-05 21:50:15 +00:00
Adrian Prantl
10a0a6794f dwarfdump: Match the --uuid output with that of Darwin dwarfdump.
This option is widely used by scripts and there is no reason to break them.

rdar://problem/36032398

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321901 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-05 21:44:17 +00:00
Craig Topper
c85dd32732 [X86] Stop printing moves between VR64 and GR64 with 'movd' mnemonic. Use 'movq' instead.
This behavior existed to work with an old version of the gnu assembler on MacOS that only accepted this form. Newer versions of GNU assembler and the current LLVM derived version of the assembler on MacOS support movq as well.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321898 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-05 20:55:12 +00:00
Krzysztof Parzyszek
5def6c03b6 [Hexagon] Even simpler patterns for sign- and zero-extending HVX vectors
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321897 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-05 20:49:26 +00:00
Krzysztof Parzyszek
dcbe415819 [Hexagon] Add patterns for truncating HVX vector types
Only non-bool vectors.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321895 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-05 20:48:03 +00:00