summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/PowerPC/PPCISelLowering.h
diff options
context:
space:
mode:
authorJustin Lebar <jlebar@google.com>2016-09-11 01:38:58 +0000
committerJustin Lebar <jlebar@google.com>2016-09-11 01:38:58 +0000
commitadbf09e8cfd3aa6bb104f45bf5f39e4e8578d2f8 (patch)
tree462f51cead1ea3e5f264f3c84af6e5e94aceda72 /llvm/lib/Target/PowerPC/PPCISelLowering.h
parent4fab7454c5480bc68732ba456bb3aff3ffdedfa0 (diff)
downloadbcm5719-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/Target/PowerPC/PPCISelLowering.h')
-rw-r--r--llvm/lib/Target/PowerPC/PPCISelLowering.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/llvm/lib/Target/PowerPC/PPCISelLowering.h b/llvm/lib/Target/PowerPC/PPCISelLowering.h
index e1dcd7d1d36..8b1c22b6bcd 100644
--- a/llvm/lib/Target/PowerPC/PPCISelLowering.h
+++ b/llvm/lib/Target/PowerPC/PPCISelLowering.h
@@ -761,12 +761,24 @@ namespace llvm {
SDValue Chain;
SDValue ResChain;
MachinePointerInfo MPI;
+ bool IsDereferenceable;
bool IsInvariant;
unsigned Alignment;
AAMDNodes AAInfo;
const MDNode *Ranges;
- ReuseLoadInfo() : IsInvariant(false), Alignment(0), Ranges(nullptr) {}
+ ReuseLoadInfo()
+ : IsDereferenceable(false), IsInvariant(false), Alignment(0),
+ Ranges(nullptr) {}
+
+ MachineMemOperand::Flags MMOFlags() const {
+ MachineMemOperand::Flags F = MachineMemOperand::MONone;
+ if (IsDereferenceable)
+ F |= MachineMemOperand::MODereferenceable;
+ if (IsInvariant)
+ F |= MachineMemOperand::MOInvariant;
+ return F;
+ }
};
bool canReuseLoadAddress(SDValue Op, EVT MemVT, ReuseLoadInfo &RLI,
OpenPOWER on IntegriCloud