Page MenuHomePhabricator

sepavloff (Serge Pavlov)
User

Projects

User does not belong to any projects.

User Details

User Since
Mar 13 2013, 7:26 AM (523 w, 4 h)

Recent Activity

Yesterday

sepavloff accepted D140381: [PowerPC] Use Power9 test data class instruction to lower IS_FPCLASS.

I am not proficient in Power ISA and rely on the results of testing mentioned in the patch summary.

Tue, Mar 21, 11:01 AM · Restricted Project, Restricted Project
sepavloff added inline comments to D146188: [Clang][DOC] Add documentation in for __builtin_flt_rounds and __builtin_set_flt_rounds.
Tue, Mar 21, 5:00 AM · Restricted Project, Restricted Project

Wed, Mar 15

sepavloff added inline comments to D146188: [Clang][DOC] Add documentation in for __builtin_flt_rounds and __builtin_set_flt_rounds.
Wed, Mar 15, 9:09 PM · Restricted Project, Restricted Project
sepavloff added inline comments to D140381: [PowerPC] Use Power9 test data class instruction to lower IS_FPCLASS.
Wed, Mar 15, 3:48 AM · Restricted Project, Restricted Project

Tue, Mar 14

sepavloff added inline comments to D143180: DAG: Expand legalization of is.fpclass to fcmp for DAZ.
Tue, Mar 14, 11:35 PM · Restricted Project, Restricted Project
sepavloff added inline comments to D143182: CodeGen: Optimize lowering of is.fpclass fcZero|fcSubnormal.
Tue, Mar 14, 11:11 PM · Restricted Project, Restricted Project
sepavloff added inline comments to D140381: [PowerPC] Use Power9 test data class instruction to lower IS_FPCLASS.
Tue, Mar 14, 9:11 AM · Restricted Project, Restricted Project

Mon, Mar 6

sepavloff added a comment to D143201: DAG: Lower single infinity is.fpclass tests to fcmp.

What is the advantage of such lowering?

Mon, Mar 6, 11:58 PM · Restricted Project, Restricted Project
sepavloff added a comment to D143180: DAG: Expand legalization of is.fpclass to fcmp for DAZ.

Could you please rebase the patch? Some changes for FPClassTest are already committed.

Mon, Mar 6, 9:25 PM · Restricted Project, Restricted Project
sepavloff accepted D144454: Add builtin for llvm set rounding.

LGTM.

Mon, Mar 6, 8:28 PM · Restricted Project, Restricted Project

Thu, Mar 2

sepavloff added a comment to D144454: Add builtin for llvm set rounding.

I see. If we're going to take the target-independent values specified by FLT_ROUNDS, then the original builtin name is more appropriate. Of course, this has the disadvantage of not allowing target-specific values that might exist beyond those specified in the standard; are we pretty certain that's not a problem in practice?

Working on x86, ARM, and AArch64 is great, but I'm a little worried about adding another builtin that works only on major targets and probably crashes on others. I suppose we've got some number of those already, though.

Thu, Mar 2, 8:54 PM · Restricted Project, Restricted Project

Wed, Mar 1

sepavloff added inline comments to D143195: ValueTracking: Add start of computeKnownFPClass API.
Wed, Mar 1, 9:04 PM · Restricted Project, Restricted Project
sepavloff added a comment to D144454: Add builtin for llvm set rounding.

C standard function fesetround accepts rounding mode in the form of target-specific values like FE_TONEAREST. They usually represent corresponding bits in control register, so are different for different targets. llvm.set_rounding in contrast accepts rounding mode as target-independent value, the encoding is same as used in FLT_ROUNDS.

Wed, Mar 1, 8:56 PM · Restricted Project, Restricted Project

Mon, Feb 27

sepavloff added inline comments to D143191: DAG: Handle inversion of fcSubnormal | fcZero.
Mon, Feb 27, 2:27 AM · Restricted Project, Restricted Project

Sun, Feb 26

sepavloff committed rG5cc91f977eaa: [Clang] Copy strictfp attribute from pattern to instantiation (authored by sepavloff).
[Clang] Copy strictfp attribute from pattern to instantiation
Sun, Feb 26, 8:21 PM · Restricted Project, Restricted Project
sepavloff closed D143919: [Clang] Copy strictfp attribute from pattern to instantiation.
Sun, Feb 26, 8:21 PM · Restricted Project, Restricted Project
sepavloff added a comment to D143919: [Clang] Copy strictfp attribute from pattern to instantiation.

Thanks!

Sun, Feb 26, 8:18 PM · Restricted Project, Restricted Project

Fri, Feb 24

sepavloff committed rG7f81dd4dd630: [NFC] Make FPClassTest a bitmask enumeration (authored by sepavloff).
[NFC] Make FPClassTest a bitmask enumeration
Fri, Feb 24, 12:12 AM · Restricted Project, Restricted Project

Wed, Feb 22

sepavloff added a reverting change for rGe7613c1d9b25: [NFC] Make FPClassTest a bitmask enumeration: rG08a09235b6fb: Revert "[NFC] Make FPClassTest a bitmask enumeration".
Wed, Feb 22, 9:57 PM · Restricted Project, Restricted Project
sepavloff committed rG08a09235b6fb: Revert "[NFC] Make FPClassTest a bitmask enumeration" (authored by sepavloff).
Revert "[NFC] Make FPClassTest a bitmask enumeration"
Wed, Feb 22, 9:57 PM · Restricted Project, Restricted Project
sepavloff added a reverting change for D144241: [NFC] Make FPClassTest a bitmask enumeration: rG08a09235b6fb: Revert "[NFC] Make FPClassTest a bitmask enumeration".
Wed, Feb 22, 9:57 PM · Restricted Project, Restricted Project
sepavloff committed rGe7613c1d9b25: [NFC] Make FPClassTest a bitmask enumeration (authored by sepavloff).
[NFC] Make FPClassTest a bitmask enumeration
Wed, Feb 22, 9:40 PM · Restricted Project, Restricted Project
sepavloff added inline comments to D143191: DAG: Handle inversion of fcSubnormal | fcZero.
Wed, Feb 22, 8:55 AM · Restricted Project, Restricted Project

Tue, Feb 21

sepavloff committed rG2e416cdd52c1: [NFC] Make FPClassTest a bitmask enumeration (authored by sepavloff).
[NFC] Make FPClassTest a bitmask enumeration
Tue, Feb 21, 11:21 PM · Restricted Project, Restricted Project
sepavloff closed D144241: [NFC] Make FPClassTest a bitmask enumeration.
Tue, Feb 21, 11:21 PM · Restricted Project, Restricted Project
sepavloff added a comment to D144241: [NFC] Make FPClassTest a bitmask enumeration.

Thanks!

Tue, Feb 21, 11:19 PM · Restricted Project, Restricted Project

Mon, Feb 20

sepavloff committed rG18baeb89b566: [ADT] Alternative way to declare enum type as bitmask (authored by sepavloff).
[ADT] Alternative way to declare enum type as bitmask
Mon, Feb 20, 10:46 PM · Restricted Project, Restricted Project
sepavloff closed D144202: [ADT] Alternative way to declare enum type as bitmask.
Mon, Feb 20, 10:45 PM · Restricted Project, Restricted Project
sepavloff added a comment to D144202: [ADT] Alternative way to declare enum type as bitmask.

Thanks!

Mon, Feb 20, 9:33 PM · Restricted Project, Restricted Project

Feb 16 2023

sepavloff requested review of D144241: [NFC] Make FPClassTest a bitmask enumeration.
Feb 16 2023, 11:28 PM · Restricted Project, Restricted Project
sepavloff added inline comments to D143919: [Clang] Copy strictfp attribute from pattern to instantiation.
Feb 16 2023, 9:21 PM · Restricted Project, Restricted Project
sepavloff updated the diff for D143919: [Clang] Copy strictfp attribute from pattern to instantiation.

Remove copying StrictFPAttr from InstantiateAttrs

Feb 16 2023, 9:19 PM · Restricted Project, Restricted Project
sepavloff requested review of D144202: [ADT] Alternative way to declare enum type as bitmask.
Feb 16 2023, 10:03 AM · Restricted Project, Restricted Project

Feb 15 2023

sepavloff added a comment to D143919: [Clang] Copy strictfp attribute from pattern to instantiation.

If the "strictfp" attribute is based on the contents of the function body, should we recompute it when the function is instantiated, as opposed to copying it? For example, say you have a pragma inside an "if constexpr"; should that set the strictfp attribute if it's discarded?

Otherwise, I guess updateAttrsForLateParsedTemplate makes sense.

Feb 15 2023, 10:07 PM · Restricted Project, Restricted Project
sepavloff added a comment to D143919: [Clang] Copy strictfp attribute from pattern to instantiation.

We have code somewhere to generically copy attributes from function templates to instantiations, right? Why do we need to explicitly copy StrictFPAttr in particular, separate from that?

Could you please point me out to this code? I didn't find it.

It's the call to InstantiateAttrs in InitFunctionInstantiation. InstantiateAttrs hard-codes a list of attributes to clone, which seems like a bad design, but it's easy enough to add your attribute as another case to that list.

Feb 15 2023, 2:59 AM · Restricted Project, Restricted Project
sepavloff updated the diff for D143919: [Clang] Copy strictfp attribute from pattern to instantiation.

Changed the way to copy strictfp attribute

Feb 15 2023, 2:52 AM · Restricted Project, Restricted Project

Feb 13 2023

sepavloff added a comment to D143919: [Clang] Copy strictfp attribute from pattern to instantiation.

We have code somewhere to generically copy attributes from function templates to instantiations, right? Why do we need to explicitly copy StrictFPAttr in particular, separate from that?

Feb 13 2023, 11:13 AM · Restricted Project, Restricted Project
sepavloff requested review of D143919: [Clang] Copy strictfp attribute from pattern to instantiation.
Feb 13 2023, 8:01 AM · Restricted Project, Restricted Project

Feb 8 2023

sepavloff added a comment to D143074: [LangRef] improve documentation of SNaN in the default FP environment.

The property of SNaN like SNan + 0.0 -> QNaN is not related to exceptions and must be preserved in default environment also.

Neither GCC nor Clang have considered sNaN-related semantics important to provide by default thus far, and I don't think we ought to start now, either.

Agreed - we're not changing the default LLVM behavior with this patch, and I have not heard any reasons why we should. IEEE-754-compliant SNaN handling isn't important enough to the majority of FP users to justify FP performance regressions.

Feb 8 2023, 7:53 AM · Restricted Project, Restricted Project

Feb 6 2023

sepavloff added a comment to D143074: [LangRef] improve documentation of SNaN in the default FP environment.

The property of SNaN like SNan + 0.0 -> QNaN is not related to exceptions and must be preserved in default environment also.

Neither GCC nor Clang have considered sNaN-related semantics important to provide by default thus far, and I don't think we ought to start now, either. We should continue to support them on an opt-in basis -- at least as far as the end-to-end behavior goes for Clang users. (If there's some good reason to do so, it'd be fine to contemplate changing the IR-level defaults.)

Feb 6 2023, 8:58 PM · Restricted Project, Restricted Project
sepavloff added inline comments to D143191: DAG: Handle inversion of fcSubnormal | fcZero.
Feb 6 2023, 10:13 AM · Restricted Project, Restricted Project
sepavloff added a comment to D143074: [LangRef] improve documentation of SNaN in the default FP environment.

The property of SNaN like SNan + 0.0 -> QNaN is not related to exceptions and must be preserved in default environment also.

Feb 6 2023, 4:10 AM · Restricted Project, Restricted Project

Feb 2 2023

sepavloff requested review of D143241: [Clang] Reset FP options before function instantiations.
Feb 2 2023, 10:23 PM · Restricted Project, Restricted Project
sepavloff abandoned D133325: [Driver] Allow search of included response files as configuration files.

The alternative solution in D136354 was implemented.

Feb 2 2023, 10:20 PM · Restricted Project, Restricted Project, Restricted Project

Feb 1 2023

sepavloff committed rGc6795b1d37ce: Use ArrayRef instead of raw pointers. NFC (authored by sepavloff).
Use ArrayRef instead of raw pointers. NFC
Feb 1 2023, 9:56 PM · Restricted Project, Restricted Project
sepavloff closed D143049: Use ArrayRef instead of raw pointers. NFC.
Feb 1 2023, 9:56 PM · Restricted Project, Restricted Project
sepavloff added a comment to D143049: Use ArrayRef instead of raw pointers. NFC.

Thanks!

Feb 1 2023, 9:52 PM · Restricted Project, Restricted Project

Jan 31 2023

sepavloff requested review of D143049: Use ArrayRef instead of raw pointers. NFC.
Jan 31 2023, 11:49 PM · Restricted Project, Restricted Project
sepavloff added a comment to D137811: InstCombine: Perform basic isnan combines on llvm.is.fpclass.
The C classification macros fpclassify, iscanonical, isfinite, isinf, isnan, isnormal,
issignaling, issubnormal, iszero, and signbit provide the IEC 60559 operations indicated
in the table above provided their arguments are in the format of their semantic type. Then these
macros raise no floating-point exceptions, even if an argument is a signaling NaN.

and this property must be kept no matter if exceptions are ignored or not.

No, the property does not need to be maintained if the exception flag state cannot be observed by correct code. And that's exactly the case at hand in FENV_ACCESS OFF code (and, correspondingly, non-strictfp in LLVM IR). In such code, you are not allowed to have trap-on-exception enabled, nor are you allowed to access the floating-point exception status flags, and, the state of the status flags is unspecified upon transitioning back to FENV_ACCESS ON code. Thus, within such code, we may set the status flags to any arbitrary value we wish -- nobody can (correctly) tell the difference.

Jan 31 2023, 10:56 PM · Restricted Project, Restricted Project
sepavloff accepted D142996: DAG: Fix broken lowering of is.fplcass fcZero with DAZ.

LGTM.

Jan 31 2023, 9:14 PM · Restricted Project, Restricted Project
sepavloff committed rGc4e38fadfa2a: [AArch64] Mark function calls as possibly changing FPCR (authored by sepavloff).
[AArch64] Mark function calls as possibly changing FPCR
Jan 31 2023, 9:08 PM · Restricted Project, Restricted Project
sepavloff closed D143001: [AArch64] Mark function calls as possibly changing FPCR.
Jan 31 2023, 9:07 PM · Restricted Project, Restricted Project
sepavloff added a comment to D143001: [AArch64] Mark function calls as possibly changing FPCR.

Thanks!

Jan 31 2023, 9:05 PM · Restricted Project, Restricted Project
sepavloff requested review of D143001: [AArch64] Mark function calls as possibly changing FPCR.
Jan 31 2023, 11:10 AM · Restricted Project, Restricted Project

Jan 30 2023

sepavloff added a comment to D137811: InstCombine: Perform basic isnan combines on llvm.is.fpclass.

What about such code?

int get_code(float x) {
  return isnan(x) ? 1 : 2;
}
void func1(float x) {
  int code1 = get_code(x);
  ...
}
#pragma STDC FENV_ACCESS ON
void func2(float x) {
  int code1 = get_code(x);
  ...
}

Acoording to C standard it must work as intended. If compiler replaces isnan with comparison, the code would be broken.

This code didn't actually manipulate the floating point mode, just made it legal to do so for the scope of the pragma. If you were to insert code to modify the mode to enable FP exceptions inside func2, it would be illegal because you did not restore the mode before calling into code outside of the pragma scope. FENV_ACCESS doesn't require the compiler to fixup the floating point mode for you before calling into other code.

Jan 30 2023, 3:06 AM · Restricted Project, Restricted Project

Jan 26 2023

sepavloff added a comment to D137811: InstCombine: Perform basic isnan combines on llvm.is.fpclass.

On most targets turning off FP exceptions means reading content of FP control register, changing value of mask bits and putting the modified register value back. It is expensive operation and cannot be made invisible to LLVM. Some targets (like RISCV) do not have possibility to mask FP exceptions at all, so at IR level there is no way to turn exception off. Default FP environment supposes that the exceptions are ignored, not disabled. In general case they are raised always.

Managing the FP mode is a user responsibility. If the operation in unconstrained we can assume the default floating point environment without preserved exceptions.

Jan 26 2023, 10:02 PM · Restricted Project, Restricted Project
sepavloff accepted D139549: [X86][ConstraintFP] Model `MXCSR` for function call.

LGTM.

Jan 26 2023, 8:32 AM · Restricted Project, Restricted Project
sepavloff added inline comments to D139549: [X86][ConstraintFP] Model `MXCSR` for function call.
Jan 26 2023, 5:28 AM · Restricted Project, Restricted Project

Jan 25 2023

sepavloff added a comment to D137811: InstCombine: Perform basic isnan combines on llvm.is.fpclass.

But they have different behavior if x is signaling NaN. Although the replacement is proposed for strictfp functions only, inlining may require conversion to a form that uses constrained intrinsics. The resulting code would have different behavior than original.

A transformation that’s valid for !strictfp functions cannot be invalid because of the potential for being inlined into a strictfp function. If this isn’t possible, there is a representational issue the inliner would need to account for.

Thinking about this more, I think any situation where this could be an issue would be malformed to begin with. You had a piece of code that was expecting exceptions to be enabled calling into code where exceptions were disabled without turning exceptions off

If exceptions were turned off, the call was made, and exceptions were turned back on then there would be no correctness issue. Inlining the called function wouldn't change that. The toggling of the exception enablement would be invisible to LLVM. Thus we can't categorically say that a strictfp function calling a !strictfp function is malformed.

Jan 25 2023, 9:35 PM · Restricted Project, Restricted Project
sepavloff added a comment to D139549: [X86][ConstraintFP] Model `MXCSR` for function call.

Reverse ping.

Jan 25 2023, 10:45 AM · Restricted Project, Restricted Project

Jan 24 2023

sepavloff committed rGd595b59d5c9c: [FPEnv] Fix complex operations in strictfp mode (authored by sepavloff).
[FPEnv] Fix complex operations in strictfp mode
Jan 24 2023, 1:41 AM · Restricted Project, Restricted Project
sepavloff closed D141765: [FPEnv] Fix complex operations in strictfp mode.
Jan 24 2023, 1:41 AM · Restricted Project, Restricted Project
sepavloff added a comment to D141765: [FPEnv] Fix complex operations in strictfp mode.

Thanks!

Jan 24 2023, 1:39 AM · Restricted Project, Restricted Project

Jan 23 2023

sepavloff updated the diff for D141765: [FPEnv] Fix complex operations in strictfp mode.

Use --implicit-check-not in test

Jan 23 2023, 8:39 AM · Restricted Project, Restricted Project

Jan 20 2023

sepavloff committed rG65cf77d218cf: [clang] Use FP options from AST for emitting code for casts (authored by sepavloff).
[clang] Use FP options from AST for emitting code for casts
Jan 20 2023, 5:48 AM · Restricted Project, Restricted Project
sepavloff closed D142001: [clang] Use FP options from AST for emitting code for casts.
Jan 20 2023, 5:48 AM · Restricted Project, Restricted Project
sepavloff added a comment to D142001: [clang] Use FP options from AST for emitting code for casts.

Thanks!

Jan 20 2023, 5:46 AM · Restricted Project, Restricted Project

Jan 19 2023

sepavloff updated the diff for D142001: [clang] Use FP options from AST for emitting code for casts.

Use --implicit-check-not in tests

Jan 19 2023, 7:06 AM · Restricted Project, Restricted Project

Jan 18 2023

sepavloff added a comment to D137811: InstCombine: Perform basic isnan combines on llvm.is.fpclass.

inlining may require conversion to a form that uses constrained intrinsics

Functions which are not strictfp are allowed to introduce "spurious" fp flag writes; for example, we can flatten control flow that contains floating-point ops. Inlining the function doesn't change that general rule. The inliner converts fp operations just to ensure that later optimizations don't move those operations around.

Jan 18 2023, 11:04 PM · Restricted Project, Restricted Project
sepavloff added a comment to D141765: [FPEnv] Fix complex operations in strictfp mode.

Are we testing _Complex multiply or subtraction anywhere? I have a vague memory of multiply not working correctly.

Jan 18 2023, 2:58 AM · Restricted Project, Restricted Project
sepavloff updated the diff for D141765: [FPEnv] Fix complex operations in strictfp mode.

Updated comment in test as proposed by Kevin

Jan 18 2023, 2:51 AM · Restricted Project, Restricted Project
sepavloff requested review of D142001: [clang] Use FP options from AST for emitting code for casts.
Jan 18 2023, 2:44 AM · Restricted Project, Restricted Project

Jan 17 2023

sepavloff accepted D140377: [clang][Interp] Compound assign operators for FP values.

LGTM.

Jan 17 2023, 3:38 AM · Restricted Project, Restricted Project

Jan 16 2023

sepavloff added inline comments to D139549: [X86][ConstraintFP] Model `MXCSR` for function call.
Jan 16 2023, 8:10 AM · Restricted Project, Restricted Project
sepavloff added a comment to D139902: IR: Add nofpclass parameter attribute.

Existing decoration with nnan/ninf has inconvenient semantics. Having more powerfull and consistent solution can enable optimizations that are based on the knowledge of finitness of FP operands.

Jan 16 2023, 7:43 AM · Restricted Project, Restricted Project
sepavloff added a comment to D137811: InstCombine: Perform basic isnan combines on llvm.is.fpclass.

Early conversion is_fpclass->fcmp may result in incorrect semantics. It make the code:

if (!isnan(x)) {
…
}

indistinguishable from:

if (x == x) {
…
}

But they have different behavior if x is signaling NaN. Although the replacement is proposed for strictfp functions only, inlining may require conversion to a form that uses constrained intrinsics. The resulting code would have different behavior than original.

Jan 16 2023, 6:32 AM · Restricted Project, Restricted Project

Jan 14 2023

sepavloff requested review of D141765: [FPEnv] Fix complex operations in strictfp mode.
Jan 14 2023, 7:43 AM · Restricted Project, Restricted Project

Jan 12 2023

sepavloff added inline comments to D139549: [X86][ConstraintFP] Model `MXCSR` for function call.
Jan 12 2023, 10:08 PM · Restricted Project, Restricted Project

Jan 11 2023

sepavloff updated the diff for D112932: Use llvm.is_fpclass to implement FP classification functions.

Remove support of __builtin_is{subnormal,zero,signaling}, rebased

Jan 11 2023, 4:53 AM · Restricted Project, Restricted Project

Dec 26 2022

sepavloff updated the diff for D112932: Use llvm.is_fpclass to implement FP classification functions.

Update patch

Dec 26 2022, 8:31 AM · Restricted Project, Restricted Project

Dec 25 2022

sepavloff added a comment to D140294: clang: Replace implementation of __builtin_isnormal.

As mentioned in another review, using fcmp to represent isnormal in IR as well as any other classification function would result in incorrect code in strict mode. The source:

inline __attribute__((always_inline)) _Bool func(float x) {
  return __builtin_isnormal(x);
}
Dec 25 2022, 9:00 PM · Restricted Project

Dec 20 2022

sepavloff added inline comments to D139130: InstCombine: Fold and (fcmp), (is.fpclass) into is.fpclass.
Dec 20 2022, 9:18 AM · Restricted Project, Restricted Project
sepavloff added inline comments to D139130: InstCombine: Fold and (fcmp), (is.fpclass) into is.fpclass.
Dec 20 2022, 9:03 AM · Restricted Project, Restricted Project
sepavloff accepted D139316: ValueTracking: Teach isKnownNeverInfinity about rounding intrinsics.

LGTM.

Dec 20 2022, 7:39 AM · Restricted Project, Restricted Project
sepavloff added inline comments to D139130: InstCombine: Fold and (fcmp), (is.fpclass) into is.fpclass.
Dec 20 2022, 12:53 AM · Restricted Project, Restricted Project
sepavloff added a comment to D140294: clang: Replace implementation of __builtin_isnormal.

This change can have negative consequences in some cases. Some targets have dedicated instruction to test FP class and often this instruction is faster than arithmetic operations. Replacement of one operation with two arithmetic and two logic plus cost of FP constant materialization does not provide any visible benefit.

Dec 20 2022, 12:28 AM · Restricted Project

Dec 19 2022

sepavloff updated the diff for D112932: Use llvm.is_fpclass to implement FP classification functions.

Remove __builtin_isfpclass

Dec 19 2022, 10:05 AM · Restricted Project, Restricted Project
sepavloff accepted D134859: [clang][Interp] Implement basic support for floating point values.

LGTM.

Dec 19 2022, 2:40 AM · Restricted Project, Restricted Project
sepavloff added inline comments to D139316: ValueTracking: Teach isKnownNeverInfinity about rounding intrinsics.
Dec 19 2022, 2:18 AM · Restricted Project, Restricted Project

Dec 16 2022

sepavloff added inline comments to D139311: InstCombine: Match pattern that appears in clang's __builtin_isnormal.
Dec 16 2022, 12:52 AM · Restricted Project, Restricted Project

Dec 15 2022

sepavloff added inline comments to D134859: [clang][Interp] Implement basic support for floating point values.
Dec 15 2022, 9:06 PM · Restricted Project, Restricted Project
sepavloff accepted D139120: APFloat: Add isSmallestNormalized predicate function.

LGTM.

Dec 15 2022, 3:50 AM · Restricted Project, Restricted Project

Dec 14 2022

sepavloff added inline comments to D139316: ValueTracking: Teach isKnownNeverInfinity about rounding intrinsics.
Dec 14 2022, 8:52 PM · Restricted Project, Restricted Project
sepavloff added a comment to D139316: ValueTracking: Teach isKnownNeverInfinity about rounding intrinsics.

Special case ppcfp128. Not sure if we need to exclude bfloat16 since it's exponent bits is larger than mantissa

Dec 14 2022, 11:10 AM · Restricted Project, Restricted Project
sepavloff added a comment to D139130: InstCombine: Fold and (fcmp), (is.fpclass) into is.fpclass.

Some mechanism must exists that applies this transformation or not depending on target. If instruction FCLASS is available, the transformation is profitable. But on targets that do not have such instruction, the replacement may produce inefficient code.

Dec 14 2022, 8:00 AM · Restricted Project, Restricted Project

Dec 13 2022

sepavloff requested changes to D139316: ValueTracking: Teach isKnownNeverInfinity about rounding intrinsics.

PPC uses double double encoding (https://en.wikipedia.org/wiki/Quadruple-precision_floating-point_format), in which a number is represented by a sum of two double precision numbers, where the second just keeps additional mantissa bits. Total number of mantissa bits in ppc_fp128 is about 107 bits. Exponent range is the same as for double numbers: 2^-1022 to 2^1023. So large numbers (above 2^108) are always integers, they do not need rounding and the result of ceil, floor etc is the argument.

My understanding here is that the number of mantissa bits is effectively dynamic, since you could combine a large exponent (e.g., 2^1023) in the first number and a tiny exponent (e.g., 2^-50) in the second one, and all the mantissa bits in the middle would be implied 0. But I have no actual practical experience with ppc_fp128, and documentation for these kinds of things isn't great.

Dec 13 2022, 9:36 PM · Restricted Project, Restricted Project
sepavloff added inline comments to D112932: Use llvm.is_fpclass to implement FP classification functions.
Dec 13 2022, 11:21 AM · Restricted Project, Restricted Project
sepavloff added inline comments to D139120: APFloat: Add isSmallestNormalized predicate function.
Dec 13 2022, 10:02 AM · Restricted Project, Restricted Project
sepavloff added a comment to D139859: [llvm-symbolize] Allow finding location of a symbol.

Does unix addr2line support this, or is there other precedent we should consider when evaluating this new feature?

Dec 13 2022, 7:51 AM · Restricted Project, Restricted Project
sepavloff updated the diff for D139859: [llvm-symbolize] Allow finding location of a symbol.

Replace llvm::Optional with std::optional

Dec 13 2022, 7:43 AM · Restricted Project, Restricted Project