[all-commits] [llvm/llvm-project] 67aec0: [LowerSwitch] Use unsigned integer for range compa...

Peter Rong via All-commits all-commits at lists.llvm.org
Mon May 27 10:58:43 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 67aec0cd62d607b4e5b7198769be061454ce67b3
      https://github.com/llvm/llvm-project/commit/67aec0cd62d607b4e5b7198769be061454ce67b3
  Author: Peter Rong <peterrong96 at gmail.com>
  Date:   2024-05-27 (Mon, 27 May 2024)

  Changed paths:
    M llvm/lib/Transforms/Utils/LowerSwitch.cpp
    A llvm/test/Transforms/LowerSwitch/93152.ll

  Log Message:
  -----------
  [LowerSwitch] Use unsigned integer for range comparison (#93237)

Commit 1db51d8eb2 switched from int64_t to `APInt` to prevent high precision integer overflow.
However, when comparing the "range" of switch cases, we should switch to unsigned integer to prevent overflow.
This patch fixes https://github.com/llvm/llvm-project/issues/93152. 
Some test cases are added.

Signed-off-by: Peter Rong <PeterRong96 at gmail.com>



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