[all-commits] [llvm/llvm-project] 8e7247: [SelectionDAG] Fix off by one error in range check...

Craig Topper via All-commits all-commits at lists.llvm.org
Fri Feb 18 18:43:16 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 8e7247a377974d9a4026386dd4c23d2e3cbccd28
      https://github.com/llvm/llvm-project/commit/8e7247a377974d9a4026386dd4c23d2e3cbccd28
  Author: Craig Topper <craig.topper at sifive.com>
  Date:   2022-02-18 (Fri, 18 Feb 2022)

  Changed paths:
    M llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp

  Log Message:
  -----------
  [SelectionDAG] Fix off by one error in range check in DAGTypeLegalizer::ExpandShiftByConstant.

The code was considering shifts by an about larger than the number of
bits in the original VT to be out of range. Shifts exactly equal to
the original bit width are also out of range.

I don't know how to test this. DAGCombiner should usually fold this
away. I just noticed while looking for something else in this code. The
llvm-cov report shows that we don't have coverage for out of range shifts here.

Reviewed By: arsenm

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




More information about the All-commits mailing list