From d543fe9f594489aac8c42d2ef9b22a817bb37d17 Mon Sep 17 00:00:00 2001 From: Pat Gavlin Date: Wed, 26 Jul 2017 17:39:54 -0700 Subject: [PATCH] PR feedback. --- src/jit/codegencommon.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/jit/codegencommon.cpp b/src/jit/codegencommon.cpp index 5caf96f..da69bd4 100644 --- a/src/jit/codegencommon.cpp +++ b/src/jit/codegencommon.cpp @@ -2384,11 +2384,12 @@ FOUND_AM: } /* Special case: constant array index (that is range-checked) */ + CLANG_FORMAT_COMMENT_ANCHOR; #if defined(LEGACY_BACKEND) - // If we've already placed rv2 in a register, we were probably planning to use it in this addressing mode. - // Because the folding below may in fact result in no address mode (e.g. if we had "[mul * rv2 + cns]" that - // happens to fold to "[cns2]"), do not fold during code gen. + // If we've already placed rv2 in a register, we are probably being called in a context that has already + // presumed that an addressing mode will be created, even if rv2 is constant, and if we fold we may not find a + // useful addressing mode (e.g. if we had [mul * rv2 + cns] it might happen to fold to [cns2]. if (mode == -1 && rv2->InReg()) { fold = false; -- 2.7.4