[PATCH] D137241: [X86] Add ExpandLargeFpConvert Pass and enable for X86

Freddy, Ye via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 29 22:57:50 PST 2022


FreddyYe added inline comments.


================
Comment at: llvm/lib/CodeGen/ExpandLargeFpConvert.cpp:150
+      Builder.CreateBitCast(FloatVal0, Builder.getIntNTy(FloatWidth));
+  Value *ARep = Builder.CreateZExt(ARep0, FPToI->getType());
+  Value *Tobool_not = Builder.CreateICmpSGT(
----------------
LuoYuanke wrote:
> Do we assume the _BitInt size is larger than 128-bit?
Yes for x86.
```
609:      if (IntTy->getIntegerBitWidth() <= MaxLegalFpConvertBitWidth)
610:        continue;
```


================
Comment at: llvm/lib/CodeGen/ExpandLargeFpConvert.cpp:233
+/// the generated code. This currently generates code similarly to compiler-rt's
+/// implementations. This implementation has an implicit that integer width is
+/// larger than fp.
----------------
mgehre-amd wrote:
> nit: word missing after "implicit"
> And can we have an assert for that assumption?
Yes, that is meaningful for debug with `-mllvm expand-fp-convert-bits`. I'll add.
Generally, since integer width <= i128 are always lowered to libcall, the smallest integer type entering this pass is i129, whose width is larger than fp128.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D137241/new/

https://reviews.llvm.org/D137241



More information about the llvm-commits mailing list