LoopIdiom: avoid patterned memset if constant is not relocatable.
authorTim Northover <tnorthover@apple.com>
Wed, 11 Jan 2023 13:52:45 +0000 (13:52 +0000)
committerTim Northover <tnorthover@apple.com>
Thu, 12 Jan 2023 18:53:07 +0000 (18:53 +0000)
commit150595ab4be34e392e345d347dcb767df04a5383
tree339e0cf246b70d76bf9e96515e541b7287fc5785
parent9ec115978ea2bdfc60800cd3c21264341cdc8b0a
LoopIdiom: avoid patterned memset if constant is not relocatable.

The pattern we're using for the memset_pattern* call gets put into a static
global variable initialized, which means it has to be representable with
relocations on the target. Most `ConstantExpr` instances do not satisfy this
constraint, so avoid all of them for now.
llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp
llvm/test/Transforms/LoopIdiom/basic.ll