aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CodeGenModule.cpp
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@intel.com>2020-10-14 10:17:37 -0700
committerCraig Topper <craig.topper@intel.com>2020-10-14 10:22:51 -0700
commit2949baec3cc84cc6640f70d1f8aa3153c953b26a (patch)
tree45b173cf861ef076758d63afdac52220c6bad38d /clang/lib/CodeGen/CodeGenModule.cpp
parent60ba9233d126f828bd4f79f02bc8e2330fead566 (diff)
downloadllvm-2949baec3cc84cc6640f70d1f8aa3153c953b26a.zip
llvm-2949baec3cc84cc6640f70d1f8aa3153c953b26a.tar.gz
llvm-2949baec3cc84cc6640f70d1f8aa3153c953b26a.tar.bz2
[X86] Add test case to demonstrate a Log2_32_Ceil that can just be 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.
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
0 files changed, 0 insertions, 0 deletions