creating a constant with the address of another constant

In ARM, the conventional way of setting a register to a 32 bit
constant is to use a load:

The traditional way you do this is with the MachineConstantPool class (reachable from the current MachineFunction). You can add it to the constant pool two ways.

If you aren't in the lowering phase, you can directly manipulate the constant pool. To plop the address of the global into the constant pool, you'd do this, for example:

MachineConstantPool &MCP = ..
GlobalValue *GV = ...
unsigned CPI = MCP.getConstantPoolIndex(GV, /*alignment*/4);

If you *are* in the context of lowering (which is more likely), you can put it into the constantpool and create a SDNode by using:

SDOperand CPAddr = DAG.getConstantPool(GV, /*pointer type*/ MVT::i32, /*alignment*/ 4);

If it helps, there are examples around that use it, e.g. X86TargetLowering::LowerFABS.

-Chris