diff options
author | 2023-10-18 22:19:06 -0700 | |
---|---|---|
committer | 2023-10-18 22:19:45 -0700 | |
commit | 03786143361db9d8581cb02ed1c5027d732b62fc (patch) | |
tree | 9648c84be16fee40fb8403b30ba296d785475b28 /absl/random/generators_test.cc | |
parent | 9687a8ea750bfcddf790372093245a1d041b21a3 (diff) |
Optimize prefetch codegen.
Currently we use "r" constraint to pass prefetched address.
This forces the compiler to actually put it into a register.
As the result some uses look as:
16bfb7c: 48 01 cf add %rcx,%rdi
16bfb7f: 0f 0d 0f prefetchw (%rdi)
--
16bfccf: 48 83 c1 60 add $0x60,%rcx
16bfcd3: 0f 0d 09 prefetchw (%rcx)
Use "m" constraint instead. It's more relaxed and requires
to just materialize the address in some form using whatever
addressing modes the target supports (e.g. x86 off(base, index, scale)).
With the change the same code becomes:
16bfb7c: 0f 0d 0c 39 prefetchw (%rcx,%rdi,1)
--
16bfccf: 0f 0d 49 60 prefetchw 0x60(%rcx)
PiperOrigin-RevId: 574723975
Change-Id: Id0c8645f8c702d1842685343901da321f6513156
Diffstat (limited to 'absl/random/generators_test.cc')
0 files changed, 0 insertions, 0 deletions