aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/LiveRangeEdit.cpp
diff options
context:
space:
mode:
authorStanislav Mekhanoshin <Stanislav.Mekhanoshin@amd.com>2021-07-12 12:27:34 -0700
committerStanislav Mekhanoshin <Stanislav.Mekhanoshin@amd.com>2021-07-14 13:03:58 -0700
commit76b7d3432e38bb7690c3bbd4940786b5cb751b95 (patch)
tree7e1d3e09a666b6fa2b7297c9aa5573ffdd5114ab /llvm/lib/CodeGen/LiveRangeEdit.cpp
parentba2690b17b9e463b80a1d6c675e3d04fc2974083 (diff)
downloadllvm-76b7d3432e38bb7690c3bbd4940786b5cb751b95.zip
llvm-76b7d3432e38bb7690c3bbd4940786b5cb751b95.tar.gz
llvm-76b7d3432e38bb7690c3bbd4940786b5cb751b95.tar.bz2
[AMDGPU] Add TII::isIgnorableUse() to allow VOP rematerialization
Any def of EXEC prevents rematerialization of any VOP instruction because of the physreg use. Create a callback to check if the physreg use can be ingored to allow rematerialization. Differential Revision: https://reviews.llvm.org/D105836
Diffstat (limited to 'llvm/lib/CodeGen/LiveRangeEdit.cpp')
-rw-r--r--llvm/lib/CodeGen/LiveRangeEdit.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/LiveRangeEdit.cpp b/llvm/lib/CodeGen/LiveRangeEdit.cpp
index c5d1734..64a2dd2 100644
--- a/llvm/lib/CodeGen/LiveRangeEdit.cpp
+++ b/llvm/lib/CodeGen/LiveRangeEdit.cpp
@@ -113,9 +113,10 @@ bool LiveRangeEdit::allUsesAvailableAt(const MachineInstr *OrigMI,
if (!MO.isReg() || !MO.getReg() || !MO.readsReg())
continue;
- // We can't remat physreg uses, unless it is a constant.
+ // We can't remat physreg uses, unless it is a constant or target wants
+ // to ignore this use.
if (Register::isPhysicalRegister(MO.getReg())) {
- if (MRI.isConstantPhysReg(MO.getReg()))
+ if (MRI.isConstantPhysReg(MO.getReg()) || TII.isIgnorableUse(MO))
continue;
return false;
}