Splitting the edge is nontrivial because of the landing pad, and we would
currently assert trying to do it.
Details
- Reviewers
nlewycky iteratee - Commits
- rGe46e43f6b704: Merging r283129: --------------------------------------------------------------…
rGb4d2678c6f2c: Jump threading: avoid trying to split edge into landingpad block (PR27840)
rL283129: Jump threading: avoid trying to split edge into landingpad block (PR27840)
Diff Detail
Event Timeline
I'm concerned that the fix is too narrow. There's 10 callers to llvm::SplitEdge in LLVM and haven't audited them so I don't know whether they also check whether they also do this check. It's certainly not in the comment on SplitEdge that it's allowed to assert if you pass it a landing pad block.
My thinking was that it seems what jump threading is trying to do with a "branch on xor" pattern isn't going to work with a landingpad anyway, and this would fix the crash that people run into in practice.
I agree it doesn't fix the wider problem of what to do when SplitEdge fails, but it seems like a good improvement to me.
Ping?
Also +Kyle, who I think has looked at jump threading recently.
While I agree there's a bigger problem with SplitEdge failing, I'd like to commit this fix as the transformation this code is trying to do clearly won't work for landingpads, and users are getting crashes on this in the wild.
I didn't look very closely at jump threading, but nick said to land this patch via email on Sep 23, so I'm comfortable accepting it based on that.
Sorry for the mess here.
I missed Nick's emailed replies because they didn't show up on Phabricator, and while they did go to the mailing list, I wasn't on the to: or cc: line so my filter didn't catch it.
I'll land this and keep the PR open as suggested by Nick.