File tree 1 file changed +13
-2
lines changed
1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -835,12 +835,23 @@ class AdjointGenerator
835
835
}
836
836
}
837
837
if (!gutils->isConstantInstruction(&I) || !gutils->isConstantValue(&I)) {
838
+ if (looseTypeAnalysis) {
839
+ auto &DL = gutils->newFunc->getParent()->getDataLayout();
840
+ auto valType = I.getValOperand()->getType();
841
+ auto storeSize = DL.getTypeSizeInBits(valType) / 8;
842
+ auto fp = TR.firstPointer(storeSize, I.getPointerOperand(),
843
+ /*errifnotfound*/ false,
844
+ /*pointerIntSame*/ true);
845
+ if (!fp.isKnown() && valType->isIntOrIntVectorTy()) {
846
+ goto noerror;
847
+ }
848
+ }
838
849
TR.dump();
839
850
llvm::errs() << "oldFunc: " << *gutils->newFunc << "\n";
840
851
llvm::errs() << "I: " << I << "\n";
852
+ assert(0 && "Active atomic inst not handled");
841
853
}
842
- assert(gutils->isConstantInstruction(&I));
843
- assert(gutils->isConstantValue(&I));
854
+ noerror:;
844
855
845
856
if (Mode == DerivativeMode::ReverseModeGradient) {
846
857
eraseIfUnused(I, /*erase*/ true, /*check*/ false);
You can’t perform that action at this time.
0 commit comments