[all-commits] [llvm/llvm-project] 63d4e0: [InstCombine] Compute result directly on APInts

Nikita Popov via All-commits all-commits at lists.llvm.org
Tue Jan 7 03:13:50 PST 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 63d4e0fb66b75dd1c60acaa81ff8f8a4327cffcc
      https://github.com/llvm/llvm-project/commit/63d4e0fb66b75dd1c60acaa81ff8f8a4327cffcc
  Author: Nikita Popov <npopov at redhat.com>
  Date:   2025-01-07 (Tue, 07 Jan 2025)

  Changed paths:
    M llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
    M llvm/test/Transforms/InstCombine/icmp-add.ll

  Log Message:
  -----------
  [InstCombine] Compute result directly on APInts

If the bitwidth is 2 and we add two 1s, the result may overflow.
This is fine in terms of correctness, but triggers the APInt ctor
assertion. Fix this by performing the calculation directly on APInts.

Fixes the issue reported in:
https://github.com/llvm/llvm-project/pull/114539#issuecomment-2574845003



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