[Lldb-commits] [lldb] [lldb][AArch64] Invalidate SVG prior to reconfiguring ZA regdef (PR #66768)

David Spickett via lldb-commits lldb-commits at lists.llvm.org
Fri Oct 6 06:09:17 PDT 2023


================
@@ -783,6 +783,11 @@ void GDBRemoteRegisterContext::AArch64Reconfigure() {
   std::optional<uint64_t> svg_reg_value;
   const RegisterInfo *svg_reg_info = m_reg_info_sp->GetRegisterInfo("svg");
   if (svg_reg_info) {
+    // When vg is written it is automatically made invalid. Writing vg will also
+    // change svg if we're in streaming mode but it will not be made invalid
+    // so do this manually so the following read gets the latest svg value.
----------------
DavidSpickett wrote:

You're right there's `uint32_t *invalidate_regs;` in the register info, I didn't think to look at it.

The problem with that is it needs to know up front what the register number is. So we could make writes to svg invalidate vg since we know what vg's register number will be, but this is not needed since svg is read only. 

Making vg invalidate svg is harder because we don't know what number it will be, and it might not even exist.

Though, I could patch it in once we know we're adding the SME register set. Since after that we don't re-order registers, only change the size of some.

I'll give that a go. If patching it in works, it would lead to some redundant reads if you write vg during non-streaming mode, but it would be no worse than what I've got here I think.

https://github.com/llvm/llvm-project/pull/66768


More information about the lldb-commits mailing list