This is needed to enable the optimization in this patch: https://reviews.llvm.org/D62433
|1441 ↗||(On Diff #202820)|
Can't you just declare literal as a GlobalVariable instead of immediately casting it?
|4654 ↗||(On Diff #202820)|
cast seems unnecessary.
|5 ↗||(On Diff #202820)|
I believe FileCheck ignores CHECK lines when there is a custom check-prefix, so this should be CHECK-LP64. I think this makes more sense regardless in its own file though, its weird to piggyback on an unrelated test IMO.
|59–60 ↗||(On Diff #202820)|
(Likewise, these should be CHECK-LP64, or this test shouldn't be using a check-prefix. Would you mind updating this?)
This is exactly what I was imagining! This will enable the frontend to opt into this optimization without having to touch the optimizer. One nit: can we use a different name than "arc_retain_agnostic". Have you considered something like "arc_inert"? My fear is that at a glance (without thinking), you would think that the attribute would have something only to do with retain when we are really talking about ARC value operations. Beyond that looks great!