Commit Graph

157575 Commits

Author SHA1 Message Date
Simon Pilgrim 6d9ac1b1eb [X86] Replace tabs with spaces. NFCI.
llvm-svn: 320065
2017-12-07 17:55:19 +00:00
Simon Pilgrim 386b23f1fa [X86] Tag BMI/BMI2/TBM instructions scheduler classes
Put these under UNARY/BINOP ALU itinerary classes for now - seems to be a good average value

llvm-svn: 320064
2017-12-07 17:37:39 +00:00
Krzysztof Parzyszek 039d4d9286 [Hexagon] Generate HVX code for basic arithmetic operations
Handle and, or, xor, add, sub, mul for vectors of i8, i16, and i32.

llvm-svn: 320063
2017-12-07 17:37:28 +00:00
Simon Pilgrim d2e93e76b8 [X86][TBM] Add TBM scheduling tests
llvm-svn: 320062
2017-12-07 17:23:00 +00:00
Francis Visoiu Mistrih e6fc3ce470 [CodeGen] Fix index when printing tied machine operands
llvm-svn: 320061
2017-12-07 17:12:30 +00:00
Craig Topper 5db260fca4 [X86] Rename function in recently added test case to not be 'main' returning 'void'. NFC
llvm-svn: 320059
2017-12-07 17:02:49 +00:00
Davide Italiano f6e180d523 [DebugInfo] Move this test to X86/ now that it specifies a triple.
Should bring back the arm/arm64 bots. Reported by Yvan Roux.

llvm-svn: 320057
2017-12-07 16:10:39 +00:00
Simon Pilgrim 2983b46973 [X86] Tag SALC instructions scheduler class
Treat these the same as LAHF/SAHF (although its not a x86_64 instruction)

llvm-svn: 320055
2017-12-07 16:07:06 +00:00
Simon Pilgrim ffce0d8fbc [X86] Add LAHF/SAHF scheduling test
llvm-svn: 320054
2017-12-07 16:04:20 +00:00
Simon Pilgrim a13271bcba [X86][VMX] Tag VMX instructions scheduler classes
Tagged all as system instructions

llvm-svn: 320053
2017-12-07 15:57:32 +00:00
Simon Pilgrim a383f84233 [X86] Add SALC scheduling test
llvm-svn: 320052
2017-12-07 15:46:58 +00:00
Simon Pilgrim f1d599adb2 [X86] Tag LZCNT/TZCNT instructions scheduler classes
Tagged as IMUL instructions for a reasonable approximation (ALU tends to be a lot faster) - POPCNT is currently tagged as FAdd which I think should be replaced with IMUL as well

llvm-svn: 320051
2017-12-07 15:24:14 +00:00
Sanjay Patel 9012391af1 [DAGCombiner] eliminate shuffle of insert element
I noticed this pattern in D38316 / D38388. We failed to combine a shuffle that is either 
repeating a scalar insertion at the same position in a vector or translated to a different 
element index.

Like the earlier patch, this could be an instcombine too, but since we opted to make this 
a DAG transform earlier, I've made this one a DAG patch too.

We do not need any legality checking because the new insert is identical to the existing 
insert except that it may have a different constant insertion operand.

The constant insertion test in test/CodeGen/X86/vector-shuffle-combining.ll was the 
motivation for D38756.

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

llvm-svn: 320050
2017-12-07 15:17:58 +00:00
Igor Laevsky 4a4f2e8c67 [InstCombine] Don't crash on out of bounds index in the insertelement
Differential Revision: https://reviews.llvm.org/D40390

llvm-svn: 320049
2017-12-07 15:00:52 +00:00
Simon Pilgrim ff5212091a [X86][FMA] Regenerate fma schedule tests
llvm-svn: 320048
2017-12-07 14:51:47 +00:00
Simon Pilgrim 6b7cd86ca7 [X86][SVM] Tag SVM instructions scheduler classes
Tagged all as system instructions

llvm-svn: 320047
2017-12-07 14:35:17 +00:00
Francis Visoiu Mistrih 567611ef23 [CodeGen] Use more getMFIfAvailable
llvm-svn: 320046
2017-12-07 14:32:15 +00:00
Simon Pilgrim 60411d9a8c [X86] Tag RDRAND/RDSEED instruction scheduler classes
llvm-svn: 320045
2017-12-07 14:18:48 +00:00
Simon Pilgrim bd5f7455a2 [X86][X87] X87 math binop pseudo instructions don't need scheduling info
llvm-svn: 320044
2017-12-07 14:07:18 +00:00
Simon Pilgrim ca63dcce7f [X86][SSE42] SSE42 string pseudo instructions don't need scheduling info
llvm-svn: 320043
2017-12-07 13:52:07 +00:00
Simon Pilgrim 9a2898ed22 [X86] Regenerate RDTSC codegen tests
llvm-svn: 320042
2017-12-07 13:50:29 +00:00
Dan Gohman cdaa87dd2e [WebAssemby] Support main functions with alternate signatures.
WebAssembly requires caller and callee signatures to match, so the usual
C runtime trick of calling main and having it just work regardless of
whether main is defined as '()' or '(int argc, char *argv[])' doesn't
work. Extend the FixFunctionBitcasts pass to rewrite main to use the
latter form.

llvm-svn: 320041
2017-12-07 13:49:27 +00:00
Simon Pilgrim 439679c085 [X86][RDSEED] Add rdseed scheduling tests
llvm-svn: 320040
2017-12-07 13:47:17 +00:00
Simon Pilgrim eb87fe62ec [X86][RDRAND] Add rdrand scheduling tests
llvm-svn: 320039
2017-12-07 13:46:47 +00:00
Alex Bradbury f8f4b90544 [RISCV] MC layer support for the jump/branch instructions of the RVC extension
Differential Revision: https://reviews.llvm.org/D40002
    
Patch by Shiva Chen.

llvm-svn: 320038
2017-12-07 13:19:57 +00:00
Alex Bradbury 9f6aec4b7a [RISCV] MC layer support for load/store instructions of the C (compressed) extension
Differential Revision: https://reviews.llvm.org/D40001
    
Patch by Shiva Chen.

llvm-svn: 320037
2017-12-07 12:50:32 +00:00
Alex Bradbury 87a54d6110 [RISCV][NFC] Use TargetRegisterClass::hasSubClassEq in storeRegToStackSlot/loadReadFromStackSlot
Simply checking for register class equality will break once additional 
register classes are added (as is done for the RVC instruction set extension).

llvm-svn: 320036
2017-12-07 12:45:05 +00:00
Nikolai Bozhenov 1cf9c54e5c [Nios2] final infrastructure to provide compilation of a return from a function
This patch includes all missing functionality needed to provide first
compilation of a simple program that just returns from a function.
I've added a test case that checks for "ret" instruction printed in assembly
output.

Patch by Andrei Grischenko (andrei.l.grischenko@intel.com)
Differential revision: https://reviews.llvm.org/D39688

llvm-svn: 320035
2017-12-07 12:35:02 +00:00
Andrew V. Tischenko 44cfc51415 Add proper BTVER2 sched support for MOV instr.
Differential Revision: https://reviews.llvm.org/D40345

llvm-svn: 320034
2017-12-07 11:19:49 +00:00
Jonas Devlieghere e385d00960 [dsymutil] Add -verify option to run DWARF verifier after linking.
This patch adds support for running the DWARF verifier on the linked
debug info files. If the -verify options is specified and verification
fails, dsymutil exists with abort with non-zero exit code. This behavior
is *not* enabled by default.

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

llvm-svn: 320033
2017-12-07 11:17:19 +00:00
Igor Laevsky e8a3475b89 [FuzzMutate] Allow only sized pointers for the GEP instruction
Differential Revision: https://reviews.llvm.org/D40837

llvm-svn: 320032
2017-12-07 11:10:11 +00:00
Alex Bradbury 72281a228b [RISCV] Add missed tests for RV64D MC layer support
Add tests missed in r320029.

llvm-svn: 320031
2017-12-07 11:05:38 +00:00
Alex Bradbury ee8950efd5 [RISCV] MC layer support for the standard RV64D instruction set extension
llvm-svn: 320029
2017-12-07 11:04:18 +00:00
Alex Bradbury 4dd94e0ccd [RISCV] MC layer support for the standard RV64F instruction set extension
llvm-svn: 320028
2017-12-07 11:02:55 +00:00
Alex Bradbury 48f95a655d [RISCV] MC layer support for the standard RV64A instruction set extension
llvm-svn: 320027
2017-12-07 10:59:12 +00:00
Alex Bradbury 81def7224e [RISCV] MC layer support for the standard RV64M instruction set extension
llvm-svn: 320026
2017-12-07 10:56:07 +00:00
Pavel Labath e8354fe606 [Testing/Support] Make matchers work with Expected<T&>
Summary:
This did not work because the ExpectedHolder was trying to hold the
value in an Optional<T*>. Instead of trying to mimic the behavior of
Expected and try to make ExpectedHolder work with references and
non-references, I simply store the reference to the Expected object in
the holder.

I also add a bunch of tests for these matchers, which have helped me
flesh out some problems in my initial implementation of this patch, and
uncovered the fact that we are not consistent in quoting our values in
the matcher output (which I also fix).

Reviewers: zturner, chandlerc

Subscribers: mgorny, llvm-commits

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

llvm-svn: 320025
2017-12-07 10:54:23 +00:00
Alex Bradbury a6e6248307 [RISCV] MC layer support for the standard RV64I instructions
llvm-svn: 320024
2017-12-07 10:53:48 +00:00
Alex Bradbury 7bc2a95bb9 [RISCV] MC layer support for the standard RV32D instruction set extension
As the FPR32 and FPR64 registers have the same names, use 
validateTargetOperandClass in RISCVAsmParser to coerce a parsed FPR32 to an 
FPR64 when necessary. The rest of this patch is very similar to the RV32F 
patch.

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

llvm-svn: 320023
2017-12-07 10:46:23 +00:00
Francis Visoiu Mistrih a8a83d150f [CodeGen] Use MachineOperand::print in the MIRPrinter for MO_Register.
Work towards the unification of MIR and debug output by refactoring the
interfaces.

For MachineOperand::print, keep a simple version that can be easily called
from `dump()`, and a more complex one which will be called from both the
MIRPrinter and MachineInstr::print.

Add extra checks inside MachineOperand for detached operands (operands
with getParent() == nullptr).

https://reviews.llvm.org/D40836

* find . \( -name "*.mir" -o -name "*.cpp" -o -name "*.h" -o -name "*.ll" -o -name "*.s" \) -type f -print0 | xargs -0 sed -i '' -E 's/kill: ([^ ]+) ([^ ]+)<def> ([^ ]+)/kill: \1 def \2 \3/g'
* find . \( -name "*.mir" -o -name "*.cpp" -o -name "*.h" -o -name "*.ll" -o -name "*.s" \) -type f -print0 | xargs -0 sed -i '' -E 's/kill: ([^ ]+) ([^ ]+) ([^ ]+)<def>/kill: \1 \2 def \3/g'
* find . \( -name "*.mir" -o -name "*.cpp" -o -name "*.h" -o -name "*.ll" -o -name "*.s" \) -type f -print0 | xargs -0 sed -i '' -E 's/kill: def ([^ ]+) ([^ ]+) ([^ ]+)<def>/kill: def \1 \2 def \3/g'
* find . \( -name "*.mir" -o -name "*.cpp" -o -name "*.h" -o -name "*.ll" -o -name "*.s" \) -type f -print0 | xargs -0 sed -i '' -E 's/<def>//g'
* find . \( -name "*.mir" -o -name "*.cpp" -o -name "*.h" -o -name "*.ll" -o -name "*.s" \) -type f -print0 | xargs -0 sed -i '' -E 's/([^ ]+)<kill>/killed \1/g'
* find . \( -name "*.mir" -o -name "*.cpp" -o -name "*.h" -o -name "*.ll" -o -name "*.s" \) -type f -print0 | xargs -0 sed -i '' -E 's/([^ ]+)<imp-use,kill>/implicit killed \1/g'
* find . \( -name "*.mir" -o -name "*.cpp" -o -name "*.h" -o -name "*.ll" -o -name "*.s" \) -type f -print0 | xargs -0 sed -i '' -E 's/([^ ]+)<dead>/dead \1/g'
* find . \( -name "*.mir" -o -name "*.cpp" -o -name "*.h" -o -name "*.ll" -o -name "*.s" \) -type f -print0 | xargs -0 sed -i '' -E 's/([^ ]+)<def[ ]*,[ ]*dead>/dead \1/g'
* find . \( -name "*.mir" -o -name "*.cpp" -o -name "*.h" -o -name "*.ll" -o -name "*.s" \) -type f -print0 | xargs -0 sed -i '' -E 's/([^ ]+)<imp-def[ ]*,[ ]*dead>/implicit-def dead \1/g'
* find . \( -name "*.mir" -o -name "*.cpp" -o -name "*.h" -o -name "*.ll" -o -name "*.s" \) -type f -print0 | xargs -0 sed -i '' -E 's/([^ ]+)<imp-def>/implicit-def \1/g'
* find . \( -name "*.mir" -o -name "*.cpp" -o -name "*.h" -o -name "*.ll" -o -name "*.s" \) -type f -print0 | xargs -0 sed -i '' -E 's/([^ ]+)<imp-use>/implicit \1/g'
* find . \( -name "*.mir" -o -name "*.cpp" -o -name "*.h" -o -name "*.ll" -o -name "*.s" \) -type f -print0 | xargs -0 sed -i '' -E 's/([^ ]+)<internal>/internal \1/g'
* find . \( -name "*.mir" -o -name "*.cpp" -o -name "*.h" -o -name "*.ll" -o -name "*.s" \) -type f -print0 | xargs -0 sed -i '' -E 's/([^ ]+)<undef>/undef \1/g'

llvm-svn: 320022
2017-12-07 10:40:31 +00:00
Alex Bradbury 0d6cf90663 [RISCV] MC layer support for the standard RV32F instruction set extension
The most interesting part of this patch is probably the handling of 
rounding mode arguments. Sadly, the RISC-V assembler handles floating point 
rounding modes as a special "argument" when it would be more consistent to 
handle them like the atomics, opcode suffixes. This patch supports parsing 
this optional parameter, using InstAlias to allow parsing these floating point 
instructions when no rounding mode is specified.

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

llvm-svn: 320020
2017-12-07 10:26:05 +00:00
Alex Bradbury d590c85753 [TableGen] Give the option of tolerating duplicate register names
A number of architectures re-use the same register names (e.g. for both 32-bit 
FPRs and 64-bit FPRs). They are currently unable to use the tablegen'erated 
MatchRegisterName and MatchRegisterAltName, as tablegen (when built with 
asserts enabled) will fail.

When the AllowDuplicateRegisterNames in AsmParser is set, duplicated register 
names will be tolerated. A backend can then coerce registers to the desired 
register class by (for instance) implementing validateTargetOperandClass.

At least the in-tree Sparc backend could benefit from this, as does RISC-V 
(single and double precision floating point registers).

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

llvm-svn: 320018
2017-12-07 09:51:55 +00:00
Gadi Haber dd62ac49cb [X86][FMA][FMA4]: Adding full coverage of MC encoding for the FMA, FMA4 isa sets.<NFC>
NFC.
 Adding MC regressions tests to cover the FMA and FMA4 ISA sets.
 This patch is part of a larger task to cover MC encoding of all X86 ISA Sets starting revision https://reviews.llvm.org/D39952

Reviewers: craig.topper, RKSimon, zvi
Differential Revision: https://reviews.llvm.org/D40880

Change-Id: Ie39c0edce69ad647076b3d4e816948b2b6e1a9e4
llvm-svn: 320016
2017-12-07 09:16:34 +00:00
Gadi Haber e33a0cb8a8 [X86][X87]: Adding full coverage of MC encoding for all X87 ISA Sets.<NFC>
NFC.
 Currently, not all the X86 ISA Sets are covered by the MC regressions tests for X86.
 A full coverage needs to be added for each ISA set and for both 32bit and 64bit instructions + registers.
 This patch includes MC assembly tests for the X87 32bit and 64bit.

Reviewers: craigt, RKSimon, zvi
Differential Revision: https://reviews.llvm.org/D39952

Change-Id: I55e1719c09a70644a6a4073c720cb5341c80fee9
llvm-svn: 320015
2017-12-07 09:00:19 +00:00
Igor Laevsky 54d1ff0a58 [InstSimplify] Add tests for the rL319894
Differential Revision: https://reviews.llvm.org/D40650

llvm-svn: 320014
2017-12-07 08:52:24 +00:00
Craig Topper dfecd45f37 [SelectionDAG] In SplitVecOp_EXTRACT_VECTOR_ELT, simplify the code that makes the type byte addressable.
We can just extend the original vector to vXi1 and trust that the legalization process will revisit it.

llvm-svn: 320013
2017-12-07 08:04:34 +00:00
Craig Topper 26ed8d1263 [SelectionDAG] Use TLI.getVectorIdxTy to determine type for an EXTRACT_VECTOR_ELT index instead of hardcoding MVT::i8.
llvm-svn: 320012
2017-12-07 08:04:33 +00:00
Mikael Holmen b5deac444d Skip DBG instr in OptimizePHIs when looking for dead PHI cycles
Summary:
Changed use_instructions() to use_nodbg_instructions() when
building an instruction set.

We don't want the presence of debug info to affect the code
we generate.

Reviewers: dblaikie, Eugene.Zelenko, chandlerc, aprantl

Reviewed By: aprantl

Subscribers: aprantl, llvm-commits

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

llvm-svn: 320010
2017-12-07 07:01:21 +00:00
Leslie Zhai 8543d53fd9 [AVR] Override ParseDirective
Reviewers: dylanmckay, kparzysz

Reviewed By: dylanmckay

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

llvm-svn: 320009
2017-12-07 06:56:09 +00:00
Sam Clegg 8460b26403 Revert "[WebAssembly] Import the linear memory and function table."
We need to a little time to prepare and lld-side change that
supports this.

Original change: https://reviews.llvm.org/D40875

llvm-svn: 320003
2017-12-07 03:05:45 +00:00