InstSimplify: Optimize away useless unsigned comparisons

Code like X < Y && Y == 0 should always be folded away to false.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223583 91177308-0d34-0410-b5e6-96231b3b80d8
I didn't intend to commit this change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223584 91177308-0d34-0410-b5e6-96231b3b80d8
ConstantFold: Don't optimize comparisons with weak linkage objects

Consider:
void f() {}
void __attribute__((weak)) g() {}
bool b = &f != &g;

It's possble for g to resolve to f if --defsym=g=f is passed on to the
linker.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223585 91177308-0d34-0410-b5e6-96231b3b80d8
Reapply "LLVMContext: Store APInt/APFloat directly into the ConstantInt/FP DenseMaps."

This reapplies r223478 with a fix for 32 bit targets.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223586 91177308-0d34-0410-b5e6-96231b3b80d8
Make the DenseMap bucket type configurable and use a smaller bucket for DenseSet.

DenseSet used to be implemented as DenseMap<Key, char>, which usually doubled
the memory footprint of the map. Now we use a compressed set so the second
element uses no memory at all. This required some surgery on DenseMap as
all accesses to the bucket now have to go through methods; this should
have no impact on the behavior of DenseMap though. The new default bucket
type for DenseMap is a slightly extended std::pair as we expose it through
DenseMap's iterator and don't want to break any existing users.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223588 91177308-0d34-0410-b5e6-96231b3b80d8
Turn some DenseMaps that are only used for set operations into DenseSets.

DenseSet has better memory efficiency now.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223589 91177308-0d34-0410-b5e6-96231b3b80d8