[all-commits] [llvm/llvm-project] 3fc738: [MIPS] Add a baseline test showing current ineffic...

Alexander Richardson via All-commits all-commits at lists.llvm.org
Mon May 4 06:45:09 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 3fc738846e156acc7b26607d9a7c78210478a75d
      https://github.com/llvm/llvm-project/commit/3fc738846e156acc7b26607d9a7c78210478a75d
  Author: Alex Richardson <Alexander.Richardson at cl.cam.ac.uk>
  Date:   2020-05-04 (Mon, 04 May 2020)

  Changed paths:
    A llvm/test/CodeGen/Mips/implicit-sret.ll

  Log Message:
  -----------
  [MIPS] Add a baseline test showing current inefficient hidden sret lowering

SelectionDAGBuilder currently doesn't propagate the known alignment of
the sret parameter. This is inefficient for MIPS and highly inefficient for
our out-of-tree CHERI-extended MIPS since we don't have lwl/lwr so fall back
to byte loads for align == 1.


  Commit: d1ff003fbbb36891ca7752785dec86cfd1a76139
      https://github.com/llvm/llvm-project/commit/d1ff003fbbb36891ca7752785dec86cfd1a76139
  Author: Alex Richardson <Alexander.Richardson at cl.cam.ac.uk>
  Date:   2020-05-04 (Mon, 04 May 2020)

  Changed paths:
    M llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
    M llvm/test/CodeGen/Mips/implicit-sret.ll
    M llvm/test/CodeGen/WebAssembly/offset.ll
    M llvm/test/CodeGen/X86/pr34653.ll

  Log Message:
  -----------
  [SelectionDAGBuilder] Stop setting alignment to one for hidden sret values

We allocated a suitably aligned frame index so we know that all the values
have ABI alignment.
For MIPS this avoids using pair of lwl + lwr instructions instead of a
single lw. I found this when compiling CHERI pure capability code where
we can't use the lwl/lwr unaligned loads/stores and and were to falling
back to a byte load + shift + or sequence.

This should save a few instructions for MIPS and possibly other backends
that don't have fast unaligned loads/stores.
It also improves code generation for CodeGen/X86/pr34653.ll and
CodeGen/WebAssembly/offset.ll since they can now use aligned loads.

Reviewed By: efriedma
Differential Revision: https://reviews.llvm.org/D78999


Compare: https://github.com/llvm/llvm-project/compare/5b898bddff51...d1ff003fbbb3


More information about the All-commits mailing list