0 0 votes please explain each optimization too! Compiler Design + – Gate Fever 1.9k views answer comment Share Follow Print See all 12 Comments 12 12 Comments reply Show 9 previous comments kumar.dilip commented Dec 15, 2018 reply Follow flag 1. operation y = y*2 ( this is costly operation compare to ) y = y <<1 , so we can replace that operation. this is called strength reduction. 2. y = 10 remove it from high-frequency( like loop) region to low frequency is called code motion. 3.we can write both the operation y = y<<1 and x++ in the single loop ( loop unrolling) 4. x = x*0, can be written like this x = 0 ( constant folding) 4 4 replyShare Gate Fever commented Dec 15, 2018 reply Follow flag okay,thanks! 0 0 replyShare Hira Thakur commented Nov 15, 2023 reply Follow flag on what basis we should judge that $x$ is a costlier operator and $y$ is a cheaper operator? 0 0 replyShare Please log in or register to add a comment.