[all-commits] [llvm/llvm-project] 5feece: [TypePromotion] Fix sext vs zext in promoted constant

David Green via All-commits all-commits at lists.llvm.org
Wed May 11 02:47:57 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 5feeceddb2b5422dcb555b6d601e35a2d7840707
      https://github.com/llvm/llvm-project/commit/5feeceddb2b5422dcb555b6d601e35a2d7840707
  Author: David Green <david.green at arm.com>
  Date:   2022-05-11 (Wed, 11 May 2022)

  Changed paths:
    M llvm/lib/CodeGen/TypePromotion.cpp
    M llvm/test/Transforms/TypePromotion/ARM/icmps.ll

  Log Message:
  -----------
  [TypePromotion] Fix sext vs zext in promoted constant

As pointed out in #55342, given non-canonical IR with multiple
constants, we check the second operand in isSafeWrap, but can promote
both with sext. Fix that as suggested by @craig.topper by ensuring we
only extend the second constant if multiple are present.

Fixes #55342

Differential Revision: https://reviews.llvm.org/D125294




More information about the All-commits mailing list