[PATCH] D91833: [SelectionDAG] Avoid aliasing analysis if the object size is unknown.
Hsiangkai Wang via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Nov 19 17:57:29 PST 2020
HsiangKai updated this revision to Diff 306576.
HsiangKai added a comment.
clang format.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D91833/new/
https://reviews.llvm.org/D91833
Files:
llvm/lib/CodeGen/SelectionDAG/SelectionDAGAddressAnalysis.cpp
Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAGAddressAnalysis.cpp
===================================================================
--- llvm/lib/CodeGen/SelectionDAG/SelectionDAGAddressAnalysis.cpp
+++ llvm/lib/CodeGen/SelectionDAG/SelectionDAGAddressAnalysis.cpp
@@ -7,6 +7,7 @@
//===----------------------------------------------------------------------===//
#include "llvm/CodeGen/SelectionDAGAddressAnalysis.h"
+#include "llvm/Analysis/MemoryLocation.h"
#include "llvm/CodeGen/ISDOpcodes.h"
#include "llvm/CodeGen/MachineFrameInfo.h"
#include "llvm/CodeGen/MachineFunction.h"
@@ -96,6 +97,12 @@
int64_t PtrDiff;
if (NumBytes0.hasValue() && NumBytes1.hasValue() &&
BasePtr0.equalBaseIndex(BasePtr1, DAG, PtrDiff)) {
+ // If the size of memory access is unknown, do not use it to analysis.
+ // One example of unknown size memory access is to load/store scalable
+ // vector objects on the stack.
+ if (*NumBytes0 == static_cast<int64_t>(MemoryLocation::UnknownSize) ||
+ *NumBytes1 == static_cast<int64_t>(MemoryLocation::UnknownSize))
+ return false;
// BasePtr1 is PtrDiff away from BasePtr0. They alias if none of the
// following situations arise:
IsAlias = !(
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D91833.306576.patch
Type: text/x-patch
Size: 1232 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201120/8fedb926/attachment.bin>
More information about the llvm-commits
mailing list