aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/ProfileData/Coverage/CoverageMappingWriter.cpp
diff options
context:
space:
mode:
authorNoah Goldstein <goldstein.w.n@gmail.com>2023-09-19 12:18:51 -0500
committerNoah Goldstein <goldstein.w.n@gmail.com>2023-09-20 13:28:24 -0500
commit47c642f9a0e936822ce23bdb834bcc4c29ae6484 (patch)
tree6e1ea0215567b21fbdb160c66f011c4fb05c9d84 /llvm/lib/ProfileData/Coverage/CoverageMappingWriter.cpp
parent32a46919a2f3009d19a2de75d1dbb0f530aa19ce (diff)
downloadllvm-47c642f9a0e936822ce23bdb834bcc4c29ae6484.zip
llvm-47c642f9a0e936822ce23bdb834bcc4c29ae6484.tar.gz
llvm-47c642f9a0e936822ce23bdb834bcc4c29ae6484.tar.bz2
[DAGCombiner] Fold IEEE `fmul`/`fdiv` by Pow2 to `add`/`sub` of exp
Note: This is moving D154678 which previously implemented this in InstCombine. Concerns where brought up that this was de-canonicalizing and really targeting a codegen improvement, so placing in DAGCombiner. This implements: ``` (fmul C, (uitofp Pow2)) -> (bitcast_to_FP (add (bitcast_to_INT C), Log2(Pow2) << mantissa)) (fdiv C, (uitofp Pow2)) -> (bitcast_to_FP (sub (bitcast_to_INT C), Log2(Pow2) << mantissa)) ``` The motivation is mostly fdiv where 2^(-p) is a fairly common expression. The patch is intentionally conservative about the transform, only doing so if we: 1) have IEEE floats 2) C is normal 3) add/sub of max(Log2(Pow2)) stays in the min/max exponent bounds. Alive2 can't realistically prove this, but did test float16/float32 cases (within the bounds of the above rules) exhaustively. Reviewed By: RKSimon Differential Revision: https://reviews.llvm.org/D154805
Diffstat (limited to 'llvm/lib/ProfileData/Coverage/CoverageMappingWriter.cpp')
0 files changed, 0 insertions, 0 deletions