OSDN Git Service

[TargetRegisterInfo, AArch64] Add target hook for isConstantPhysReg().
authorGeoff Berry <gberry@codeaurora.org>
Tue, 27 Sep 2016 22:17:27 +0000 (22:17 +0000)
committerGeoff Berry <gberry@codeaurora.org>
Tue, 27 Sep 2016 22:17:27 +0000 (22:17 +0000)
commitdcf371dfad16c1b7fd645490c5b73da7e8306c7e
tree28038c83406234eccfb99a0638aedf102386e971
parent8d5df95c2e19e659329bee41ec3625bfde77ab71
[TargetRegisterInfo, AArch64] Add target hook for isConstantPhysReg().

Summary:
The current implementation of isConstantPhysReg() checks for defs of
physical registers to determine if they are constant.  Some
architectures (e.g. AArch64 XZR/WZR) have registers that are constant
and may be used as destinations to indicate the generated value is
discarded, preventing isConstantPhysReg() from returning true.  This
change adds a TargetRegisterInfo hook that overrides the no defs check
for cases such as this.

Reviewers: MatzeB, qcolombet, t.p.northover, jmolloy

Subscribers: junbuml, aemerson, mcrosier, rengolin

Differential Revision: https://reviews.llvm.org/D24570

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282543 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Target/TargetRegisterInfo.h
lib/CodeGen/MachineRegisterInfo.cpp
lib/Target/AArch64/AArch64RegisterInfo.cpp
lib/Target/AArch64/AArch64RegisterInfo.h
test/CodeGen/MIR/AArch64/machine-sink-zr.mir [new file with mode: 0644]