Interference-Free Regions and Their Application to Compiler Optimization and Data-Race Detection