PredictableMemoryAccessOptimizations has become unmaintainable as-is.
RedundantLoadElimination does (almost) the same thing as PredictableMemoryAccessOptimizations.
It's not as powerful but good enough because PredictableMemoryAccessOptimizations is actually only needed for promoting integer values for mandatory constant propagation.
And most importantly: RedundantLoadElimination does not insert additional copies which was a big problem in PredictableMemoryAccessOptimizations.
Fixes rdar://142814676
This test has been disabled since 2022.
This re-enables the test in order to have some test coverage of the `-experimental-c-foreign-reference-types` compiler flag.
See `test/Interop/Cxx/foreign-reference/reference-counted.swift` for a very similar test that enables C++ interop.
rdar://101790203
If possible, add imported members to the StructDecl's LookupTable rather than adding them directly as members. This will fix the issues with ordering that #39436 poorly attempted to solve during IRGen.
This also allows us to break out most of the test changes from #39436.
Some of the patterns in the new test header are special-cased by
ClangImporter (for example, the names of typedefs become names of
imported structs).
Nested structs have been historically imported in Swift according to C
rules, that is, structs lexically declared nested in other structs are
imported into the global namespace anyway. For the same reason, C
structs have been mangled in Swift names as if they are declared in the
global namespace. These rules are problematic when importing C++, see
https://bugs.swift.org/browse/SR-12803.