@@ -396,14 +396,24 @@ bool FinalLowerGC::runOnFunction(Function &F)
396
396
LOWER_INTRINSIC (popGCFrame, lowerPopGCFrame);
397
397
LOWER_INTRINSIC (getGCFrameSlot, lowerGetGCFrameSlot);
398
398
LOWER_INTRINSIC (GCAllocBytes, lowerGCAllocBytes);
399
- LOWER_INTRINSIC (queueGCRoot, lowerQueueGCRoot);
400
399
LOWER_INTRINSIC (safepoint, lowerSafepoint);
401
400
401
+ // These lowerings preserve the CI and do not erase them from the parent
402
+ #define LOWER_WB_INTRINSIC (INTRINSIC, LOWER_INTRINSIC_FUNC ) \
403
+ auto INTRINSIC = getOrNull (jl_intrinsics::INTRINSIC); \
404
+ if (INTRINSIC == callee) { \
405
+ LOWER_INTRINSIC_FUNC (CI, F); \
406
+ ++it; \
407
+ continue ; \
408
+ } \
409
+
410
+ LOWER_WB_INTRINSIC (queueGCRoot, lowerQueueGCRoot);
411
+
402
412
#ifdef MMTK_GC
403
- LOWER_INTRINSIC (writeBarrier1, lowerWriteBarrier1);
404
- LOWER_INTRINSIC (writeBarrier2, lowerWriteBarrier2);
405
- LOWER_INTRINSIC (writeBarrier1Slow, lowerWriteBarrier1Slow);
406
- LOWER_INTRINSIC (writeBarrier2Slow, lowerWriteBarrier2Slow);
413
+ LOWER_WB_INTRINSIC (writeBarrier1, lowerWriteBarrier1);
414
+ LOWER_WB_INTRINSIC (writeBarrier2, lowerWriteBarrier2);
415
+ LOWER_WB_INTRINSIC (writeBarrier1Slow, lowerWriteBarrier1Slow);
416
+ LOWER_WB_INTRINSIC (writeBarrier2Slow, lowerWriteBarrier2Slow);
407
417
#endif
408
418
++it;
409
419
0 commit comments