diff options
author | Justin Lebar <jlebar@google.com> | 2016-09-11 01:38:58 +0000 |
---|---|---|
committer | Justin Lebar <jlebar@google.com> | 2016-09-11 01:38:58 +0000 |
commit | adbf09e8cfd3aa6bb104f45bf5f39e4e8578d2f8 (patch) | |
tree | 462f51cead1ea3e5f264f3c84af6e5e94aceda72 /llvm/lib/CodeGen/MachinePipeliner.cpp | |
parent | 4fab7454c5480bc68732ba456bb3aff3ffdedfa0 (diff) | |
download | bcm5719-llvm-adbf09e8cfd3aa6bb104f45bf5f39e4e8578d2f8.tar.gz bcm5719-llvm-adbf09e8cfd3aa6bb104f45bf5f39e4e8578d2f8.zip |
[CodeGen] Split out the notions of MI invariance and MI dereferenceability.
Summary:
An IR load can be invariant, dereferenceable, neither, or both. But
currently, MI's notion of invariance is IR-invariant &&
IR-dereferenceable.
This patch splits up the notions of invariance and dereferenceability at
the MI level. It's NFC, so adds some probably-unnecessary
"is-dereferenceable" checks, which we can remove later if desired.
Reviewers: chandlerc, tstellarAMD
Subscribers: jholewinski, arsenm, nemanjai, llvm-commits
Differential Revision: https://reviews.llvm.org/D23371
llvm-svn: 281151
Diffstat (limited to 'llvm/lib/CodeGen/MachinePipeliner.cpp')
-rw-r--r-- | llvm/lib/CodeGen/MachinePipeliner.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/MachinePipeliner.cpp b/llvm/lib/CodeGen/MachinePipeliner.cpp index dc61ebaeae6..45e9d50805e 100644 --- a/llvm/lib/CodeGen/MachinePipeliner.cpp +++ b/llvm/lib/CodeGen/MachinePipeliner.cpp @@ -3082,7 +3082,8 @@ void SwingSchedulerDAG::updateMemOperands(MachineInstr &NewMI, MachineInstr::mmo_iterator NewMemRefs = MF.allocateMemRefsArray(NumRefs); unsigned Refs = 0; for (MachineMemOperand *MMO : NewMI.memoperands()) { - if (MMO->isVolatile() || MMO->isInvariant() || (!MMO->getValue())) { + if (MMO->isVolatile() || (MMO->isInvariant() && MMO->isDereferenceable()) || + (!MMO->getValue())) { NewMemRefs[Refs++] = MMO; continue; } |