]> granicus.if.org Git - llvm/commit
[Constant] Add 'isElementWiseEqual()' method
authorRoman Lebedev <lebedev.ri@gmail.com>
Sat, 24 Aug 2019 06:49:51 +0000 (06:49 +0000)
committerRoman Lebedev <lebedev.ri@gmail.com>
Sat, 24 Aug 2019 06:49:51 +0000 (06:49 +0000)
commitbce7b429412865ee1fffec09a1ca65d5280f0f66
tree2b1f46ad512104703815f8fc731ed8b86d7a1629
parent17bb71c533efd6783e0b47581796e99e85178d6f
[Constant] Add 'isElementWiseEqual()' method

Promoting it from InstCombine's tryToReuseConstantFromSelectInComparison().

Return true if this constant and a constant 'Y' are element-wise equal.
This is identical to just comparing the pointers, with the exception that
for vectors, if only one of the constants has an `undef` element in some
lane, the constants still match.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369842 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/IR/Constant.h
lib/IR/Constants.cpp
lib/Transforms/InstCombine/InstCombineSelect.cpp