Commit Graph

24 Commits

Author SHA1 Message Date
Erik Eckstein
4e61c5620c MandatoryInlining: look through sendable function conversions
Allows inlining of sendable transparent functions

rdar://124401627
2024-03-13 09:58:30 +01:00
Allan Shortlidge
0e5cfa6259 NFC: Remove duplicated RUN lines from many SILOptimizer tests.
A previous PR (https://github.com/apple/swift/pull/32407) that mass-modified
tests left some duplicate `RUN:` lines behind.
2023-08-08 11:19:52 -07:00
Anthony Latsis
7fb62f6d9c Gardening: Migrate test suite to GH issues: SILOptimizer (1/2) 2022-09-04 09:35:41 +03:00
Michael Gottesman
46432404f3 [ownership] Remove dead option: enable-ownership-stripping-after-serialization.
We always lower ownership now after the diagnostic passes (what this option
actually controlled). So remove it.

NFC.
2020-06-16 10:52:02 -07:00
Ravi Kandhadai
2e0457ab0d [OSLog Diagnostics] Improve diagnostics emitted in the SIL and Sema diagnostic passes
for the os log APIs. These improvements are aimed at covering some rare corner cases.
2020-04-18 15:29:22 -07:00
Michael Gottesman
534781ef8c [global-string-table] Fix for ownership.
This involves teaching the constant folder to look through a borrow when trying
to find the string literal. I also added an additional run with ownership
lowering after diagnostics enabled to make sure this doesn't break again.
2019-10-01 21:18:39 -07:00
Ravi Kandhadai
37f524e647 [Constant Folding][OSLogOptimization] Fold the uses of the builtin
"globalStringTablePointer": String -> Builtin.RawPointer` to a
string_literal instruction if the string that is passed is constructed
from a literal. Otherwise, emit diagnostics.
2019-07-03 16:47:34 -07:00
Parker Schuh
b12fcb50db IntegerLiteralExpr now is lowered directly into SIL.
For context, String, Nil, and Bool already behave this way.

Note: Before it used to construct (call, ... (integer_literal)), and the
call would be made explicit / implicit based on if you did eg: Int(3) or
just 3. This however did not translate to the new world so this PR adds
a IsExplicitConversion bit to NumberLiteralExpr. Some side results of
all this are that some warnings changed a little and some instructions are
emitted in a different order.
2019-02-14 11:54:16 -08:00
Ravi Kandhadai
58e8edec55 [Tests] Enable SILGen tests that were xfailed since the time when the
integer protocols changed the way basic arithmetic operations were
called. <rdar://29939484> has more information.

This commit re-enables those tests and updates the SIL that was checked
in the tests to be consistent with the one generated by the current
compiler.

<rdar://29939484>
2018-10-15 17:39:54 -07:00
Ravi Kandhadai
193407bf23 [SIL Diagnostics] Warn when assigning an integer literal to a
variable of floating-point type results in loss of precision.
<rdar://15224041>
2018-06-21 10:56:19 -07:00
Ravi Kandhadai
f1ff8a61a5 [Sema] Add Sema checks for detecting large integer literals that
overflow Builtin.Int2048 and add tests for checking the
correctness of the diagnostics.
2018-05-21 18:41:44 -07:00
Ravi Kandhadai
6da6937eff [Tests] Fix Radar problem <rdar:/19508336>
"Extend test/SILPasses/diagnostic_constant_propagation.swift" by removing
tests from the file that referred to `Int` and `UInt` types.
These tests are dependent on the word length of the architecture and
are covered by the tests in the files
`diagnostic_constant_propagation_int_archXX.swift`.

Also, this commit corrects erroneous references to a radar problem
in the test suties: `diagnostic_constant_propagation_int_archXX.swift`
2018-04-13 11:50:48 -07:00
Ravi Kandhadai
fa6f11c277 [Tests] Re-add the test suite for checking constant propagation phase
This commit enables many parts of the test suite `diagnostic_constant_propagation.swift`.
These tests were disabled as they failed due to changes to the implementation of integer
initializers, which made them non-transparent. The current modification enables all test
cases that pass under the latest swift implementation. It also has some false negatives,
which should ideally be reported as an error but currently pass the diagnostics phase.
The commit also extracts the tests that have diverging behavior in Swift 3 and Swift 4
into separate test files.
2018-04-03 12:13:57 -07:00
Max Moiseev
e1de9fcf0c More test fixes 2017-01-09 16:17:21 -08:00
Trent Nadeau
0cc851568a Updated tests to use @discardableResult and _ = . 2016-05-11 22:53:38 -04:00
Manav Gabhawala
7928140f79 [SE-0046] Implements consistent function parameter labels by discarding extraneous parameter names and adding _ where necessary 2016-04-06 20:21:58 -04:00
Max Moiseev
f51e708a8f Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines 2016-01-04 12:25:25 -08:00
ken0nek
3ac60b13f5 Add spaces before and after closure arrow in test 2015-12-23 04:38:46 +09:00
Max Moiseev
a7339e67ac Merge remote-tracking branch 'origin' into swift-3-api-guidelines 2015-12-22 11:36:07 -08:00
Chris Lattner
0224f2d858 Convert more tests off of ++ and -- 2015-12-21 18:07:37 -08:00
Max Moiseev
2f7b64e475 Merge remote-tracking branch 'origin' into swift-3-api-guidelines 2015-12-21 12:02:13 -08:00
Daniel Duan
239c6629e9 Remove trailing semi-colons in .swift files 2015-12-20 21:12:11 -08:00
Max Moiseev
806be29941 Merge remote-tracking branch 'origin' into swift-3-api-guidelines 2015-12-14 12:05:35 -08:00
Andrew Trick
bd35b4789c Move test/SILOptimizer files to reflect lib/SILOptimizer. 2015-12-11 15:53:22 -08:00