Merge pull request #759 from phire/fix_mul_op

Fix power of 2 OP_MUL optimisation (Fixes Geekbench result upload)
This commit is contained in:
Stefanos Kornilios Mitsis Poiitidis 2021-02-07 08:08:37 +02:00 committed by GitHub
commit b40131ede3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -712,7 +712,9 @@ bool ConstProp::Run(IREmitter *IREmit) {
uint64_t amt = __builtin_ctzl(Constant2);
IREmit->SetWriteCursor(CodeNode);
auto shift = IREmit->_Lshl(CurrentIR.GetNode(Op->Header.Args[0]), IREmit->_Constant(amt));
shift.first->Header.Size = IROp->Size; // force Lshl to be the same size as the original Mul
IREmit->ReplaceAllUsesWith(CodeNode, shift);
Changed = true;
}
}
break;