diff options
author | Craig Topper <craig.topper@intel.com> | 2017-10-03 04:55:04 +0000 |
---|---|---|
committer | Craig Topper <craig.topper@intel.com> | 2017-10-03 04:55:04 +0000 |
commit | 664c4d0190ff8c64bf55789b3328555db5ec1460 (patch) | |
tree | bea4805951ea109e09394431eadd4e8dcb00ed6f /llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp | |
parent | c2f3cea608a123fa51ec523d91b9df46edf22df3 (diff) | |
download | bcm5719-llvm-664c4d0190ff8c64bf55789b3328555db5ec1460.tar.gz bcm5719-llvm-664c4d0190ff8c64bf55789b3328555db5ec1460.zip |
[InstCombine] Replace an equality compare of two APInt pointers with a compare of the APInts themselves.
Apparently this works by virtue of the fact that the pointers are pointers to the APInts stored inside of the ConstantInt objects. But I really don't think we should be relying on that.
llvm-svn: 314761
Diffstat (limited to 'llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp')
-rw-r--r-- | llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp b/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp index c5484456d1f..d3d9b5e2568 100644 --- a/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp +++ b/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp @@ -2629,7 +2629,7 @@ Instruction *InstCombiner::foldICmpBinOpEqualityWithConstant(ICmpInst &Cmp, const APInt *BOC; if (match(BOp1, m_APInt(BOC))) { // If we have ((X & C) == C), turn it into ((X & C) != 0). - if (C == BOC && C->isPowerOf2()) + if (*C == *BOC && C->isPowerOf2()) return new ICmpInst(isICMP_NE ? ICmpInst::ICMP_EQ : ICmpInst::ICMP_NE, BO, Constant::getNullValue(RHS->getType())); |