This is an archive of the discontinued LLVM Phabricator instance.

[mips] Check the register class before replacing materializations of zero with $zero in microMIPS.
ClosedPublic

Authored by vkalintiris on Oct 22 2015, 6:49 AM.

Details

Summary

The microMIPS register class GPRMM16 does not contain the $zero register.
However, MipsSEDAGToDAGISel::replaceUsesWithZeroReg() would replace uses
of the $dst register:

[d]addiu, $dst, $zero, 0

with the $zero register, without checking for membership in the register
class of the target machine operand.

Diff Detail

Repository
rL LLVM

Event Timeline

vkalintiris retitled this revision from to [mips] Check the register class before replacing materializations of zero with $zero in microMIPS..
vkalintiris updated this object.
vkalintiris added a reviewer: dsanders.
vkalintiris added a subscriber: llvm-commits.
dsanders accepted this revision.Oct 28 2015, 5:22 PM
dsanders edited edge metadata.

LGTM

This revision is now accepted and ready to land.Oct 28 2015, 5:22 PM
This revision was automatically updated to reflect the committed changes.