[all-commits] [llvm/llvm-project] f62de7: [SLC] Transform strncpy(dst, "text", C) to memcpy(...

Dávid Bolvanský via All-commits all-commits at lists.llvm.org
Fri Aug 14 16:53:54 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: f62de7c9c71134af060a3a1686e30e69d439e785
      https://github.com/llvm/llvm-project/commit/f62de7c9c71134af060a3a1686e30e69d439e785
  Author: Dávid Bolvanský <david.bolvansky at gmail.com>
  Date:   2020-08-15 (Sat, 15 Aug 2020)

  Changed paths:
    M llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp
    M llvm/test/Transforms/InstCombine/strncpy-3.ll

  Log Message:
  -----------
  [SLC] Transform strncpy(dst, "text", C) to memcpy(dst, "text\0\0\0", C) for C <= 128 only

Transformation creates big strings for big C values, so bail out for C > 128.

Reviewed By: efriedma

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




More information about the All-commits mailing list