[all-commits] [llvm/llvm-project] 4e9778: [CodeGen] [ExpandReduction] Fix the bug for Expand...

zhangkangcool via All-commits all-commits at lists.llvm.org
Sat Nov 2 21:03:14 PDT 2019


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 4e9778e346f27b09724f39f92b34dd7336c2147a
      https://github.com/llvm/llvm-project/commit/4e9778e346f27b09724f39f92b34dd7336c2147a
  Author: shkzhang <shkzhang at cn.ibm.com>
  Date:   2019-11-02 (Sat, 02 Nov 2019)

  Changed paths:
    M llvm/lib/CodeGen/ExpandReductions.cpp
    M llvm/test/CodeGen/Generic/expand-experimental-reductions.ll

  Log Message:
  -----------
  [CodeGen] [ExpandReduction] Fix the bug for ExpandReduction() when vector size isn't power of 2

Summary:
For below test case, we will get assert error except for AArch64 and ARM:

declare i8 @llvm.experimental.vector.reduce.and.i8.v3i8(<3 x i8> %a)
define i8 @test_v3i8(<3 x i8> %a) nounwind {
  %b = call i8 @llvm.experimental.vector.reduce.and.i8.v3i8(<3 x i8> %a)
  ret i8 %b
}
In the function getShuffleReduction (), we can see it needs the vector size must be power of 2.

This patch is fix below error when the number of element is not power of 2 for those llvm.experimental.vector.reduce.* function.

Reviewed By: jsji

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




More information about the All-commits mailing list