[x86] add load folding restriction to pushAddIntoCmovOfConsts()
authorSanjay Patel <spatel@rotateright.com>
Tue, 22 Feb 2022 13:01:09 +0000 (08:01 -0500)
committerSanjay Patel <spatel@rotateright.com>
Tue, 22 Feb 2022 13:02:11 +0000 (08:02 -0500)
commitad7214f23dc3a088d73eb3974b146a0bb09d6ffd
treeac484499ac679e561e156571bebbc6e45d736f3e
parentf57627f544665de2b2e246226b0aa3e4a25491e5
[x86] add load folding restriction to pushAddIntoCmovOfConsts()

With only a load-fold the diffs look neutral. If there's a load and store (rmw)
fold opportunity as shown in the test based on #53862, then we end up with an
extra instruction.

Fixes #53862

Differential Revision: https://reviews.llvm.org/D120281
llvm/lib/Target/X86/X86ISelLowering.cpp
llvm/test/CodeGen/X86/add-cmov.ll