pass to eliminate unneeded "br" statements

I've been added various optimizer passes and I end up with code which
looks like this:

define i32 @main() uwtable {
entry:
  store i32 ()* @_main_1, i32 ()** @_main, align 8
  br label %end

end: ; preds = %entry
  ret i32 0
}

Is there another pass to get rid of that "br" instruction and just
inline the "end" block?

From: llvmdev-bounces@cs.uiuc.edu [mailto:llvmdev-bounces@cs.uiuc.edu]
On Behalf Of edA-qa mort-ora-y
Subject: [LLVMdev] pass to eliminate unneeded "br" statements

define i32 @main() uwtable {
entry:
  store i32 ()* @_main_1, i32 ()** @_main, align 8
  br label %end
end: ; preds = %entry
  ret i32 0
}

Is there another pass to get rid of that "br" instruction and just
inline the "end" block?

I would think SimplifyCFG should take care of it.

- Chuck

THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.

Yes, thank you. I just had to get the order of my passes correct (it was
being done too early).

Note: you may want to run it multiple times (is: just moving it later ,at harm optimizations in other ways)