[PATCH] D115924: [ConstantFolding] Unify handling of load from uniform value

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 17 01:41:13 PST 2021


nikic created this revision.
nikic added reviewers: aeubanks, ayrivera.
Herald added subscribers: ormris, hiraditya.
nikic requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

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 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.


https://reviews.llvm.org/D115924

Files:
  llvm/include/llvm/Analysis/ConstantFolding.h
  llvm/lib/Analysis/ConstantFolding.cpp
  llvm/lib/Transforms/IPO/GlobalOpt.cpp
  llvm/test/Transforms/GlobalOpt/x86_mmx_load.ll
  llvm/test/Transforms/InstSimplify/ConstProp/loads.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D115924.395069.patch
Type: text/x-patch
Size: 6411 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211217/2e599809/attachment.bin>


More information about the llvm-commits mailing list