Reputation: 379
Given the following IR,
%1 = call double @llvm.pow.f64(double %conv, double 9.000000e+00)
when the fraction part of second argument is zero, I want to get it(second argument) in int type.
Can someone please suggest a method for this conversion?
Thank you in advance.
Upvotes: 0
Views: 2659
Reputation: 34401
There are conversion instructions for this:
EDIT:
If you wish to convert llvm::ConstantFP
, you can call getValueAPF()
method, which would return you llvm::APFloat
. See documentation on how to convert llvm::APFloat
to integer.
Upvotes: 2