ConstProp: treat StoreContext as zeroable

todo: FPR equivalent.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
This commit is contained in:
Alyssa Rosenzweig committed 2024-07-21 15:49:09 -04:00
1 parent d20b46e46f
commit 610caf8529
2 files changed
+3 -2

No files matched your search

@@ -52,7 +52,7 @@ DEF_OP(StoreContext) {
const auto OpSize = IROp->Size;
if (Op->Class == FEXCore::IR::GPRClass) {
auto Src = GetReg(Op->Value.ID());
auto Src = GetZeroableReg(Op->Value);
switch (OpSize) {
case 1: strb(Src, STATE, Op->Offset); break;
@@ -629,7 +629,8 @@ void ConstProp::ConstantInlining(IREmitter* IREmit, const IRListView& CurrentIR)
break;
}
case OP_ADC:
case OP_ADCWITHFLAGS: {
case OP_ADCWITHFLAGS:
case OP_STORECONTEXT: {
uint64_t Constant1 {};
if (IREmit->IsValueConstant(IROp->Args[0], &Constant1)) {
if (Constant1 == 0) {