Commit 24b7c71
EarlyCSE: fix CmpPredicate duplicate-hashing (llvm#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 llvm#119893.
Change-Id: Iaa84f654b5f0cbe9792a78a14ba92af2ebaf5c181 parent 629442a commit 24b7c71
File tree
3 files changed
+2
-11
lines changed- llvm
- include/llvm/IR
- lib
- IR
- Transforms/Scalar
3 files changed
+2
-11
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | 74 | | |
79 | | - | |
80 | | - | |
81 | 75 | | |
82 | 76 | | |
83 | 77 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3946 | 3946 | | |
3947 | 3947 | | |
3948 | 3948 | | |
3949 | | - | |
3950 | | - | |
3951 | | - | |
3952 | | - | |
3953 | 3949 | | |
3954 | 3950 | | |
3955 | 3951 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
290 | 290 | | |
291 | 291 | | |
292 | 292 | | |
293 | | - | |
| 293 | + | |
| 294 | + | |
294 | 295 | | |
295 | 296 | | |
296 | 297 | | |
| |||
0 commit comments