[all-commits] [llvm/llvm-project] 552838: EarlyCSE: fix CmpPredicate duplicate-hashing (#119...

Ramkumar Ramachandra via All-commits all-commits at lists.llvm.org
Fri Dec 13 14:07:01 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 5528388e3664c6d7d292f20a739f1bf1c8ef768d
      https://github.com/llvm/llvm-project/commit/5528388e3664c6d7d292f20a739f1bf1c8ef768d
  Author: Ramkumar Ramachandra <ramkumar.ramachandra at codasip.com>
  Date:   2024-12-13 (Fri, 13 Dec 2024)

  Changed paths:
    M llvm/include/llvm/IR/CmpPredicate.h
    M llvm/lib/IR/Instructions.cpp
    M llvm/lib/Transforms/Scalar/EarlyCSE.cpp
    A llvm/test/Transforms/EarlyCSE/pr119893.ll

  Log Message:
  -----------
  EarlyCSE: fix CmpPredicate duplicate-hashing (#119902)

Strip hash_value() for CmpPredicate, as different callers have different
hashing use-cases. In this case, there is just one caller, namely
EarlyCSE, which calls hash_combine() on a CmpPredicate, which used to
call hash_combine() on a CmpInst::Predicate prior to 4a0d53a
(PatternMatch: migrate to CmpPredicate). This has uncovered a bug where
two icmp instructions differing in just the fact that one of them has
the samesign flag on it are hashed differently, leading to divergent
hashing, and a crash. Fix this crash by dropping samesign information on
icmp instructions before hashing them, preserving the former behavior.

Fixes #119893.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list