[all-commits] [llvm/llvm-project] 946b32: [InstSimplify] sdiv a (1 srem b) --> a

Zhu Siyuan via All-commits all-commits at lists.llvm.org
Mon Apr 24 05:37:24 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 946b32680311f43a349d0199f9e286f385cd9847
      https://github.com/llvm/llvm-project/commit/946b32680311f43a349d0199f9e286f385cd9847
  Author: Siyuan Zhu <timeorange7071 at outlook.com>
  Date:   2023-04-24 (Mon, 24 Apr 2023)

  Changed paths:
    M clang/test/OpenMP/distribute_parallel_for_reduction_task_codegen.cpp
    M clang/test/OpenMP/for_reduction_task_codegen.cpp
    M clang/test/OpenMP/parallel_for_reduction_task_codegen.cpp
    M clang/test/OpenMP/parallel_master_reduction_task_codegen.cpp
    M clang/test/OpenMP/parallel_reduction_task_codegen.cpp
    M clang/test/OpenMP/parallel_sections_reduction_task_codegen.cpp
    M clang/test/OpenMP/sections_reduction_task_codegen.cpp
    M clang/test/OpenMP/target_parallel_for_reduction_task_codegen.cpp
    M clang/test/OpenMP/target_parallel_reduction_task_codegen.cpp
    M clang/test/OpenMP/target_teams_distribute_parallel_for_reduction_task_codegen.cpp
    M clang/test/OpenMP/teams_distribute_parallel_for_reduction_task_codegen.cpp
    M llvm/lib/Analysis/InstructionSimplify.cpp
    M llvm/test/Transforms/InstCombine/zext-or-icmp.ll
    M llvm/test/Transforms/InstSimplify/div.ll

  Log Message:
  -----------
  [InstSimplify] sdiv a (1 srem b) --> a

Extend the existing fold for division by zero or one to use known
bits, so it catches additional patterns like division by
(1 srem b).

Fixes https://github.com/llvm/llvm-project/issues/62163.

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




More information about the All-commits mailing list