[all-commits] [llvm/llvm-project] 9fd4f8: [ConstantFolding] Unify handling of load from unif...

Nikita Popov via All-commits all-commits at lists.llvm.org
Fri Dec 17 08:05:25 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 9fd4f80e33a4ae4567483819646650f5735286e2
      https://github.com/llvm/llvm-project/commit/9fd4f80e33a4ae4567483819646650f5735286e2
  Author: Nikita Popov <npopov at redhat.com>
  Date:   2021-12-17 (Fri, 17 Dec 2021)

  Changed paths:
    M clang/test/CodeGen/aapcs-align.cpp
    M llvm/include/llvm/Analysis/ConstantFolding.h
    M llvm/lib/Analysis/ConstantFolding.cpp
    M llvm/lib/Transforms/IPO/GlobalOpt.cpp
    A llvm/test/Transforms/GlobalOpt/x86_mmx_load.ll
    M llvm/test/Transforms/InstSimplify/ConstProp/loads.ll

  Log Message:
  -----------
  [ConstantFolding] Unify handling of load from uniform value

There are a number of places that specially handle loads from a
uniform value where all the bits are the same (zero, one, undef,
poison), because we a) don't care about the load offset in that
case and b) it bypasses casts that might not be legal generally
but do work with uniform values.

We had multiple implementations of this, with a different set of
supported values each time, as well as incomplete type checks in
some cases. In particular, this fixes the assertion reported in
https://reviews.llvm.org/D114889#3198921, as well as a similar
assertion that could be triggered via constant folding.

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




More information about the All-commits mailing list