OSDN Git Service

[mips] Check the register class before replacing materializations of zero with $zero...
authorVasileios Kalintiris <Vasileios.Kalintiris@imgtec.com>
Thu, 29 Oct 2015 10:17:16 +0000 (10:17 +0000)
committerVasileios Kalintiris <Vasileios.Kalintiris@imgtec.com>
Thu, 29 Oct 2015 10:17:16 +0000 (10:17 +0000)
commit8bbd2ffc7c7832f6964cff89d6a7f439a8840aea
tree5cbdabb6b098ea5b4a3a3b3d9a6b9259cb9589e5
parent0b88d3e7eec8fb872d861d8845962654c4163f2e
[mips] Check the register class before replacing materializations of zero with $zero in microMIPS.

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.

Reviewers: dsanders

Subscribers: llvm-commits, dsanders

Differential Revision: http://reviews.llvm.org/D13984

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251622 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/Mips/MipsSEISelDAGToDAG.cpp
test/CodeGen/Mips/micromips-zero-mat-uses.ll [new file with mode: 0644]