diff options
author | Tim Northover <tnorthover@apple.com> | 2019-07-09 11:35:35 +0000 |
---|---|---|
committer | Tim Northover <tnorthover@apple.com> | 2019-07-09 11:35:35 +0000 |
commit | 60afa49abed6efdd7196d38ec884727090cfe373 (patch) | |
tree | a9af173067a23e1f6fa896cfb31bde34ec7cb3b3 /llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp | |
parent | 01eaae6dd12862cda6b42d565a215b07a178aba6 (diff) | |
download | llvm-60afa49abed6efdd7196d38ec884727090cfe373.zip llvm-60afa49abed6efdd7196d38ec884727090cfe373.tar.gz llvm-60afa49abed6efdd7196d38ec884727090cfe373.tar.bz2 |
OpaquePtr: add Type parameter to Loads analysis API.
This makes the functions in Loads.h require a type to be specified
independently of the pointer Value so that when pointers have no structure
other than address-space, it can still do its job.
Most callers had an obvious memory operation handy to provide this type, but a
SROA and ArgumentPromotion were doing more complicated analysis. They get
updated to merge the properties of the various instructions they were
considering.
llvm-svn: 365468
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp index cf5e903..adcb0b3 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp @@ -4004,7 +4004,8 @@ void SelectionDAGBuilder::visitLoad(const LoadInst &I) { bool isVolatile = I.isVolatile(); bool isNonTemporal = I.getMetadata(LLVMContext::MD_nontemporal) != nullptr; bool isInvariant = I.getMetadata(LLVMContext::MD_invariant_load) != nullptr; - bool isDereferenceable = isDereferenceablePointer(SV, DAG.getDataLayout()); + bool isDereferenceable = + isDereferenceablePointer(SV, I.getType(), DAG.getDataLayout()); unsigned Alignment = I.getAlignment(); AAMDNodes AAInfo; @@ -4629,7 +4630,8 @@ void SelectionDAGBuilder::visitAtomicLoad(const LoadInst &I) { Flags |= MachineMemOperand::MOVolatile; if (I.getMetadata(LLVMContext::MD_invariant_load) != nullptr) Flags |= MachineMemOperand::MOInvariant; - if (isDereferenceablePointer(I.getPointerOperand(), DAG.getDataLayout())) + if (isDereferenceablePointer(I.getPointerOperand(), I.getType(), + DAG.getDataLayout())) Flags |= MachineMemOperand::MODereferenceable; Flags |= TLI.getMMOFlags(I); |