An LLVM pass that does loop header fission?

Hi Fellows,

In the following C code,

for (int t = 0; t < N; ++t) { // loop A
int result = 0;
for (int i = 0; i < M; ++i) { // loop B
… … …
}
}

clang puts “int result = 0” in the loop B’s header (along with int i = 0). But
what I need is “int result = 0” residing in the preheader of the loop (I.e., in
a separated BB from where “int i = 0” is at). Is there an LLVM pass that can
force that to happen always?