[LoopStrengthReduce, x86] don't add cost for a cmp that will be macro-fused (PR35681)
authorSanjay Patel <spatel@rotateright.com>
Mon, 5 Feb 2018 23:43:05 +0000 (23:43 +0000)
committerSanjay Patel <spatel@rotateright.com>
Mon, 5 Feb 2018 23:43:05 +0000 (23:43 +0000)
commitd7c702b45191ea1cab867a257b8b6b1455b9259f
treea21b47a8eda4c0b76d0658feef0aa737d1d9458c
parent40ddcb8133f4acaafabef2406345fdb8c796214e
[LoopStrengthReduce, x86] don't add cost for a cmp that will be macro-fused (PR35681)

In the motivating case from PR35681 and represented by the macro-fuse-cmp test:
https://bugs.llvm.org/show_bug.cgi?id=35681
...there's a 37 -> 31 byte size win for the loop because we eliminate the big base
address offsets.

SPEC2017 on Ryzen shows no significant perf difference.

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

llvm-svn: 324289
llvm/include/llvm/Analysis/TargetTransformInfo.h
llvm/include/llvm/Analysis/TargetTransformInfoImpl.h
llvm/lib/Analysis/TargetTransformInfo.cpp
llvm/lib/Target/X86/X86TargetTransformInfo.cpp
llvm/lib/Target/X86/X86TargetTransformInfo.h
llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp
llvm/test/CodeGen/X86/rdrand.ll
llvm/test/Transforms/LoopStrengthReduce/X86/ivchain-X86.ll
llvm/test/Transforms/LoopStrengthReduce/X86/macro-fuse-cmp.ll