-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Add some instruction simplifications #70494
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add some instruction simplifications #70494
Conversation
Replace ``` %1 = enum $E, #someCase, %payload switch_enum %1, case #someCase: bb1, ... bb1(%payloadArgument): ``` -> ``` br bb1(%payload) bb1(%payloadArgument): ```
…string literals A pointer to a string literal is never null
Check that `StaticString("some string literal").utf8Start` can be put into a statically initialized global
@swift-ci test |
@swift-ci benchmark |
@@ -38,8 +38,14 @@ struct MyStruct5 { | |||
} | |||
@_section("__TEXT,__mysection") var g_MyStruct5: MyStruct5 = MyStruct5(q: MyStruct4(a: 42, s: MyStruct1(a: 43, b: 44)), r: MyStruct4(a: 42, s: MyStruct1(a: 43, b: 44))) | |||
|
|||
@_section("__TEXT,__mysection") let utf8OfStaticString = StaticString("hello").utf8Start |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@eeckstein, strangely this broke on the 32-bit Android armv7 CI but not on the aarch64 CI:
/home/ubuntu/jenkins/workspace/oss-swift-RA-linux-ubuntu-16.04-android/swift/test/IRGen/section_structs.swift:41:37: error: global variable must be a compile-time constant to use @_section attribute
@_section("__TEXT,__mysection") let utf8OfStaticString = StaticString("hello").utf8Start
^
This compiler on the Android CI is built with a full bootstrap on linux, as that CI has no prebuilt Swift compiler installed, so the swift-syntax parser is not built. Maybe that has something to do with it, but weird that it only hits for 32-bit compilation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@finagolfin do you have any error log or a link to the ci failure?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's disable the test for 32-bit
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
enum
-switch_enum
pairsThis enables to put
StaticString("some string literal").utf8Start
into a statically initialized global