We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ed8b1b2 commit 8f76815Copy full SHA for 8f76815
include/swift/SILOptimizer/Utils/InstOptUtils.h
@@ -413,6 +413,13 @@ class InstModCallbacks {
413
void replaceValueUsesWith(SILValue oldValue, SILValue newValue) {
414
wereAnyCallbacksInvoked = true;
415
416
+ // If setUseValueFunc is not set, just call RAUW directly. RAUW in this case
417
+ // is equivalent to what we do below. We just enable better
418
+ // performance. This ensures that the default InstModCallback is really
419
+ // fast.
420
+ if (!setUseValueFunc)
421
+ return oldValue->replaceAllUsesWith(newValue);
422
+
423
while (!oldValue->use_empty()) {
424
auto *use = *oldValue->use_begin();
425
setUseValue(use, newValue);
0 commit comments