Skip to content

Commit

Permalink
Special case gep of small_typeof (#1433)
Browse files Browse the repository at this point in the history
  • Loading branch information
wsmoses authored Sep 18, 2023
1 parent 4c6c0a6 commit a7302ce
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions enzyme/Enzyme/TypeAnalysis/TypeAnalysis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1401,6 +1401,16 @@ void TypeAnalyzer::visitGetElementPtrInst(GetElementPtrInst &gep) {
return;
}
}
if (auto GV = dyn_cast<GlobalVariable>(gep.getPointerOperand())) {
// from julia code, do not propagate int to operands
if (GV->getName() == "small_typeof") {
TypeTree T;
T.insert({-1}, BaseType::Pointer);
T.insert({-1, -1}, BaseType::Pointer);
updateAnalysis(&gep, T, &gep);
return;
}
}

if (gep.indices().begin() == gep.indices().end()) {
if (direction & DOWN)
Expand Down

0 comments on commit a7302ce

Please sign in to comment.