Skip to content

Commit 3af6289

Browse files
committed
[TSAR, Memory] Minor fixes after rebase onto master
1 parent 0ca1c8f commit 3af6289

File tree

3 files changed

+8
-9
lines changed

3 files changed

+8
-9
lines changed

lib/Analysis/Memory/DefinedMemory.cpp

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -310,8 +310,7 @@ std::pair<MemoryLocationRange, bool> aggregate(
310310
int64_t Offset;
311311
auto *BasePtr = GetPointerBaseWithConstantOffset(
312312
Loc.Ptr, Offset, Fwk->getDataLayout());
313-
auto *GV{dyn_cast<GlobalValue>(GetUnderlyingObject(Loc.Ptr,
314-
Fwk->getDataLayout(), 0))};
313+
auto *GV{dyn_cast<GlobalValue>(getUnderlyingObject(Loc.Ptr, 0))};
315314
if (Fwk->getDataLayout().getTypeStoreSize(ElemType).isScalable() ||
316315
LocInfo.second->Subscripts.size() != ArrayPtr->getNumberOfDims() ||
317316
!Loc.LowerBound.hasValue() || !Loc.UpperBound.hasValue() ||
@@ -1145,11 +1144,10 @@ void ReachDFFwk::collapse(DFRegion *R) {
11451144
const LocationSet &LS) -> bool {
11461145
bool AreAllCollapsedOrAuxiliary = true;
11471146
bool HasCollapsed = false;
1148-
auto *GV{dyn_cast<GlobalValue>(
1149-
GetUnderlyingObject(Loc.Ptr, getDataLayout(), 0))};
1147+
auto *GV{dyn_cast<GlobalValue>(getUnderlyingObject(Loc.Ptr, 0))};
11501148
for (auto &OtherLoc : LS) {
11511149
auto *OtherGV{dyn_cast<GlobalValue>(
1152-
GetUnderlyingObject(OtherLoc.Ptr, getDataLayout(), 0))};
1150+
getUnderlyingObject(OtherLoc.Ptr, 0))};
11531151
if (GV == OtherGV) {
11541152
if ((OtherLoc.Kind & MemoryLocationRange::LocKind::Collapsed) &&
11551153
!(OtherLoc.Kind & MemoryLocationRange::LocKind::Auxiliary))
@@ -1215,7 +1213,7 @@ void ReachDFFwk::collapse(DFRegion *R) {
12151213
for (auto &Loc : NewUses) {
12161214
// Check if the location is strictly default, not collapsable.
12171215
auto *GV{dyn_cast<GlobalValue>(
1218-
GetUnderlyingObject(Loc.Ptr, getDataLayout(), 0))};
1216+
getUnderlyingObject(Loc.Ptr, 0))};
12191217
bool SkipExcessUse = false;
12201218
LLVM_DEBUG(
12211219
dbgs() << "Check location: ";
@@ -1231,7 +1229,7 @@ void ReachDFFwk::collapse(DFRegion *R) {
12311229
bool AreAllCollapsed = true;
12321230
for (auto &OtherLoc : NewUses) {
12331231
auto *OtherGV{dyn_cast<GlobalValue>(
1234-
GetUnderlyingObject(OtherLoc.Ptr, getDataLayout(), 0))};
1232+
getUnderlyingObject(OtherLoc.Ptr, 0))};
12351233
if (GV == OtherGV) {
12361234
SameUnderlyingObjCount++;
12371235
if (Loc.Ptr != OtherLoc.Ptr) {
@@ -1248,7 +1246,7 @@ void ReachDFFwk::collapse(DFRegion *R) {
12481246
auto MaySkipNonCollapsable = true;
12491247
for (auto &OtherLoc : NewUses) {
12501248
auto *OtherGV{dyn_cast<GlobalValue>(
1251-
GetUnderlyingObject(OtherLoc.Ptr, getDataLayout(), 0))};
1249+
getUnderlyingObject(OtherLoc.Ptr, 0))};
12521250
if (GV == OtherGV) {
12531251
if (!(OtherLoc.Kind & MemoryLocationRange::LocKind::Auxiliary) &&
12541252
!(OtherLoc.Kind & MemoryLocationRange::LocKind::Collapsed) &&

lib/Transform/IR/RedundantEdgeElimination.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525

2626
#include "tsar/Transform/IR/Passes.h"
2727
#include <bcl/utility.h>
28+
#include <llvm/IR/Constants.h>
2829
#include <llvm/IR/Instructions.h>
2930
#include <llvm/Pass.h>
3031
#include <llvm/Support/Debug.h>

lib/Unparse/Utils.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ void printLocationSource(llvm::raw_ostream &O, const MemoryLocationRange &Loc,
9999
O << " (" << Loc.getKindAsString() << ") ";
100100
O << " [" << Loc.Ptr << "]";
101101
if (DL)
102-
O << " [Underlying: " << GetUnderlyingObject(Loc.Ptr, *DL, 0) << "]";
102+
O << " [Underlying: " << getUnderlyingObject(Loc.Ptr, 0) << "]";
103103
}
104104
}
105105
void printLocationSource(llvm::raw_ostream &O, const EstimateMemory &EM,

0 commit comments

Comments
 (0)