[DAG] Keep the opaque constant flag when performing unary constant folding operations.

Usually opaque constants shouldn't be folded, unless they are simple unary
operations that don't create new constants. Although this shouldn't drop the
opaque constant flag. This commit fixes this.

Related to <rdar://problem/14774662>
[Stackmaps][X86TTI] Fix think-o in getIntImmCost calculation.

The cost for the first four stackmap operands was always TCC_Free.
This is only true for the first two operands. All other operands
are TCC_Free if they are within 64bit.
[X86TTI] Make constant base pointers for getElementPtr opaque.

If getElementPtr uses a constant as base pointer, then make the constant opaque.
This prevents constant folding it with the offset. The offset can usually be
encoded in the load/store instruction itself and the base address doesn't have
to be rematerialized several times.
blockfreq: Use const in MachineBlockFrequencyInfo

<rdar://problem/14292693>
blockfreq: Implement Pass::releaseMemory()

Implement Pass::releaseMemory() in BlockFrequencyInfo and
MachineBlockFrequencyInfo.  Just delete the private implementation when
not in use.  Switch to a std::unique_ptr to make the logic more clear.

<rdar://problem/14292693>