Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
wsmoses committed Nov 4, 2024
1 parent 2336eec commit 2b0dd8e
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion enzyme/Enzyme/JLInstSimplify.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,10 @@ bool notCapturedBefore(llvm::Value *V, Instruction *inst) {
if (isa<CmpInst>(UI)) {
continue;
}
if (isa<SelectInst>(UI) || isa<PHINode>(UI)) {
todo.push_back(UI);
continue;
}
if (isa<LoadInst>(UI)) {
todo.push_back(UI);
continue;
Expand Down Expand Up @@ -162,7 +166,9 @@ bool jlInstSimplify(llvm::Function &F, TargetLibraryInfo &TLI,
if (auto LI = dyn_cast<LoadInst>(&I)) {
size_t offset = 0;
auto obj = getBaseObject(LI->getPointerOperand(),
/*offsetAllowed=*/false, &offset);
/*offsetAllowed=*/true, &offset);
// llvm::errs() << " LI: " << *LI << " obj: " << *obj << " off " <<
// offset << " ptr: " << *LI->getPointerOperand() << "\n";
if (auto CI = dyn_cast<CallBase>(obj)) {
if (getFuncNameFromCall(CI) == "jl_alloc_genericmemory") {
if (offset == 0) {
Expand Down

0 comments on commit 2b0dd8e

Please sign in to comment.