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

114156 Commits

Author SHA1 Message Date
Benjamin Kramer
95a7c55022 Simplify code. NFC.
llvm-svn: 230948
2015-03-02 11:57:04 +00:00
Owen Anderson
eaf4cde743 Teach the verifier to enforce that the alignment argument of memory intrinsics must be a power of 2.
llvm-svn: 230941
2015-03-02 09:35:06 +00:00
Owen Anderson
e464d46ff1 Teach DataLayout that alignments on basic types must be powers of two.
Fixes assertion failures/crashes on bad datalayout specifications.

llvm-svn: 230940
2015-03-02 09:35:03 +00:00
Owen Anderson
f1ccd9db94 Teach DataLayout that ABI alignments for non-aggregate types must be non-zero.
This manifested as assertions and/or crashes in later phases of optimization,
depending on the build configuration.

llvm-svn: 230939
2015-03-02 09:34:59 +00:00
Owen Anderson
9691e92c81 Teach DataLayout that pointer ABI and preferred alignments are required to be powers of two.
Previously this resulted in asserts and/or crashes (depending on build configuration) at various phases in the optimizer.

llvm-svn: 230938
2015-03-02 06:33:51 +00:00
Owen Anderson
22efff3c98 Teach DataLayout that zero-byte pointer sizes don't make sense.
Previously this would result in assertion failures or simply crashes
at various points in the optimizer when trying to create types of zero
bit width.

llvm-svn: 230936
2015-03-02 06:00:02 +00:00
Owen Anderson
39b32da21b Teach the LLParser to fail gracefully when it encounters an invalid label name.
Previous it would either assert in +Asserts, or crash in -Asserts. Found by fuzzing LLParser.

llvm-svn: 230935
2015-03-02 05:25:09 +00:00
Owen Anderson
93f8351a0a Fix a crash in the LL parser where it failed to validate that the pointer operand of a GEP was valid.
This manifested as an assertion failure in +Asserts builds, and a hard crash in -Asserts builds.  Found by fuzzing the LL parser.

llvm-svn: 230934
2015-03-02 05:25:06 +00:00
Zachary Turner
c961d86cad [llvm-pdbdump] Many minor fixes and improvements
A short list of some of the improvements:

1) Now supports -all command line argument, which implies many
   other command line arguments to simplify usage.
2) Now supports -no-compiler-generated command line argument to
   exclude compiler generated types.
3) Prints base class list.
4) -class-definitions implies -types.
5) Proper display of bitfields.
6) Can now distinguish between struct/class/interface/union.

And a few other minor tweaks.

llvm-svn: 230933
2015-03-02 04:39:56 +00:00
Nico Weber
e4e94b4dca Revert r230930, it caused PR22747.
llvm-svn: 230932
2015-03-02 04:37:11 +00:00
Craig Topper
68ce8c3e30 [X86] There are only 8 mask registers. Fail disassembly if instruction tries to reference more.
llvm-svn: 230931
2015-03-02 03:33:11 +00:00
Adrian Prantl
5e06e85b02 Refactor DebugLocDWARFExpression so it doesn't require access to the
TargetRegisterInfo. DebugLocEntry now holds a buffer with the raw bytes
of the pre-calculated DWARF expression.

Ought to be NFC, but it does slightly alter the output format of the
textual assembly.

llvm-svn: 230930
2015-03-02 02:38:18 +00:00
NAKAMURA Takumi
233b254c9b Revert r230921, "Revert some changes that were made to fix PR20680.", for now.
It caused a failure on clang/test/Misc/backend-optimization-failure.cpp .

llvm-svn: 230929
2015-03-02 01:14:03 +00:00
Benjamin Kramer
19bb0a5bca Add another missing header that used to be included transitively.
llvm-svn: 230927
2015-03-02 01:08:07 +00:00
NAKAMURA Takumi
258ea59e5d llvm/examples: Add missing include according to r230907.
llvm-svn: 230926
2015-03-02 01:04:34 +00:00
Craig Topper
60ae8a07f3 [X86] Fix diassembler crash on AVX512 cmpps/cmppd with immediate that doesn't fit in 5-bits. Fixes PR22743.
llvm-svn: 230924
2015-03-02 00:22:29 +00:00
Sanjoy Das
84403306cc [AArch64] fix an invalid-iterator-use bug.
Summary:
In AArch64PromoteConstant::appendAndTransferDominatedUses,
`InsertPts[NewPt]` invalidates IPI.  Therefore, `InsertPts[NewPt] =
std::move(IPI->second)` is not legal.

This was caught by running `make check` with
http://reviews.llvm.org/D7931.

Reviewers: t.p.northover, grosbach, bkramer

Reviewed By: bkramer

Subscribers: aemerson, llvm-commits

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

llvm-svn: 230923
2015-03-02 00:17:18 +00:00
Benjamin Kramer
4b238f3540 Fix a really bad typo in my last commit.
llvm-svn: 230922
2015-03-01 23:56:19 +00:00
Sanjoy Das
b11e512365 Revert some changes that were made to fix PR20680.
Summary:
As far as I can tell, the real bug causing the issue was fixed in
r230533.  SCEVExpander should mark an increment operation as nuw or nsw
only if it can *prove* that the operation does not overflow.  There
shouldn't be any situation where we have to do something different
because of no-wrap flags generated by SCEVExpander.

Revert "IndVarSimplify: Allow LFTR to fire more often"

This reverts commit 1ade0f0faa98877b688e0b9da58e876052c1e04e (SVN: 222213).

Revert "IndVarSimplify: Don't let LFTR compare against a poison value"

This reverts commit c0f2b8b528d8a37b0a1522aae90af649d6357eb5 (SVN: 217102).

Reviewers: majnemer, atrick, spatel

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

llvm-svn: 230921
2015-03-01 23:36:26 +00:00
Benjamin Kramer
ce5dee938c ArrayRef: Put back std::equal for operator== with a check for the empty ArrayRefs
This has the nice property of compiling down to memcmp when feasible. An empty
ArrayRef can have a nullptr in its Data field. I didn't find anything in the
standard speaking against std::equal(nullptr, nullptr, nullptr) begin valid but
MSVC asserts. The way libstdc++ lowers std::equal down to memcmp also makes
invoking std::equal with a nullptr undefined behavior so checking is the only
way to be safe.

The extra check doesn't cost us perf either because we're essentially peeling
the loop header away from the rotated loop.

llvm-svn: 230920
2015-03-01 23:35:20 +00:00
Benjamin Kramer
1bbe3323c2 Another missing include for MSVC.
llvm-svn: 230918
2015-03-01 22:34:04 +00:00
Benjamin Kramer
beaf09d69a std::function is part of <functional>, not <utility>
llvm-svn: 230913
2015-03-01 21:49:21 +00:00
Benjamin Kramer
4cfc4c53d6 Add another missing include for MSVC.
llvm-svn: 230912
2015-03-01 21:47:46 +00:00
Benjamin Kramer
cb2485d9c8 X86: Replace variadic function with init list. NFC.
llvm-svn: 230911
2015-03-01 21:47:40 +00:00
Benjamin Kramer
ce7baceeed Add missing includes. make_unique proliferated everywhere.
llvm-svn: 230909
2015-03-01 21:28:53 +00:00
Arnaud A. de Grandmaison
d0ab75130b [PBQP] Address post-commit style comment for r230904. NFC.
Thanks David !

llvm-svn: 230908
2015-03-01 21:22:50 +00:00
Benjamin Kramer
ef1d6eb8ba ArrayRef: Remove the equals helper with many arguments.
With initializer lists there is a really neat idiomatic way to write
this, 'ArrayRef.equals({1, 2, 3, 4, 5})'. Remove the equal method which
always had a hard limit on the number of arguments. I considered
rewriting it with variadic templates but that's not really a good fit
for a function with homogeneous arguments.

'ArrayRef == {1, 2, 3, 4, 5}' would've been even more awesome, but C++11
doesn't allow init lists with binary operators.

llvm-svn: 230907
2015-03-01 21:05:05 +00:00
Arnaud A. de Grandmaison
0ce66152a8 [PBQP] Do not add an edge between nodes with totally disjoint allowed registers
Such edges are zero matrix, and they bring no additional info to the
allocation problem, apart from contributing to nodes' degree. Removing
those edges is expected to improve allocation time.

Tune the spill cost comparison, as this gives better average performances
now that the nodes' degrees has changed.

llvm-svn: 230904
2015-03-01 20:39:34 +00:00
Benjamin Kramer
ff05b10b0b Make VTs and UnicodeCharSet ctors constexpr if the compiler supports it.
There are static variables of this around that we really want to go
into a read-only segment. Sadly compilers are not smart enough to figure
that out without constexpr.

llvm-svn: 230895
2015-03-01 18:10:07 +00:00
Benjamin Kramer
91412d675f Make some non-constant static variables non-static or fully const.
Otherwise we have to emit thread-safe initialization for them. NFC.

llvm-svn: 230894
2015-03-01 18:09:56 +00:00
Elena Demikhovsky
9eda5391f2 Reverted 230471 - gather scatter handling in table gen.
llvm-svn: 230892
2015-03-01 08:23:41 +00:00
Elena Demikhovsky
e032aa37b6 AVX-512: Added mask and rounding mode for scalar arithmetics
Added more tests for scalar instructions to destinguish between AVX and AVX-512 forms.

llvm-svn: 230891
2015-03-01 07:44:04 +00:00
Zachary Turner
5aec6f79df [llvm-pdbdump] Fix GCC build.
llvm-svn: 230890
2015-03-01 06:59:57 +00:00
Zachary Turner
bc938afb61 [llvm-pdbdump] Clean up method signatures.
llvm-svn: 230889
2015-03-01 06:51:29 +00:00
Zachary Turner
fa3f27076b [llvm-pdbdump] Add regex-based filtering.
llvm-svn: 230888
2015-03-01 06:49:49 +00:00
NAKAMURA Takumi
f23d837ff0 Revert r230655, "gold-plugin: "Upgrade" debug info and handle its warnings."
It emits *millions of warnings* during selfhosting LTO build, to choke the buildbot with gigbytes of log.

llvm-svn: 230885
2015-03-01 04:16:28 +00:00
Sanjay Patel
46d370c549 avoid infinite looping when folding vector multiplies of constants (PR22698)
We were missing a check for the following fold in DAGCombiner:

// fold (fmul (fmul x, c1), c2) -> (fmul x, (fmul c1, c2))

If 'x' is also a constant, then we shouldn't do anything. Otherwise, we could end up swapping the operands back and forth forever.

This should fix:
http://llvm.org/bugs/show_bug.cgi?id=22698

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

llvm-svn: 230884
2015-03-01 00:09:35 +00:00
Sanjay Patel
0f499d9c03 fixed to test only the feature, not the feature and a CPU
llvm-svn: 230883
2015-03-01 00:02:03 +00:00
Duncan P. N. Exon Smith
76af7b2bdf DebugInfo: Convert DW_OP_piece => DW_OP_bit_piece
r228631 stopped using `DW_OP_piece` inside `DIExpression`s in the IR,
but it apparently missed updating these testcases.  Caught by verifier
checks for `MDExpression` while working on moving the new hierarchy into
place.

llvm-svn: 230882
2015-02-28 23:57:16 +00:00
Sanjay Patel
cd857fab16 make the tested feature (SSE2) explicit
llvm-svn: 230881
2015-02-28 23:55:24 +00:00
Duncan P. N. Exon Smith
d6d88d0f42 DebugInfo: Fix invalid file reference in CodeGen/X86/unknown-location.ll
There are two types of files in the old (current) debug info schema.

    !0 = !{!"some/filename", !"/path/to/dir"}
    !1 = !{!"0x29", !0} ; [ DW_TAG_file_type ]

!1 has a wrapper class called `DIFile` which inherits from `DIScope` and
is referenced in 'scope' fields.

!0 is called a "file node", and debug info nodes with a 'file' field
point at one of these directly -- although they're built in `DIBuilder`
by sending in a `DIFile` and reaching into it.

In the new hierarchy, I unified these nodes as `MDFile` (which `DIFile`
is a lightweight wrapper for) in r230057.  Moving the new hierarchy into
place (and upgrading testcases) caused CodeGen/X86/unknown-location.ll
to start failing -- apparently "0x29" was previously showing up in the
linetable as a filename, causing:

    .loc 2 4 3

(where 2 points at filename "0x29") instead of:

    .loc 1 4 3

(where 1 points at the actual filename).

Change the testcase to use the old schema correctly.

llvm-svn: 230880
2015-02-28 23:52:24 +00:00
Duncan P. N. Exon Smith
ea1ca6f286 DebugInfo: Use TempMDNode in DIDescriptor::replaceAllUsesWith()
Start using `TempMDNode` in `DIDescriptor::replaceAllUsesWith()`
(effectively `std::unique_ptr<MDNode, MDNode::deleteTemporary>`).

Besides making ownership more explicit, this prepares for when
`DIDescriptor` refers to nodes that are *not* `MDTuple`.  The old logic
for "replacing" a node with itself used `MDNode::get()` to return a new
(uniqued) `MDTuple`, while the new logic just defers to
`MDNode::replaceWithUniqued()` (which also typically saves an allocation
and RAUW traffic by mutating the temporary in place).

llvm-svn: 230879
2015-02-28 23:48:02 +00:00
Sanjay Patel
5a17442330 fixed to test only the feature, not the feature and a CPU
llvm-svn: 230878
2015-02-28 23:47:09 +00:00
Duncan P. N. Exon Smith
a2835fc0fd Optimize metadata node fields for CHECK-ability
While gaining practical experience hand-updating CHECK lines (for moving
the new debug info hierarchy into place),  I learnt a few things about
CHECK-ability of the specialized node assembly output.

  - The first part of a `CHECK:` is to identify the "right" node (this
    is especially true if you intend to use the new `CHECK-SAME`
    feature, since the first CHECK needs to identify the node correctly
    before you can split the line).
      - If there's a `tag:`, it should go first.
      - If there's a `name:`, it should go next (followed by the
        `linkageName:`, if any).
      - If there's a `scope:`, it should follow after that.
  - When a node type supports multiple DW_TAGs, but one is implied by
    its name and is overwhelmingly more common, the `tag:` field is
    terribly uninteresting unless it's different.
      - `MDBasicType` is almost always `DW_TAG_base_type`.
      - `MDTemplateValueParameter` is almost always
        `DW_TAG_template_value_parameter`.
  - Printing `name: ""` doesn't improve CHECK-ability, and there are far
    more nodes than I realized that are commonly nameless.
  - There are a few other fields that similarly aren't very interesting
    when they're empty.

This commit updates the `AsmWriter` as suggested above (and makes
necessary changes in `LLParser` for round-tripping).

llvm-svn: 230877
2015-02-28 23:21:38 +00:00
Sanjay Patel
625a60e6c1 fix typo; NFC
llvm-svn: 230876
2015-02-28 22:25:06 +00:00
Duncan P. N. Exon Smith
75f598d216 AsmWriter: Escape string fields in metadata
Properly escape string fields in metadata.  I've added a spot-check with
direct coverage for `MDFile::getFilename()`, but we'll get more coverage
once the hierarchy is moved into place (since this comes up in various
checked-in testcases).

I've replicated the `if` logic using the `ShouldSkipEmpty` flag
(although a follow-up commit is going to change how often this flag is
specified); no NFCI other than escaping the string fields.

llvm-svn: 230875
2015-02-28 22:20:16 +00:00
Duncan P. N. Exon Smith
1f01d5b107 AsmWriter: Extract writeStringField(), NFCI
Extract logic for escaping a string field in the new debug info
hierarchy from `GenericDebugNode`.  A follow-up commit will use it far
more widely (hence the dead code for `ShouldSkipEmpty`).

llvm-svn: 230873
2015-02-28 22:16:56 +00:00
Duncan P. N. Exon Smith
81a82662aa Fix buildbot issues for MDScope::getFile() after r230871
I hope this extra cast will make everyone happy...

llvm-svn: 230872
2015-02-28 21:58:10 +00:00
Duncan P. N. Exon Smith
f6b7daf737 IR: Specialize MDScope::getFile() for MDFile
Fix `MDScope::getFile()` so that it correctly returns a valid `MDFile`
even when it's an instance of `MDFile`.  This logic is necessary because
of r230057.  I'm working on moving the new hierarchy into place
out-of-tree (on track to commit Monday morning, BTW), and this was
exposed by a few failing tests.

llvm-svn: 230871
2015-02-28 21:47:02 +00:00
Duncan P. N. Exon Smith
4156ef43f1 Fix line endings on Transforms/Inline/inline_dbg_declare.ll
llvm-svn: 230870
2015-02-28 21:38:32 +00:00