From c0348d46cad830425e441d14d4bf2a40eeea0c15 Mon Sep 17 00:00:00 2001 From: EgorBo Date: Fri, 28 Jan 2022 15:22:50 +0300 Subject: [PATCH] Don't disable LEA for byrefs --- src/coreclr/jit/lower.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/coreclr/jit/lower.cpp b/src/coreclr/jit/lower.cpp index ed71bb09c4aa56..b111d73db6a995 100644 --- a/src/coreclr/jit/lower.cpp +++ b/src/coreclr/jit/lower.cpp @@ -4906,7 +4906,7 @@ bool Lowering::TryCreateAddrMode(GenTree* addr, bool isContainable, GenTree* par } #ifdef TARGET_ARM64 - if (parent->OperIsIndir() && parent->AsIndir()->IsVolatile()) + if (parent->OperIsIndir() && parent->AsIndir()->IsVolatile() && !varTypeIsGC(addr)) { // For Arm64 we avoid using LEA for volatile INDs // because we won't be able to use ldar/star