[llvm] [IPSCCP] Variable not visible at Og: (PR #77901)

Carlos Alberto Enciso via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 22 07:33:06 PDT 2024


================
@@ -3594,7 +3594,8 @@ DIExpression *llvm::getExpressionForConstant(DIBuilder &DIB, const Constant &C,
     return createIntegerExpression(C);
 
   auto *FP = dyn_cast<ConstantFP>(&C);
-  if (FP && (Ty.isFloatTy() || Ty.isDoubleTy())) {
+  if (FP &&
+      (Ty.isFloatTy() || Ty.isDoubleTy() || Ty.isHalfTy() || Ty.isBFloatTy())) {
----------------
CarlosAlbertoEnciso wrote:

@nikic Very sorry for my late response.
> Edit: Well, looking closer, this is bitcasting the float to an integer.

Looking at the documentation for `bitcastToAPInt`
```
// This function creates an APInt that is just a bit map of the floating
// point constant as it would appear in memory.  It is not a conversion,
// and treating the result as a normal integer is unlikely to be useful.
APInt IEEEFloat::bitcastToAPInt() const {
```
The function does not convert the `float` into an `int`.


https://github.com/llvm/llvm-project/pull/77901


More information about the llvm-commits mailing list