Commit Graph

19 Commits

Author SHA1 Message Date
Bob Wilson
8e330ee344 NFC: Fix indentation around the newly renamed LLVM_DEBUG macro.
Jordan used a sed command to rename DEBUG to LLVM_DEBUG. That caused some
lines to wrap and messed up indentiation for multi-line arguments.
2018-07-21 00:56:18 -07:00
Jordan Rose
cefb0b62ba Replace old DEBUG macro with new LLVM_DEBUG
...using a sed command provided by Vedant:

$ find . -name \*.cpp -print -exec sed -i "" -E "s/ DEBUG\(/ LLVM_DEBUG(/g" {} \;
2018-07-20 14:37:26 -07:00
John McCall
ab3f77baf2 Make SILInstruction no longer a subclass of ValueBase and
introduce a common superclass, SILNode.

This is in preparation for allowing instructions to have multiple
results.  It is also a somewhat more elegant representation for
instructions that have zero results.  Instructions that are known
to have exactly one result inherit from a class, SingleValueInstruction,
that subclasses both ValueBase and SILInstruction.  Some care must be
taken when working with SILNode pointers and testing for equality;
please see the comment on SILNode for more information.

A number of SIL passes needed to be updated in order to handle this
new distinction between SIL values and SIL instructions.

Note that the SIL parser is now stricter about not trying to assign
a result value from an instruction (like 'return' or 'strong_retain')
that does not produce any.
2017-09-25 02:06:26 -04:00
Andrew Trick
be1881aa1f Remove redundant Transform.getName() definitions.
At some point, pass definitions were heavily macro-ized. Pass
descriptive names were added in two places. This is not only redundant
but a source of confusion. You could waste a lot of time grepping for
the wrong string. I removed all the getName() overrides which, at
around 90 passes, was a fairly significant amount of code bloat.

Any pass that we want to be able to invoke by name from a tool
(sil-opt) or pipeline plan *should* have unique type name, enum value,
commend-line string, and name string. I removed a comment about the
various inliner passes that contradicted that.

Side note: We should be consistent with the policy that a pass is
identified by its type. We have a couple passes, LICM and CSE, which
currently violate that convention.
2017-04-09 15:20:28 -07:00
Arnold Schwaighofer
44e89fb595 UnsafeGuaranteedPeephole should handle virtual_method calls
Make the peephole stronger to handle retain(self), apply(self), release(self)
pairs inbetween unsafeGuaranteed pairs.

rdar://30948468
2017-03-09 09:28:35 -08:00
practicalswift
6d1ae2a39c [gardening] 2016 → 2017 2017-01-06 16:41:22 +01:00
practicalswift
38be6125e5 [gardening] C++ gardening: Terminate namespaces, fix argument names, ...
Changes:
* Terminate all namespaces with the correct closing comment.
* Make sure argument names in comments match the corresponding parameter name.
* Remove redundant get() calls on smart pointers.
* Prefer using "override" or "final" instead of "virtual". Remove "virtual" where appropriate.
2016-12-17 00:32:42 +01:00
practicalswift
797b80765f [gardening] Use the correct base URL (https://swift.org) in references to the Swift website
Remove all references to the old non-TLS enabled base URL (http://swift.org)
2016-11-20 17:36:03 +01:00
Arnold Schwaighofer
7cc447c7c7 UnsafeGuaranteedPeephole: Handle exception edges correctly
Exceptions can cause an exit before hitting the unsafeGuaranteedEnd instruction.
Make sure that we check post dominance to find such cases.

rdar://26890751
2016-07-12 11:56:39 -07:00
Arnold Schwaighofer
4df87a6554 Refactor unsafeGuaranteed code into utility functions.
NFC.
2016-05-08 08:10:43 -07:00
Arnold Schwaighofer
0883a96c13 UnsafeGuaranteedPeephole: Fix obvious mistake
Caught by ASAN.
2016-05-06 15:59:48 -07:00
practicalswift
540cb751ac [gardening] Fix recently introduced typo: "adavances" → "advances"
[gardening] Fix recently introduced typo: "compie" → "compile"

[gardening] Fix recently introduced typo: "consise" → "concise"

[gardening] Fix recently introduced typo: "dengerate" → "degenerate"

[gardening] Fix recently introduced typo: "encodeded" → "encoded"

[gardening] Fix recently introduced typo: "equvalent" → "equivalent"

[gardening] Fix recently introduced typo: "guaranted" → "guaranteed"

[gardening] Fix recently introduced typo: "overridde" → "override"

[gardening] Fix recently introduced typo: "subsquence" → "subsequence"

[gardening] Fix recently introduced typo: "substraction" → "subtraction"

[gardening] Fix recently introduced typo: "whiltespace" → "whitespace"
2016-05-01 20:07:18 +02:00
Arnold Schwaighofer
98e3253bbd UnsafeGuaranteed Peephole: Handle a release after the UnsafeGuaranteedEnd instruction
We seem to emit this pattern now.
2016-04-30 14:17:38 -07:00
Arnold Schwaighofer
d97e7d93c7 UnsafeGuaranteedPeephole: Also use RCIdentity for matching retains 2016-04-13 09:11:27 -07:00
Arnold Schwaighofer
7d86d6f664 UnsafeGuaranteedPeephole: Use RCIdentityFunctionInfo when matching release 2016-04-13 08:46:31 -07:00
Arnold Schwaighofer
75100a9598 UnsafeGuaranteedPeephole: Also skip sideeffect free instructions 2016-04-10 14:28:02 -07:00
Arnold Schwaighofer
be7ddc69d9 UnsafeGuaranteedPeephole: Skip debug instructions and ignore retain/release uses 2016-04-08 17:54:39 -07:00
Arnold Schwaighofer
308ce091b7 Actually return the result from the _withUnsafeGuaranteed closure call 2016-03-31 16:43:46 -07:00
Arnold Schwaighofer
255779082e Add a peephole optimization for the builtin "unsafeGuaranteed"
We can remove the retain/release pair preceeding the builtins based on the
knowledge that the lifetime of the reference is guaranteed by someone hanging on
to the reference elsewhere.
2016-03-27 06:47:16 -07:00