diff --git a/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp b/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp index da9b12686a8f1..c88891563e72d 100644 --- a/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp +++ b/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp @@ -6083,7 +6083,7 @@ Instruction *InstCombinerImpl::foldICmpEquality(ICmpInst &I) { match(Op1, m_OneUse(m_LShr(m_Value(B), m_APIntAllowPoison(AP2))))) || (match(Op0, m_OneUse(m_AShr(m_Value(A), m_APIntAllowPoison(AP1)))) && match(Op1, m_OneUse(m_AShr(m_Value(B), m_APIntAllowPoison(AP2)))))) { - if (AP1 != AP2) + if (*AP1 != *AP2) return nullptr; unsigned TypeBits = AP1->getBitWidth(); unsigned ShAmt = AP1->getLimitedValue(TypeBits); diff --git a/llvm/test/Transforms/InstCombine/compare-signs.ll b/llvm/test/Transforms/InstCombine/compare-signs.ll index 59ec9adb30b9e..bed0f6966dd89 100644 --- a/llvm/test/Transforms/InstCombine/compare-signs.ll +++ b/llvm/test/Transforms/InstCombine/compare-signs.ll @@ -1,5 +1,6 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py ; RUN: opt -passes=instcombine -S < %s | FileCheck %s +; RUN: opt -passes=instcombine -use-constant-int-for-fixed-length-splat -S < %s | FileCheck %s ; PR5438