[llvm] [InstCombine] Fix fail to fold (A >> C1) Pred C2 if shr is used multple times #83430 (PR #83563)

via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 18 23:46:22 PDT 2024


SahilPatidar wrote:

@dtcxyzw,
```C++
if (IsAShr && matchSelectPattern(Shr->user_back(), Lhs, Rhs).Flavor == SPF_UNKNOWN) {
```
After I made some code changes, this line now triggers three times. However, it only returns SPF_SMIN twice. On the third call, Shr->user_back() seems to be behaving unexpectedly, as shown by the following output:
```
(lldb) expr Shr->user_back()->dump()
 %cmp4.i = icmp slt i64 %shr, 348732
```
 Can you help me understand why this discrepancy might be happening?

https://github.com/llvm/llvm-project/pull/83563


More information about the llvm-commits mailing list