[APInt] Introduce APIntOps::GetMostSignificantDifferentBit()
authorRoman Lebedev <lebedev.ri@gmail.com>
Sat, 26 Oct 2019 19:46:09 +0000 (22:46 +0300)
committerRoman Lebedev <lebedev.ri@gmail.com>
Sat, 26 Oct 2019 20:20:58 +0000 (23:20 +0300)
commit9d77ad57540c45b0a6e6ffcf8721a3189c0ed70e
tree6f551dc17819858023523e6138760209b28222d6
parent11c920207afa92ad13fdf72daba14c9af336293a
[APInt] Introduce APIntOps::GetMostSignificantDifferentBit()

Summary:
Compare two values, and if they are different, return the position of the
most significant bit that is different in the values.

Needed for D69387.

Reviewers: nikic, spatel, sanjoy, RKSimon

Reviewed By: nikic

Subscribers: xbolva00, hiraditya, dexonsmith, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D69439
llvm/include/llvm/ADT/APInt.h
llvm/lib/Support/APInt.cpp
llvm/unittests/ADT/APIntTest.cpp