summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorHans Wennborg <hans@hanshq.net>2017-08-03 16:31:39 +0000
committerHans Wennborg <hans@hanshq.net>2017-08-03 16:31:39 +0000
commit94231124ce00ea8d5c11f8b443dd95dce540d00a (patch)
tree8a0f75b8e9bd9117c47bc9f943a538059903d124 /include
parentf632da1f7934a284b1cb0bcdff2d93bea6631c17 (diff)
Merging r309651 and r309849:
------------------------------------------------------------------------ r309651 | inouehrs | 2017-07-31 20:32:15 -0700 (Mon, 31 Jul 2017) | 16 lines [StackColoring] Update AliasAnalysis information in stack coloring pass Stack coloring pass need to maintain AliasAnalysis information when merging stack slots of different types. Actually, there is a FIXME comment in StackColoring.cpp // FIXME: In order to enable the use of TBAA when using AA in CodeGen, // we'll also need to update the TBAA nodes in MMOs with values // derived from the merged allocas. But, TBAA has been already enabled in CodeGen without fixing this pass. The incorrect TBAA metadata results in recent failures in bootstrap test on ppc64le (PR33928) by allowing unsafe instruction scheduling. Although we observed the problem on ppc64le, this is a platform neutral issue. This patch makes the stack coloring pass maintains AliasAnalysis information when merging multiple stack slots. ------------------------------------------------------------------------ ------------------------------------------------------------------------ r309849 | inouehrs | 2017-08-02 11:16:32 -0700 (Wed, 02 Aug 2017) | 19 lines [StackColoring] Update AliasAnalysis information in stack coloring pass (part 2) This patch is update after the first patch (https://reviews.llvm.org/rL309651) based on the post-commit comments. Stack coloring pass need to maintain AliasAnalysis information when merging stack slots of different types. Actually, there is a FIXME comment in StackColoring.cpp // FIXME: In order to enable the use of TBAA when using AA in CodeGen, // we'll also need to update the TBAA nodes in MMOs with values // derived from the merged allocas. But, TBAA has been already enabled in CodeGen without fixing this pass. The incorrect TBAA metadata results in recent failures in bootstrap test on ppc64le (PR33928) by allowing unsafe instruction scheduling. Although we observed the problem on ppc64le, this is a platform neutral issue. This patch makes the stack coloring pass maintains AliasAnalysis information when merging multiple stack slots. This patch fixes PR33928. ------------------------------------------------------------------------ git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_50@309957 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/Analysis/ValueTracking.h6
-rw-r--r--include/llvm/CodeGen/MachineFunction.h6
-rw-r--r--include/llvm/CodeGen/MachineInstr.h3
3 files changed, 15 insertions, 0 deletions
diff --git a/include/llvm/Analysis/ValueTracking.h b/include/llvm/Analysis/ValueTracking.h
index f4c57d4289fc..da058b1d3918 100644
--- a/include/llvm/Analysis/ValueTracking.h
+++ b/include/llvm/Analysis/ValueTracking.h
@@ -312,6 +312,12 @@ template <typename T> class ArrayRef;
const DataLayout &DL, LoopInfo *LI = nullptr,
unsigned MaxLookup = 6);
+ /// This is a wrapper around GetUnderlyingObjects and adds support for basic
+ /// ptrtoint+arithmetic+inttoptr sequences.
+ void getUnderlyingObjectsForCodeGen(const Value *V,
+ SmallVectorImpl<Value *> &Objects,
+ const DataLayout &DL);
+
/// Return true if the only users of this pointer are lifetime markers.
bool onlyUsedByLifetimeMarkers(const Value *V);
diff --git a/include/llvm/CodeGen/MachineFunction.h b/include/llvm/CodeGen/MachineFunction.h
index 19173fa39bdc..010d7032c516 100644
--- a/include/llvm/CodeGen/MachineFunction.h
+++ b/include/llvm/CodeGen/MachineFunction.h
@@ -661,6 +661,12 @@ public:
MachineMemOperand *getMachineMemOperand(const MachineMemOperand *MMO,
int64_t Offset, uint64_t Size);
+ /// Allocate a new MachineMemOperand by copying an existing one,
+ /// replacing only AliasAnalysis information. MachineMemOperands are owned
+ /// by the MachineFunction and need not be explicitly deallocated.
+ MachineMemOperand *getMachineMemOperand(const MachineMemOperand *MMO,
+ const AAMDNodes &AAInfo);
+
using OperandCapacity = ArrayRecycler<MachineOperand>::Capacity;
/// Allocate an array of MachineOperands. This is only intended for use by
diff --git a/include/llvm/CodeGen/MachineInstr.h b/include/llvm/CodeGen/MachineInstr.h
index 95401e98b297..b87aff102d47 100644
--- a/include/llvm/CodeGen/MachineInstr.h
+++ b/include/llvm/CodeGen/MachineInstr.h
@@ -379,6 +379,9 @@ public:
return NumMemRefs == 1;
}
+ /// Return the number of memory operands.
+ unsigned getNumMemOperands() const { return NumMemRefs; }
+
/// API for querying MachineInstr properties. They are the same as MCInstrDesc
/// queries but they are bundle aware.