Skip to content

Commit 5847647

Browse files
Track memops more accurately (#43778)
1 parent 49f4f78 commit 5847647

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/llvm-alloc-helpers.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,6 @@ bool AllocUseInfo::addMemOp(Instruction *inst, unsigned opno, uint32_t offset,
8080
MemOp memop(inst, opno);
8181
memop.offset = offset;
8282
uint64_t size = DL.getTypeStoreSize(elty);
83-
if (size >= UINT32_MAX - offset)
84-
return false;
8583
memop.size = size;
8684
memop.isaggr = isa<StructType>(elty) || isa<ArrayType>(elty) || isa<VectorType>(elty);
8785
memop.isobjref = hasObjref(elty);
@@ -105,6 +103,8 @@ bool AllocUseInfo::addMemOp(Instruction *inst, unsigned opno, uint32_t offset,
105103
field.second.hasaggr = true;
106104
}
107105
field.second.accesses.push_back(memop);
106+
if (size >= UINT32_MAX - offset)
107+
return false;
108108
return true;
109109
}
110110

src/llvm-alloc-helpers.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ namespace jl_alloc {
2727

2828
struct MemOp {
2929
llvm::Instruction *inst;
30+
uint64_t offset = 0;
3031
unsigned opno;
31-
uint32_t offset = 0;
3232
uint32_t size = 0;
3333
bool isobjref:1;
3434
bool isaggr:1;

0 commit comments

Comments
 (0)