(TMZ) Scott Storch — one of the BIGGEST producers in hip hop — says Amy Winehouse “should have listened to her own song” … and checked herself into rehab before she died.

Storch would know … the man who’s worked with Dr. Dre, Snoop, Beyonce, Xtina, P!nk and more battled a HUGE cocaine addiction over the years. In fact, Storch says he blew nearly $30 million on the drug before he finally sought help and kicked the habit.

On his way into Trousdale nightclub in Hollywood last night, we asked Storch about Amy … and he told us, “Rest in peace … Drugs are f**ked up … I learned my own lesson too.”

Check out the video of Scott Storch here.