aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/IR/Constants.cpp
diff options
context:
space:
mode:
authorNikita Popov <npopov@redhat.com>2022-07-08 16:04:21 +0200
committerNikita Popov <npopov@redhat.com>2022-07-08 16:36:04 +0200
commitfc18a88231ccca7c5e93f7563e44fd636833ed2c (patch)
treed0eb41d251ea1d937263aca3860cb41b817d373f /llvm/lib/IR/Constants.cpp
parent79bb915fb60b2cd220d89e3bb54f67abb8cdb7bd (diff)
downloadllvm-fc18a88231ccca7c5e93f7563e44fd636833ed2c.zip
llvm-fc18a88231ccca7c5e93f7563e44fd636833ed2c.tar.gz
llvm-fc18a88231ccca7c5e93f7563e44fd636833ed2c.tar.bz2
[InstCombine] Avoid creating float binop ConstantExprs
Replace ConstantExpr:getFAdd etc with call to ConstantFoldBinaryOpOperands(). I'm using the constant folding API rather than IRBuilder here to ensure that this does actually constant fold. These transforms don't use m_ImmConstant(), so this would not otherwise be guaranteed (and apparently, they can't use m_ImmConstant because they want to handle scalable vector splats). There is an opportunity here to further migrate these to the ConstantFoldFPInstOperands() API, which would respect the denormal mode. I've held off on doing so here, because some of this code explicitly checks for denormal results, and I don't want to touch it in a mostly NFC change.
Diffstat (limited to 'llvm/lib/IR/Constants.cpp')
0 files changed, 0 insertions, 0 deletions