[llvm] [SimplifyCFG] Fix Missing Case Computation for Arbitrary Width Integers (PR #77831)

Qiongsi Wu via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 11 13:09:23 PST 2024


qiongsiwu wrote:

> I don't think it is worth handing `switch i128` cases. We can early exit if the bit width of condition value is larger than 64:
> 
> ```
>   auto *CondTy = cast<IntegerType>(SI->getCondition()->getType());
>   if (CondTy->getIntegerBitWidth() > 64 ||
>       !DL.fitsInLegalInteger(CondTy->getIntegerBitWidth()))
>     return false;
> ```

Thanks for the fast response @dtcxzyw ! I can certainly implement the early escape. Could you help me understand why it is not worth handling conditions of wider widths? 

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


More information about the llvm-commits mailing list