Skip to content

Commit 17d995d

Browse files
[LLVM][InstCombiner] foldICmpEquality: Compare APInt values rather than addresses.
1 parent 20293eb commit 17d995d

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6083,7 +6083,7 @@ Instruction *InstCombinerImpl::foldICmpEquality(ICmpInst &I) {
60836083
match(Op1, m_OneUse(m_LShr(m_Value(B), m_APIntAllowPoison(AP2))))) ||
60846084
(match(Op0, m_OneUse(m_AShr(m_Value(A), m_APIntAllowPoison(AP1)))) &&
60856085
match(Op1, m_OneUse(m_AShr(m_Value(B), m_APIntAllowPoison(AP2)))))) {
6086-
if (AP1 != AP2)
6086+
if (*AP1 != *AP2)
60876087
return nullptr;
60886088
unsigned TypeBits = AP1->getBitWidth();
60896089
unsigned ShAmt = AP1->getLimitedValue(TypeBits);

llvm/test/Transforms/InstCombine/compare-signs.ll

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
22
; RUN: opt -passes=instcombine -S < %s | FileCheck %s
3+
; RUN: opt -passes=instcombine -use-constant-int-for-fixed-length-splat -S < %s | FileCheck %s
34

45
; PR5438
56

0 commit comments

Comments
 (0)