This is an archive of the discontinued LLVM Phabricator instance.

[CallSiteSplitting] Do not crash when BB's terminator changes.
ClosedPublic

Authored by fhahn on Feb 27 2018, 9:24 AM.

Details

Summary

Change doCallSiteSplitting to iterate until we reach the terminator instruction.
tryToSplitCallSite can replace BB's terminator in case BB is a successor of
itself. Then IE will be invalidated and we also have to check the current
terminator.

Diff Detail

Repository
rL LLVM

Event Timeline

fhahn created this revision.Feb 27 2018, 9:24 AM
fhahn added a comment.Feb 27 2018, 9:27 AM

I am not entirely sure if that's the best solution, but it should work. Maybe it would be nicer to split the pas into an analysis and transformation phase, then we would get rid of the problem.

@uabelho it would be great if you could check if this patch together with D43824 fixes the regressions you are seeing?

Assuming D43824 is fixed, this seems to be an easy quick fix, but I tend to lean on separating this pass into two phases; in D43729, we also need to exit early. I'm okay to get it in first, followed by a patch to make separate phases.

I am not entirely sure if that's the best solution, but it should work. Maybe it would be nicer to split the pas into an analysis and transformation phase, then we would get rid of the problem.

@uabelho it would be great if you could check if this patch together with D43824 fixes the regressions you are seeing?

@fhahn: I applied D43822 together with D43824 on top of tree and that made the crash that I saw go away.

Great!

@fhahn: What the status with this now?

I've reverted r325126 (Recommit r325001: [CallSiteSplitting] Support splitting of blocks with instrs before call.) downstream
to avoid the regressions I saw, but that is getting increasingly difficult now since D43729 made it into tree.

It would thus be very nice if this (and D43822 ?) could land so I could remove my local reverts.

fhahn added a comment.Mar 5 2018, 3:21 AM

@fhahn: What the status with this now?

I think it's mostly pending review of D43822

@fhahn: What the status with this now?

I think it's mostly pending review of D43822

@fhahn: What the status with this now?

I think it's mostly pending review of D43822

Great! I saw D43822 was accepted now so then you could submit them?

fhahn accepted this revision.Mar 6 2018, 5:46 AM

Accepting in to make arc happy. Jun, I created a TODO for myself to split it up in analysis & transformation. It might take a few weeks until I get around to that though.

This revision is now accepted and ready to land.Mar 6 2018, 5:46 AM
This revision was automatically updated to reflect the committed changes.