From bb4e6993c89c505217c166f4c5d62e40bd11fd28 Mon Sep 17 00:00:00 2001 From: Brian Fiete Date: Wed, 4 Dec 2024 08:35:14 -0500 Subject: [PATCH] Fixed aliasing case during 3-form inst decomposition --- IDEHelper/Backend/BeMCContext.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/IDEHelper/Backend/BeMCContext.cpp b/IDEHelper/Backend/BeMCContext.cpp index 880f6441..54e08070 100644 --- a/IDEHelper/Backend/BeMCContext.cpp +++ b/IDEHelper/Backend/BeMCContext.cpp @@ -9352,7 +9352,9 @@ bool BeMCContext::DoLegalization() else { bool handled = false; - if (OperandsEqual(inst->mResult, inst->mArg1)) + // Check for exact quality or potential aliasing + if ((OperandsEqual(inst->mResult, inst->mArg1)) || + ((HasLoad(inst->mResult)) && (HasLoad(inst->mArg1)))) { // We need a scratch reg for this ReplaceWithNewVReg(inst->mArg1, instIdx, true);