// Always expand atomic operations, we don't deal with atomicrmw or cmpxchg
// ourselves.
addPass(createAtomicExpandPass(TM));
+ // XXX-update: Immediate add -licm pass after atomic expand pass to deal with
+ // loop invariants introduced mannually.
+ addPass(createLICMPass());
// Cmpxchg instructions are often used with a subsequent comparison to
// determine whether it succeeded. We can exploit existing control-flow in