Revert 121907 (it causes llc crash) and apply original patch from PR9817.