Asher Mancinelli
0c9a02355a
[flang][fir] always use memcpy for fir.box ( #113949 )
...
@jeanPerier explained the importance of converting box loads and stores
into `memcpy`s instead of aggregate loads and stores, and I'll do my
best to explain it here.
* [(godbolt link) Example comparing opt transformations on memcpys vs
aggregate load/stores](https://godbolt.org/z/be7xM83cG )
* LLVM can more effectively reason about memcpys compared to aggregate
load/stores.
* This came up when others were discussing array descriptors for
assumed-rank arrays passed to `bind(c)` subroutines, with the
implication that the array descriptors are known to have lower bounds of
1 and that they are not pointer/allocatable types.
* [(godbolt link) Clang also uses memcpys so we should probably follow
them, assuming the clang developers are generatign what they know Opt
will handle more effectively.](https://godbolt.org/z/YT4x7387W )
* This currently may not help much without the `nocapture` attribute
being propagated to function calls, but [it looks like someone may do
this soon (discourse
link)](https://discourse.llvm.org/t/applying-the-nocapture-attribute-to-reference-passed-arguments-in-fortran-subroutines/81401/23 )
or I can do this in a follow-up patch.
Note on test `flang/test/Fir/embox-char.fir`: it looks like the original
test was auto-generated. I wasn't too sure which parts were especially
important to test, so I regenerated the test. If we want the updated
version to look more like the old version, I'll make those changes.
2024-10-30 09:50:27 -07:00
..
2024-10-20 01:01:39 -05:00
2024-10-30 08:36:08 -05:00
2024-05-10 14:16:26 -05:00
2024-05-10 14:16:26 -05:00
2024-05-29 11:58:59 +02:00
2024-09-05 12:44:10 +01:00
2024-08-02 09:46:34 +02:00
2024-09-26 08:56:41 -05:00
2024-09-26 08:56:41 -05:00
2024-09-26 08:56:41 -05:00
2024-09-26 08:56:41 -05:00
2024-05-01 12:58:50 +01:00
2024-10-01 16:18:36 +01:00
2024-09-05 14:55:01 -03:00
2024-10-15 11:28:39 +01:00
2024-09-05 14:55:01 -03:00
2024-10-03 17:10:57 +02:00
2024-08-02 09:46:34 +02:00
2024-06-03 11:33:00 +02:00
2024-09-26 08:56:41 -05:00
2024-09-26 08:56:41 -05:00
2024-09-26 08:56:41 -05:00
2024-09-26 08:56:41 -05:00
2024-09-26 08:56:41 -05:00
2024-09-26 08:56:41 -05:00
2024-07-03 07:07:53 +02:00
2024-10-15 11:28:39 +01:00
2024-07-31 14:39:06 -03:00
2024-10-15 11:28:39 +01:00
2024-09-05 14:55:01 -03:00
2024-10-30 09:50:27 -07:00
2024-05-01 12:58:50 +01:00
2024-09-05 14:55:01 -03:00
2024-05-04 21:20:17 +02:00
2024-05-04 21:20:17 +02:00
2024-09-05 14:55:01 -03:00
2024-06-05 05:13:47 +02:00
2024-10-01 16:18:36 +01:00
2024-10-01 15:04:27 +01:00
2024-10-01 15:04:27 +01:00
2024-10-01 16:18:36 +01:00
2024-10-01 16:18:36 +01:00
2024-10-01 16:18:36 +01:00
2024-07-09 11:33:15 +01:00
2024-06-12 12:34:23 +01:00
2024-08-02 09:46:34 +02:00
2024-10-01 16:18:36 +01:00
2024-05-08 16:48:14 -07:00
2024-06-05 14:43:58 +01:00
2024-09-26 08:56:41 -05:00
2024-09-26 08:56:41 -05:00
2024-10-01 16:18:36 +01:00
2024-10-15 11:28:39 +01:00
2024-08-29 11:46:23 +01:00
2024-10-01 16:18:36 +01:00
2024-05-22 07:23:14 -05:00
2024-10-03 17:10:57 +02:00
2024-10-15 11:28:39 +01:00
2024-10-15 11:28:39 +01:00
2024-10-15 11:28:39 +01:00
2024-10-04 15:24:00 +02:00
2024-10-01 16:18:36 +01:00
2024-07-12 10:14:38 -07:00
2024-10-30 10:58:26 +00:00
2024-10-30 10:58:26 +00:00
2024-08-30 09:07:30 -04:00
2024-09-10 09:48:55 -04:00
2024-08-02 10:54:15 +01:00
2024-05-18 08:25:43 +02:00
2024-06-27 11:58:12 +05:30
2024-10-03 17:10:57 +02:00
2024-10-15 11:28:39 +01:00
2024-10-30 10:58:26 +00:00
2024-10-30 10:58:26 +00:00
2024-10-30 10:58:26 +00:00
2024-10-28 14:19:20 +00:00
2024-08-02 09:46:34 +02:00
2024-10-15 11:28:39 +01:00
2024-10-15 11:28:39 +01:00
2024-10-01 16:18:36 +01:00
2024-10-01 16:18:36 +01:00
2024-10-15 11:28:39 +01:00
2024-08-22 14:12:07 +01:00
2024-08-22 14:12:07 +01:00
2024-08-22 14:12:07 +01:00
2024-08-22 14:12:07 +01:00
2024-10-03 17:10:57 +02:00
2024-10-03 17:10:57 +02:00
2024-10-30 09:50:27 -07:00
2024-10-15 11:28:39 +01:00
2024-05-18 08:25:43 +02:00
2024-10-15 11:28:39 +01:00
2024-10-15 11:28:39 +01:00
2024-10-10 09:26:04 +01:00
2024-10-10 09:26:04 +01:00
2024-10-15 11:28:39 +01:00
2024-09-13 12:57:41 +01:00
2024-10-03 17:10:57 +02:00
2024-10-15 11:28:39 +01:00
2024-08-22 14:12:07 +01:00
2024-06-05 14:43:58 +01:00
2024-10-01 16:18:36 +01:00
2024-10-01 16:18:36 +01:00
2024-09-05 14:55:01 -03:00
2024-09-13 12:57:11 +01:00
2024-06-14 09:37:38 +05:30
2024-06-14 09:37:38 +05:30
2024-10-16 10:27:50 +01:00
2024-09-05 14:55:01 -03:00
2024-10-04 10:46:31 +01:00
2024-10-15 11:28:39 +01:00
2024-10-15 11:28:39 +01:00
2024-09-05 14:55:01 -03:00
2024-10-03 17:10:57 +02:00
2024-05-18 08:25:43 +02:00
2024-05-18 08:25:43 +02:00
2024-06-04 11:15:31 -07:00
2024-10-03 17:10:57 +02:00
2024-08-23 14:32:43 +02:00
2024-10-03 17:10:57 +02:00
2024-10-03 17:10:57 +02:00
2024-06-04 11:15:31 -07:00
2024-10-15 11:28:39 +01:00
2024-10-01 16:45:59 +01:00
2024-10-15 11:28:39 +01:00
2024-10-15 11:28:39 +01:00
2024-10-15 11:28:39 +01:00
2024-10-15 11:28:39 +01:00
2024-10-15 11:28:39 +01:00
2024-10-15 11:28:39 +01:00
2024-10-15 11:28:39 +01:00
2024-10-28 14:19:20 +00:00
2024-10-15 11:28:39 +01:00
2024-10-15 11:28:39 +01:00
2024-10-15 11:28:39 +01:00
2024-10-15 11:28:39 +01:00
2024-10-15 11:28:39 +01:00
2024-10-15 11:28:39 +01:00
2024-10-15 11:28:39 +01:00
2024-10-15 11:28:39 +01:00
2024-10-15 11:28:39 +01:00
2024-10-15 11:28:39 +01:00
2024-10-15 11:28:39 +01:00
2024-10-15 11:28:39 +01:00
2024-10-15 11:28:39 +01:00
2024-10-15 11:28:39 +01:00
2024-10-15 11:28:39 +01:00
2024-10-15 11:28:39 +01:00
2024-10-15 11:28:39 +01:00
2024-10-15 11:28:39 +01:00
2024-05-16 15:27:59 +01:00
2024-10-15 11:28:39 +01:00
2024-10-15 11:28:39 +01:00
2024-10-15 11:28:39 +01:00
2024-10-15 11:28:39 +01:00
2024-10-15 11:28:39 +01:00
2024-10-15 11:28:39 +01:00
2024-10-15 11:28:39 +01:00
2024-10-15 11:28:39 +01:00
2024-10-15 11:28:39 +01:00
2024-10-15 11:28:39 +01:00
2024-10-15 11:28:39 +01:00
2024-07-09 11:33:15 +01:00
2024-10-15 11:28:39 +01:00
2024-10-28 14:19:20 +00:00
2024-10-15 11:28:39 +01:00