1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 19:42:54 +02:00
Commit Graph

122648 Commits

Author SHA1 Message Date
Duncan P. N. Exon Smith
99856bc4a9 Interpreter: Remove implicit ilist iterator conversions, NFC
llvm-svn: 250185
2015-10-13 17:33:41 +00:00
Kevin Enderby
26f840c19c The issue with the malformed-machos 00000031.a test is that it needed ‘-arch x86_64’
flag as it was a Mach-O universal file.

The default as to which architecture slice that is dumped without an -arch flag
depends on the host architecture and the contents of the universal file.  The
malformed archive 00000031.a file has both an x86_64 and i386 slice.  So for
for x86_64 hosts only that slice is dumped, for non-x86_64 hosts, which is many
of the bots both slices are dumped.

The test is intended to only check that the malformation of the x86_64 which
has a non-decimal characters in the size field of the archive header so it no
longer crashes.

The problem turned out that the i388 slice of the malformed archive had a
different malformation which was causing the non-x86_64 bots to get this error:

llvm-objdump -macho -disassemble -arch i386 00000031.a 
Archive : .00000031.a
00000031.a(c_start.o):
LLVM ERROR: Symbol name entry points before beginning or past end of file.

and causing the test as it was written to fail.  So by adding ‘-arch x86_64’ it
should correct the test and the malformation on the i388 slice will not be
dumped.

Also the removal of the malformed-machos mem-crup-0261.macho was not causing
the issue so that is put back in.

Sorry for the churn on these tests, Kev

llvm-svn: 250184
2015-10-13 17:06:34 +00:00
Duncan P. N. Exon Smith
279616c29f InstCombine: Remove ilist iterator implicit conversions, NFC
Stop relying on implicit conversions of ilist iterators in
LLVMInstCombine.  No functionality change intended.

llvm-svn: 250183
2015-10-13 16:59:33 +00:00
Duncan P. N. Exon Smith
c9eafb8249 BitcodeReader: Remove ilist iterator implicit conversions, NFC
Get LLVMBitReader building without relying on `ilist_iterator` implicit
conversions.

llvm-svn: 250181
2015-10-13 16:48:55 +00:00
Joseph Tremoulet
2448ee3777 [WinEH] Iterate state changes instead of invokes
Summary:
Add an iterator that can walk across blocks and which visits the state
transitions rather than state ranges, with explicit transitions to -1
indicating the presence of top-level calls that may throw and cause the
current function to unwind to caller.  This will simplify code that needs
to identify nested try regions.

Refactor SEH and C++EH table generation to use the new
InvokeStateChangeIterator, and remove the InvokeLabelIterator they were
using.


Reviewers: majnemer, andrew.w.kaylor, rnk

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D13623

llvm-svn: 250179
2015-10-13 16:44:30 +00:00
Xinliang David Li
3661a98f5d Fix a couple of comments; NFC
llvm-svn: 250177
2015-10-13 16:35:59 +00:00
Sanjay Patel
14776224a0 function names should start with a lower case letter; NFC
llvm-svn: 250174
2015-10-13 16:23:00 +00:00
Sanjay Patel
1d6d311286 don't repeat function/class/variable names in comments; NFC
llvm-svn: 250162
2015-10-13 15:12:27 +00:00
Simon Pilgrim
5a441530c3 [InstCombine][SSE4A] Remove broken INSERTQI range combining optimization
As discussed in D13348 - the INSERTQI range combining code is wrong in that it confuses the insertion bit index with an extraction bit index.

The remaining legal combines are very unlikely (especially once we've converted to shuffles in D13348) so I'm removing the optimization.

llvm-svn: 250160
2015-10-13 14:48:54 +00:00
James Molloy
3eec7b82c2 [GlobalsAA] Turn GlobalsAA on again by default
Now that all the known faults with GlobalsAA have been fixed, flip the big switch on -enable-non-lto-gmr again.

Feel free to pester me with any more bugs found, and don't hesitate to flip the switch back off.

llvm-svn: 250157
2015-10-13 10:43:57 +00:00
James Molloy
7b355004c3 [GlobalsAA] Don't assume anything about functions that may be overridden
Weak linkage and friends allow a symbol to be overriden outside the
code generator's model, so GlobalsAA shouldn't assume that anything it
can compute about such a symbol is valid.

llvm-svn: 250156
2015-10-13 10:43:33 +00:00
Christof Douma
9edee2b861 Test commit
llvm-svn: 250154
2015-10-13 09:38:21 +00:00
Michael Liao
7751a953c3 Remove unnecessary argument in ipo iterator
- Otherwise, it won't be compiled if that template is instantiated.

llvm-svn: 250153
2015-10-13 07:26:04 +00:00
Sanjoy Das
20a5b98344 [IndVars] NFC Cleanup.
- Rename methods according to the LLVM Coding Style
 - Merge adjacent anonymous namespace block
 - Use `auto` in two places

llvm-svn: 250152
2015-10-13 07:17:38 +00:00
Michael Kuperstein
6430612ef2 Fix line-ending issue. NFC.
llvm-svn: 250151
2015-10-13 06:22:30 +00:00
Chris Bieneman
5508052bc1 [CMake] LLVM_PROFDATA_FILE only works if you're using clang, so we should error out if it is specified when not using clang.
Also updated the CMake docs.

Based on post-commit review of r250108 from Sean Silvas.

llvm-svn: 250150
2015-10-13 05:35:12 +00:00
Craig Topper
60d5a95ab6 [X86] Mark the AAD and AAM aliases as not valid in 64-bit mode.
llvm-svn: 250148
2015-10-13 05:12:07 +00:00
Craig Topper
02d45efab2 [X86] Change all the i8imm operands in XOP instructions to u8imm so the parser will check the size.
llvm-svn: 250147
2015-10-13 05:06:25 +00:00
Manman Ren
3f113087cd Revert 250089 due to bot failure. It failed when building clang itself with PGO.
llvm-svn: 250145
2015-10-13 03:38:02 +00:00
Duncan P. N. Exon Smith
49222f78ba BitcodeWriter: Stop using implicit ilist iterator conversion, NFC
Now LLVMBitWriter compiles without implicit ilist iterator conversions.

In these cases, the cleanest thing was to switch to range-based for
loops.  Since there wasn't much noise I converted sub-loops and parent
loops as a drive-by.

llvm-svn: 250144
2015-10-13 03:26:19 +00:00
Sanjoy Das
689632fa53 [SCEV] Put some utilites in the ScalarEvolution class
In a later commit, `SplitBinaryAdd` will be used outside `IsConstDiff`,
so lift that out.  And lift out `IsConstDiff` as
`computeConstantDifference` to keep things clean and to avoid playing
C++ access specifier games.

NFC.

llvm-svn: 250143
2015-10-13 02:53:27 +00:00
Duncan P. N. Exon Smith
c29917fae7 TransformUtils: Remove implicit ilist iterator conversions, NFC
Continuing the work from last week to remove implicit ilist iterator
conversions.  First related commit was probably r249767, with some more
motivation in r249925.  This edition gets LLVMTransformUtils compiling
without the implicit conversions.

No functional change intended.

llvm-svn: 250142
2015-10-13 02:39:05 +00:00
Kevin Enderby
b65cecc017 Looks like malformed-machos 00000031.a test is just getting a different error
on some of the bots.  I’ll remove this test for now.

llvm-svn: 250141
2015-10-13 01:27:28 +00:00
Matt Arsenault
12118bb735 DAGCombiner: Don't stop finding better chain on 2 aliases
The comment says this was stopped because it was unlikely to be
profitable. This is not true if you want to combine vector loads
with multiple components.

For a simple case that looks like

t0 = load t0 ...
t1 = load t0 ...
t2 = load t0 ...
t3 = load t0 ...

t4 = store t0:1, t0:1
  t5 = store t4, t1:0
    t6 = store t5, t2:0
	  t7 = store t6, t3:0

We want to get all of these stores onto a chain
that is a TokenFactor of these N loads. This mostly
solves the AMDGPU merge-stores.ll regressions
with -combiner-alias-analysis for merging vector
stores of vector loads.

llvm-svn: 250138
2015-10-13 00:49:00 +00:00
JF Bastien
36979ec5a3 x86: preserve flags when folding atomic operations
Summary:
D4796 taught LLVM to fold some atomic integer operations into a single
instruction. The pattern was unaware that the instructions clobbered
flags.

This patch adds the missing EFLAGS definition.

Floating point operations don't set flags, the subsequent fadd
optimization is therefore correct. The same applies for surrounding
load/store optimizations.

Reviewers: rsmith, rtrieu

Subscribers: llvm-commits, reames, morisset

Differential Revision: http://reviews.llvm.org/D13680

llvm-svn: 250135
2015-10-13 00:28:47 +00:00
Matt Arsenault
303e42b592 AMDGPU: Refactor isVGPRToSGPRCopy
It should now correctly handle physical registers and make
it easier to identify the other direction.

llvm-svn: 250132
2015-10-13 00:07:54 +00:00
Kevin Enderby
42333fda0d Remove the correct unstable malformed-machos test mem-crup-0261.macho and
restore the malformed-machos 00000031.a test.  Hopefully this will get all the
build bots happy again.  I’ll again keep an eye on them.

llvm-svn: 250130
2015-10-13 00:05:17 +00:00
Matt Arsenault
85dd075020 DAGCombiner: Combine extract_vector_elt from build_vector
This basic combine was surprisingly missing.
AMDGPU legalizes many operations in terms of 32-bit vector components,
so not doing this results in many extra copies and subregister extracts
that need to be cleaned up later.

InstCombine already does this for the hasOneUse case. The target hook
is to fix a handful of tests which break (e.g. ARM/vmov.ll) which turn
from a vector materialize repeated immediate instruction to a constant
vector load with more scalar copies from it.

llvm-svn: 250129
2015-10-12 23:59:50 +00:00
Simon Pilgrim
977c9904f0 [InstCombine] Tidied up SSE4A tests.
First stage of bugfix discussed in D13348

llvm-svn: 250121
2015-10-12 23:07:06 +00:00
Kevin Enderby
7a8210ad43 Temporarily remove the test added in r250117 while I investigate why two
of the build bots get a different error on that malformed file.

llvm-svn: 250120
2015-10-12 23:03:43 +00:00
Cong Hou
7cf63ad252 Assign correct edge weights to unwind destinations when lowering invoke statement.
When lowering invoke statement, all unwind destinations are directly added as successors of call site block, and the weight of those new edges are not assigned properly. Actually, default weight 16 are used for those edges. This patch calculates the proper edge weights for those edges when collecting all unwind destinations.

Differential revision: http://reviews.llvm.org/D13354

llvm-svn: 250119
2015-10-12 23:02:58 +00:00
Simon Pilgrim
a096bcfd07 [SelectionDAG] Add common vector constant folding helper function
We have a number of functions that implement constant folding of vectors (unary and binary ops) in near identical manners (and the differences don't appear to be critical).

This patch introduces a common implementation (SelectionDAG::FoldConstantVectorArithmetic) and calls this in both the unary and binary op cases.

After this initial patch I intend to begin enabling vector constant folding for a wider number of opcodes in SelectionDAG::getNode().

Differential Revision: http://reviews.llvm.org/D13665

llvm-svn: 250118
2015-10-12 23:00:11 +00:00
Kevin Enderby
d3c885fa4a Fixed bugs in llvm-obdump while parsing Mach-O files from malformed archives
that caused aborts.  This was because of the characters of the ‘Size’ field in
the archive header did not contain decimal characters.

rdar://22983603

llvm-svn: 250117
2015-10-12 22:04:54 +00:00
Chris Bieneman
8b64308070 [CMake] Adding support for passing in profiling data.
Adds LLVM_PROFDATA_FILE option to allow specifying a profile data file to be used during compilation of LLVM and subprojects.

llvm-svn: 250108
2015-10-12 21:13:20 +00:00
Cong Hou
664f8a8312 Update the branch weight metadata in JumpThreading pass.
In JumpThreading pass, the branch weight metadata is not updated after CFG modification. Consider the jump threading on PredBB, BB, and SuccBB. After jump threading, the weight on BB->SuccBB should be adjusted as some of it is contributed by the edge PredBB->BB, which doesn't exist anymore. This patch tries to update the edge weight in metadata on BB->SuccBB by scaling it by 1 - Freq(PredBB->BB) / Freq(BB->SuccBB). 

Differential revision: http://reviews.llvm.org/D10979

llvm-svn: 250089
2015-10-12 19:44:08 +00:00
Reid Kleckner
9480154bf5 Make Win64 localescape offsets FP relative instead of SP relative
We made them SP relative back in March (r233137) because that's the
value the runtime passes to EH functions. With the new cleanuppad IR,
funclets adjust their frame argument from SP to FP, so our offsets
should now be FP-relative.

llvm-svn: 250088
2015-10-12 19:43:34 +00:00
Hemant Kulkarni
0464ae6dc8 [llvm-symbolizer] Add -print-address option
Differential Revision: http://reviews.llvm.org/D13518

llvm-svn: 250086
2015-10-12 19:26:44 +00:00
Andrea Di Biagio
64241e8d03 [x86] Fix wrong lowering of vsetcc nodes (PR25080).
Function LowerVSETCC (in X86ISelLowering.cpp) worked under the wrong
assumption that for non-AVX512 targets, the source type and destination type
of a type-legalized setcc node were always the same type.

This assumption was unfortunately incorrect; the type legalizer is not always
able to promote the return type of a setcc to the same type as the first
operand of a setcc.

In the case of a vsetcc node, the legalizer firstly checks if the first input
operand has a legal type. If so, then it promotes the return type of the vsetcc
to that same type. Otherwise, the return type is promoted to the 'next legal
type', which, for vectors of MVT::i1 is always a 128-bit integer vector type.

Example (-mattr=+avx):

  %0 = trunc <8 x i32> %a to <8 x i23>
  %1 = icmp eq <8 x i23> %0, zeroinitializer

The initial selection dag for the code above is:

v8i1 = setcc t5, t7, seteq:ch
  t5: v8i23 = truncate t2
    t2: v8i32,ch = CopyFromReg t0, Register:v8i32 %vreg1
    t7: v8i32 = build_vector of all zeroes.

The type legalizer would firstly check if 't5' has a legal type. If so, then it
would reuse that same type to promote the return type of the setcc node.
Unfortunately 't5' is of illegal type v8i23, and therefore it cannot be used to
promote the return type of the setcc node. Consequently, the setcc return type
is promoted to v8i16. Later on, 't5' is promoted to v8i32 thus leading to the
following dag node:
  v8i16 = setcc t32, t25, seteq:ch

  where t32 and t25 are now values of type v8i32.

Before this patch, function LowerVSETCC would have wrongly expanded the setcc
to a single X86ISD::PCMPEQ. Surprisingly, ISel was still able to match an
instruction. In our case, ISel would have matched a VPCMPEQWrr:
  t37: v8i16 = X86ISD::VPCMPEQWrr t36, t25

However, t36 and t25 are both VR256, while the result type is instead of class
VR128. This inconsistency ended up causing the insertion of COPY instructions
like this:
  %vreg7<def> = COPY %vreg3; VR128:%vreg7 VR256:%vreg3

Which is an invalid full copy (not a sub register copy).
Eventually, the backend would have hit an UNREACHABLE "Cannot emit physreg copy
instruction" in the attempt to expand the malformed pseudo COPY instructions.

This patch fixes the problem adding the missing logic in LowerVSETCC to handle
the corner case of a setcc with 128-bit return type and 256-bit operand type.

This problem was originally reported by Dimitry as PR25080. It has been latent
for a very long time. I have added the minimal reproducible from that bugzilla
as test setcc-lowering.ll.

Differential Revision: http://reviews.llvm.org/D13660

llvm-svn: 250085
2015-10-12 19:22:30 +00:00
Cong Hou
2707f67c87 Add - and -= operators to BlockFrequency using saturating arithmetic.
llvm-svn: 250077
2015-10-12 18:34:00 +00:00
Kostya Serebryany
955b43980e [libFuzzer] mention more trophies and improve the link formatting
llvm-svn: 250076
2015-10-12 18:15:42 +00:00
Sanjay Patel
918786bb02 combine predicates; NFCI
llvm-svn: 250075
2015-10-12 18:15:08 +00:00
Cong Hou
488e4756aa Turn const/const& into value type for BlockFrequency in functions of this class. Also fix a naming issue. NFC.
llvm-svn: 250074
2015-10-12 18:14:15 +00:00
Colin LeMahieu
d73327a49c [llvm-symbolizer] Reverting r250067
llvm-svn: 250072
2015-10-12 17:57:02 +00:00
Matt Arsenault
a39d32ec2d AMDGPU: Register some more passes so -print-before works
llvm-svn: 250071
2015-10-12 17:43:59 +00:00
Matt Arsenault
2f5c4b1b03 Enable verifier after PeepholeOptimizer
No tests fail with this enabled so I assume it was an accident
that it isn't enabled now.

llvm-svn: 250070
2015-10-12 17:43:56 +00:00
Reid Kleckner
e553907fca Don't call PrepareEHLandingPad on non EH pads
This was a minor bug in r249492. Calling PrepareEHLandingPad on a
non-landingpad was a no-op, but it attempted to get the generic pointer
register class, which apparently doesn't exist for some targets.

llvm-svn: 250068
2015-10-12 17:42:32 +00:00
Hemant Kulkarni
7dd48fdc72 [llvm-symbolizer] Add -print-address option
Differential Revision  http://reviews.llvm.org/D13518

llvm-svn: 250067
2015-10-12 17:31:22 +00:00
David Majnemer
f1e49351cb [WinEH] Remove CatchObjRecoverIdx
CatchObjRecoverIdx was used for the old scheme, it is no longer
relevant.

llvm-svn: 250065
2015-10-12 16:44:22 +00:00
Sanjay Patel
4f799d50c9 fix typos; NFC
llvm-svn: 250059
2015-10-12 16:09:59 +00:00
Zoran Jovanovic
d3024c63d9 [mips][micromips] Initial support for micrmomips DSP instructions and addu.qb implementation
Differential Revision: http://reviews.llvm.org/D12798

llvm-svn: 250058
2015-10-12 16:07:25 +00:00