How does tsan guarantee it won't clobber the xmm registers?

Jie He Jie.He at arm.com
Tue May 12 02:31:16 UTC 2020


No, currently I didn’t find any error.

I just worry about the tsan internal implementation, which depends on the compiler optimization.

e.g. if there is a counted loop inside llvm/tsan code, is it possible to use vector instruction to optimize out by compiler?

I think tsan is supposed to not to clobber these registers, otherwise, instruments code in application have to save/restore too many registers.

Thanks
Jie He

From: Arthur Eubanks <aeubanks at google.com>
Sent: Tuesday, May 12, 2020 12:24 AM
To: Jie He <Jie.He at arm.com>
Cc: tsan-dev at openjdk.java.net; nd <nd at arm.com>
Subject: Re: How does tsan guarantee it won't clobber the xmm registers?

Could you be more specific as to which calls you're worried about?

TemplateTable::tsan_observe_get_or_put<https://github.com/openjdk/tsan/blob/3ec97caa4b3078a4cf1cd269caf1307618a4926a/src/hotspot/cpu/x86/templateTable_x86.cpp#L808> and TemplateTable::tsan_observe_load_or_store<https://github.com/openjdk/tsan/blob/3ec97caa4b3078a4cf1cd269caf1307618a4926a/src/hotspot/cpu/x86/templateTable_x86.cpp#L864 > do save xmm0.


On Thu, May 7, 2020 at 11:52 PM Jie He <Jie.He at arm.com<mailto:Jie.He at arm.com>> wrote:
Hi Arthur

I saw x86 code saves xmm0 because libc functions are called.
Then I have a question about current tsan instruments in interpreter.
How does tsan guarantee it won't clobber the xmm registers? I think it depends on compiler.
I couldn't find the documents or code to declare that.

Thanks
Jie He


More information about the tsan-dev mailing list