Skip to content

Commit fb4a8f6

Browse files
[LLVM][InstCombine] foldICmpEquality: Compare APInt values rather than addresses. (#151726)
1 parent b30d531 commit fb4a8f6

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
@@ -6090,7 +6090,7 @@ Instruction *InstCombinerImpl::foldICmpEquality(ICmpInst &I) {
60906090
match(Op1, m_OneUse(m_LShr(m_Value(B), m_APIntAllowPoison(AP2))))) ||
60916091
(match(Op0, m_OneUse(m_AShr(m_Value(A), m_APIntAllowPoison(AP1)))) &&
60926092
match(Op1, m_OneUse(m_AShr(m_Value(B), m_APIntAllowPoison(AP2)))))) {
6093-
if (AP1 != AP2)
6093+
if (*AP1 != *AP2)
60946094
return nullptr;
60956095
unsigned TypeBits = AP1->getBitWidth();
60966096
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)