================
@@ -60,9 +60,13 @@ template <class IRBuilderTy> class FixedPointBuilder {
Result = B.CreateSelect(IsNegative, Rounded, Result);
}
- Result = SrcIsSigned
- ? B.CreateAShr(Result, SrcScale - DstScale, "downscale")
- : B.CreateLShr(Result, SrcScale - DstScale, "downscale");
+ unsigned Shift = SrcScale - DstScale;
+ if (Shift < ResultWidth) {
+ Result = SrcIsSigned ? B.CreateAShr(Result, Shift, "downscale")
+ : B.CreateLShr(Result, Shift, "downscale");
+ } else {
----------------
npmania wrote:
Added in 5ffede85a511f59d6560003e6cd838fda5b9e9d0.
https://github.com/llvm/llvm-project/pull/239969
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits