Turn on refcount-opts with loops.

Summary: D1550496 seemed to be the last of the issues.

Reviewed By: @ottoni

Differential Revision: D1577195
Move genCodeImpl from code-gen.cpp to back-end-arm.cpp

Summary: It is only used for ARM, and I need to customize it even
more to get ready for arm using vasm.

Reviewed By: @jasone

Differential Revision: D1577792