passes after lowering‏

Hi,

I need to perform some transformation after code was lowered.
I think I need to do this in llc and use a MachinePass. However, it is unclear how.
I am able to change the register allocator:
llc -f -load XXX.so -regalloc=xxx foo.bc
but I don’t know how to just insert a different pass and pass new command options to llc.
I found plenty of documentation about ‘opt’, but little about llc.

So, is this correct? Transformation after lowering should happen in llc?
How can I register and run a new pass (preferably as the last pass) in llc?
How can I see the hidden options of the tools?

Thank you,
Dan