File tree Expand file tree Collapse file tree 2 files changed +16
-5
lines changed
Expand file tree Collapse file tree 2 files changed +16
-5
lines changed Original file line number Diff line number Diff line change @@ -8038,12 +8038,22 @@ void GradientUtils::eraseFictiousPHIs() {
80388038 for (auto pair : phis) {
80398039 auto pp = pair.first ;
80408040 if (pp->getNumUses () != 0 ) {
8041- llvm::errs () << " mod:" << *oldFunc->getParent () << " \n " ;
8042- llvm::errs () << " oldFunc:" << *oldFunc << " \n " ;
8043- llvm::errs () << " newFunc:" << *newFunc << " \n " ;
8044- llvm::errs () << " pp: " << *pp << " of " << *pair.second << " \n " ;
8041+ if (CustomErrorHandler) {
8042+ std::string str;
8043+ raw_string_ostream ss (str);
8044+ ss << " Illegal replace ficticious phi for: " << *pp << " of "
8045+ << *pair.second ;
8046+ CustomErrorHandler (str.c_str (), wrap (pair.second ),
8047+ ErrorType::IllegalReplaceFicticiousPHIs, this ,
8048+ wrap (pp), nullptr );
8049+ } else {
8050+ llvm::errs () << " mod:" << *oldFunc->getParent () << " \n " ;
8051+ llvm::errs () << " oldFunc:" << *oldFunc << " \n " ;
8052+ llvm::errs () << " newFunc:" << *newFunc << " \n " ;
8053+ llvm::errs () << " pp: " << *pp << " of " << *pair.second << " \n " ;
8054+ assert (pp->getNumUses () == 0 );
8055+ }
80458056 }
8046- assert (pp->getNumUses () == 0 );
80478057 pp->replaceAllUsesWith (UndefValue::get (pp->getType ()));
80488058 erase (pp);
80498059 }
Original file line number Diff line number Diff line change @@ -83,6 +83,7 @@ enum class ErrorType {
8383 InternalError = 5 ,
8484 TypeDepthExceeded = 6 ,
8585 MixedActivityError = 7 ,
86+ IllegalReplaceFicticiousPHIs = 8
8687};
8788
8889extern " C" {
You can’t perform that action at this time.
0 commit comments