[llvm] [SelectionDAGBuilder] Propagate fast-math flags to fpext (PR #167574)
Mikołaj Piróg via llvm-commits
llvm-commits at lists.llvm.org
Tue Nov 18 10:26:20 PST 2025
mikolaj-pirog wrote:
>From quick look at the example it appears to be okay. In C vararg functions like printf promote float to doubles. The reason it was working differently before is probably this change -- now fpext has correctly set fast-math while previously it always had none. The effect of this was that if fpext was being rewritten with some other nodes, to a new node, this new node had an intersection of flags, but since fpext had no flags, this new node had none as well -- meaning some rewrites couldn't be made on this new node because it had no flags -- and now they can be made.
So in other words: promoting floats to double in this case is okay because of how printf works. The change in value is probably because this patch allowed (or in better words -- stopped blocking) some rewrites from kicking in. Keep in mind this patch doesn't provide new features, it merely fixes what was broken before (i.e. fpext, internally, never had any flags set).
https://github.com/llvm/llvm-project/pull/167574
More information about the llvm-commits
mailing list