mirror of
https://github.com/apple/swift.git
synced 2026-03-04 18:24:35 +01:00
For now I am trying out /not/ expanding when ownership is enabled. I still fixed the problems in it though. I also put in a force expand everything pass to make sure that in ossa we can still successfully go down this code path if we want to. The reason why I think this is the right thing to do is that the original reason why lower aggregate instrs was written was to help the low level arc optimizer (which only runs on non-ossa code). To the high level arc optimizer this is just noise and will keep the IR simpler. Another thing to note is that I updated the code so it should work in both ossa and non-ossa. In order to not perturb the code too much, I had to add a small optimization to TypeLowering where when ownership is disabled, we do not reform aggregates when copying. Instead, we just return the passed in value. This makes the pass the same when optimizing in both modes.
11 KiB
11 KiB