Unsigned mul high for MIPS32 is selected into two PseudoInstructions:
PseudoMULTu and PseudoMFHI that use accumulator register class ACC64 for
some of its operands. Registers in this class have appropriate hi and lo
register as subregisters: $lo0 and $hi0 are subregisters of $ac0 etc.
mul instruction implicit-defs $lo0 and $hi0 according to MipsInstrInfo.td.
In functions where mul and PseudoMULTu are present fastRegisterAllocator
will "run out of registers during register allocation" because
'calcSpillCost' for $ac0 will return spillImpossible because subregisters
$lo0 and $hi0 of $ac0 are reserved by mul instruction above. A solution is
to mark implicit-defs of $lo0 and $hi0 as dead in mul instruction.
Details
Details
Diff Detail
Diff Detail
Event Timeline
Comment Actions
Reverted in https://reviews.llvm.org/rL355219
since it causes failure on bot that tests clang built with address sanitizer.
Comment Actions
selectImpl in some cases deletes I (using eraseFromParent()) and creates new instruction that is inserted in place of I in machine basic block.
In such cases I.getOpcode() accesses memory that was freed and can return unpredictable value.
For that reason we now select G_MUL manually before call to selectImpl.