aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/MachineFunction.cpp
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@intel.com>2020-10-14 10:52:21 -0700
committerCraig Topper <craig.topper@intel.com>2020-10-15 01:05:07 -0700
commit50c9f1e11d18aa2a784a2e2f9676e7c3e356f5ad (patch)
tree1db7b518c9090136e648d85e081a37f635eb4c27 /llvm/lib/CodeGen/MachineFunction.cpp
parent47f2dc7e5ff945f72264837bcad8595042c5e84f (diff)
downloadllvm-50c9f1e11d18aa2a784a2e2f9676e7c3e356f5ad.zip
llvm-50c9f1e11d18aa2a784a2e2f9676e7c3e356f5ad.tar.gz
llvm-50c9f1e11d18aa2a784a2e2f9676e7c3e356f5ad.tar.bz2
[TargetLowering] Replace Log2_32_Ceil with Log2_32 in SimplifySetCC ctpop combine.
This combine can look through (trunc (ctpop X)). When doing this it tries to make sure the trunc doesn't lose any information from the ctpop. It does this by checking that the truncated type has more bits that Log2_32_Ceil of the ctpop type. The Ceil is unnecessary and pessimizes non-power of 2 types. For example, ctpop of i256 requires 9 bits to represent the max value of 256. But ctpop of i255 only requires 8 bits to represent the max result of 255. Log2_32_Ceil of 256 and 255 both return 8 while Log2_32 returns 8 for 256 and 7 for 255 The code with popcnt enabled is a regression for this test case, but it does match what already happens with i256 truncated to i9. Since power of 2 is more likely, I don't think it should block this change. Differential Revision: https://reviews.llvm.org/D89412
Diffstat (limited to 'llvm/lib/CodeGen/MachineFunction.cpp')
0 files changed, 0 insertions, 0 deletions