This phenomenon is one of a family of phenomena known as Canadian Raising. "Traditional" Canadian raising involves the systematic vowel quality distinction made for the diphthongs /aɪ/ and /aʊ/ when they are followed by a voiced vs. a voiceless consonant. Generally they are realized as [ʌɪ] and [ʌʊ], respectively (or some similar variants), before a voiceless consonant.
There are several varieties of this phenomenon, however, and the one to which you are referring happens to be the one that I speak. I was born and raised in New Jersey, USA, which is one of the regions where this variety is commonly found. I make the voiced/voiceless distinction for /aɪ/ but not for /aʊ/. I maintain the distinction even when the underlying voicing distinction is neutralized, as in the flapping examples you mentioned, like writer and rider.
Those facts alone may not be that surprising, but there are certain seemingly exceptional examples in my dialect that make it less than straightforward to analyze from a phonological perspective. For example, in most cases the raising is only "triggered" when the voiceless consonant is in the same morpheme as the diphthong--so [ʌɪ] appears in ice cream but not I scream. But there are exceptions to this generalization--[ʌɪ] occurs in high school (when it refers to the institution of secondary education). Also, as you mentioned, the raised version of the diphthong occurs in some cases before voiced consonants! It appears in spider, idle, and cyber, for example. Finally, it can even appear before [nt], as in pint (as opposed to pined).
Because of the exceptional examples in my dialect, a phonologist who believes in phonemes would have to concede that I actually have two separate phonemes, /aɪ/ and /ʌɪ/, in my inventory. There's no other way to explain minimal pairs like cider vs. sider and high school (the lexicalized compound) vs. high school (meaning 'a school that is high'). When I first mentioned all of these examples to a colleague of mine, she wouldn't believe me; she thought I was making them up. She finally came around when I pointed her to this Wikipedia article! In analyzing my dialect I would still posit a regular rule/constraint that keeps /aɪ/ from surfacing as [aɪ] before voiceless coda consonants, but such a rule would not be sufficient to cover all the cases.
Just for fun, I'm listing some additional notable examples below:
No raising: IC, bisexual, flyswatter, high, rider, tidy, pie plate, Pythagoras, pined, highchair, high-speed, IT, wi-fi, bystander, bifocals, Lysander, sider, slider, cyborg, hyperbole
Raising: icy, bicycle, ice water, height, writer, tighty, disciple, python, pint, high school (compound), mighty, wife, feisty, license, Lysol, cider, spider, cyberspace, hyper
UPDATE: I've realized, after looking at the above examples, that syllable structure might play a role. The reason is that I have a very strong intuition that the raising is obligatory in monosyllabic words that end in a voiceless coda. Give me a nonce word with one syllable and a voiceless coda, and the vowel can never be realized as the non-raised /aɪ/. Further, if you look at the apparent exceptions in the "no raising" group above, such as Pythagoras and bifocals, what they appear to have in common is that the syllable following the diphthong-containing syllable always appears to be stressed (either primarily or secondarily). In words like python and bicycle (and of course writer) I have the intuition that the following syllable is unstressed and therefore the voiceless consonant is ambisyllabic (i.e. behaving both as a coda and an onset). This doesn't explain the exceptions that go in the other direction (i.e. raising occurring before voiced consonants), but at least it allows us to formulate the raising rule (or constraint) in a way that makes it exceptionless! This would also explain why I would raise the diphthong in polysyllabic nonce printed words like griter but not in those like gritatious.