Commit Graph

11 Commits

Author SHA1 Message Date
Erik Eckstein
7cceaff5f3 SIL: don't print operand types in textual SIL
Type annotations for instruction operands are omitted, e.g.

```
  %3 = struct $S(%1, %2)
```

Operand types are redundant anyway and were only used for sanity checking in the SIL parser.

But: operand types _are_ printed if the definition of the operand value was not printed yet.
This happens:

* if the block with the definition appears after the block where the operand's instruction is located

* if a block or instruction is printed in isolation, e.g. in a debugger

The old behavior can be restored with `-Xllvm -sil-print-types`.
This option is added to many existing test files which check for operand types in their check-lines.
2024-11-21 18:49:52 +01:00
Andrew Trick
c47fe03241 Optimize Builtin.assumeAlignment -> pointer_to_address
Case #1. Literal zero = natural alignment
   %1 = integer_literal $Builtin.Int64, 0
   %2 = builtin "uncheckedAssertAlignment"
	(%0 : $Builtin.RawPointer, %1 : $Builtin.Int64) : $Builtin.RawPointer
   %3 = pointer_to_address %2 : $Builtin.RawPointer to [align=1] $*Int

   Erases the `pointer_to_address` `[align=]` attribute:

Case #2. Literal nonzero = forced alignment.

   %1 = integer_literal $Builtin.Int64, 16
   %2 = builtin "uncheckedAssertAlignment"
	(%0 : $Builtin.RawPointer, %1 : $Builtin.Int64) : $Builtin.RawPointer
   %3 = pointer_to_address %2 : $Builtin.RawPointer to [align=1] $*Int

   Promotes the `pointer_to_address` `[align=]` attribute to a higher value.

Case #3. Folded dynamic alignment

   %1 = builtin "alignof"<T>(%0 : $@thin T.Type) : $Builtin.Word
   %2 = builtin "uncheckedAssertAlignment"
	(%0 : $Builtin.RawPointer, %1 : $Builtin.Int64) : $Builtin.RawPointer
   %3 = pointer_to_address %2 : $Builtin.RawPointer to [align=1] $*T

   Erases the `pointer_to_address` `[align=]` attribute.
2021-11-30 12:23:46 -08:00
Erik Eckstein
39bb14b094 change mangling prefix from $S to $s
This is the final ABI mangling prefix

rdar://problem/38471478
2018-09-19 13:55:11 -07:00
Alex Hoppen
560c22b18e [tests] Verify the libSyntax tree on SILGen tests
The SILGen testsuite consists of valid Swift code covering most language
features. We use these tests to verify that no unknown nodes are in the
file's libSyntax tree. That way we will (hopefully) catch any future
changes or additions to the language which are not implemented in
libSyntax.
2018-04-27 09:33:03 -07:00
Erik Eckstein
cd3d50a5d9 ABI: Change the mangling prefix from _T0 to $S 2018-01-06 13:55:59 -08:00
Pavel Yaskevich
6519d99736 [Mangling/ABI] NFC: Fix SILGen tests to reflect label mangling changes 2017-12-18 15:44:24 -08:00
Erik Eckstein
c4a11f4c92 tests: remove the now unused option -new-mangling-for-tests 2017-03-22 11:28:43 -07:00
Roman Levenstein
4b965b6093 Un-XFAIL some tests which are passing now, after merging PR #7350 2017-03-17 07:24:46 -07:00
Erik Eckstein
1d3724666f tests: convert about 400 tests to the new mangling by using the -new-mangling-for-tests option
When the new mangling is enabled permanently, the option can be removed from the RUN command lines again.
2017-01-24 15:27:45 -08:00
Slava Pestov
d28b8ead50 Add resilient_stdlib to available_features and XFAIL remaining failing tests
All unoptimized tests should now pass when Swift is built with
'build-script -- --swift-stdlib-enable-resilience=1'.

There are still some issues when the tests themselves are built
with optimizations via 'check-swift-validation-optimize'.

Fixes <rdar://problem/28409189>.
2016-09-30 18:28:12 -07:00
Andrew Trick
aacee48cca Fix UnsafeRawPointer.load to use Builtin.loadRaw.
This API should have been converted to use the
new Builtin before it was introduced here:
commit a41484ea2b
Author: Andrew Trick <atrick@apple.com>
Date:   Fri Jul 22 13:32:08 2016
    Add UnsafeRawPointer type and API. (#3677)

But it looks like that was dropped during during some local merge. It's not
likely to be a problem until developers start adopting the new API and the
optimizer starts using TBAA aggressively. The other "raw" API's are binding
memory or using memmove, so those are safe.

rdar:23406272.
2016-08-13 18:49:32 -07:00