[llvm] [ConstraintElim] Handle switch cases with the same destination (PR #76928)

Yingwei Zheng via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 10 03:50:51 PST 2024


dtcxzyw wrote:

> Is this still needed now that the other changes have landed?

Looks like there are other cases which are not covered by #76988.
I am investigating another case found in `bench/cvc5/optimized/quantifiers_rewriter.cpp.ll`:
```
  %bf.load.i633 = load i16, ptr %d_kind.i632, align 8
  %bf.clear.i634 = and i16 %bf.load.i633, 1023
  %bf.cast.i635 = zext nneg i16 %bf.clear.i634 to i32
  %cmp298 = icmp eq i32 %128, %bf.cast.i635
  br i1 %cmp298, label %land.lhs.true299, label %if.else332

land.lhs.true299:                                 ; preds = %invoke.cont294
  switch i32 %128, label %if.else332 [
    i32 21, label %if.then303
    i32 19, label %if.then303
  ]

 if.then303:                                       ; preds = %land.lhs.true299, %land.lhs.true299
   store i8 1, ptr %childChanged, align 1
   %cmp.i.i.i.i.i640 = icmp eq i16 %bf.clear.i634, 1023
   %cond.i.i.i.i.i641 = select i1 %cmp.i.i.i.i.i640, i32 -1, i32 %128
```
`%cmp.i.i.i.i.i640 = icmp eq i16 %bf.clear.i634, 1023` always evaluates to `false`.


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


More information about the llvm-commits mailing list