[llvm] [IPSCCP] Variable not visible at Og: (PR #77901)
Stephen Tozer via llvm-commits
llvm-commits at lists.llvm.org
Mon Apr 15 10:05:04 PDT 2024
================
@@ -3586,10 +3586,13 @@ 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.isBFloatTy() || Ty.isHalfTy() || Ty.isFloatTy() || Ty.isDoubleTy())) {
const APFloat &APF = FP->getValueAPF();
- return DIB.createConstantValueExpression(
- APF.bitcastToAPInt().getZExtValue());
+ APInt const &API = APF.bitcastToAPInt();
+ if (auto Temp = API.tryZExtValue())
----------------
SLTozer wrote:
Now that we aren't supporting values >64bits, I think this can revert to using `getZExtValue`, since `tryZExtValue` only returns `std::nullopt` if `getActiveBits() <= 64`.
https://github.com/llvm/llvm-project/pull/77901
More information about the llvm-commits
mailing list