Merge "Skip loop optimization if there is no loop in the graph."
am: 0f44de8616

Change-Id: I0e8f7f547a3c58a88e2079a7ed3f224752b9406f