[all-commits] [llvm/llvm-project] 2bb92b: [GlobalISel] LegalizerHelper - Extract widenScalar...

Cassie Jones via All-commits all-commits at lists.llvm.org
Fri Jan 22 14:13:20 PST 2021


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 2bb92bf451d7eb2c817f3e5403353e7c0c14d350
      https://github.com/llvm/llvm-project/commit/2bb92bf451d7eb2c817f3e5403353e7c0c14d350
  Author: Cassie Jones <code at witchoflight.com>
  Date:   2021-01-22 (Fri, 22 Jan 2021)

  Changed paths:
    M llvm/include/llvm/CodeGen/GlobalISel/LegalizerHelper.h
    M llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp
    M llvm/test/CodeGen/AArch64/GlobalISel/legalize-add.mir
    M llvm/test/CodeGen/AArch64/GlobalISel/legalize-sub.mir
    M llvm/test/CodeGen/AArch64/legalize-uaddo.mir
    M llvm/test/CodeGen/AMDGPU/GlobalISel/legalize-uaddo.mir
    M llvm/test/CodeGen/AMDGPU/GlobalISel/legalize-usubo.mir
    M llvm/unittests/CodeGen/GlobalISel/LegalizerHelperTest.cpp

  Log Message:
  -----------
  [GlobalISel] LegalizerHelper - Extract widenScalarAddoSubo method

The widenScalar implementation for signed and unsigned overflowing
operations were very similar: both are checked by truncating the result
and then re-sign/zero-extending it and checking that it matches the
computed operation.

Using a truncate + zero-extend for the unsigned case instead of manually
producing the AND instruction like before leads to an extra copy
instruction during legalization, but this should be harmless.

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




More information about the All-commits mailing list