Page MenuHomePhabricator

sepavloff (Serge Pavlov)
User

Projects

User does not belong to any projects.

User Details

User Since
Mar 13 2013, 7:26 AM (409 w, 6 d)

Recent Activity

Sun, Jan 10

sepavloff added a comment to D94163: [RISCV] Set dependency on floating point CSRs, 1/3.

I still don't understand why the existence of static rounding modes in the ISA requires that we have to use them for the default environment. X86 doesn't have static rounding mode prior to AVX512 so uses dynamic in the default mode.

Sun, Jan 10, 3:53 AM · Restricted Project
sepavloff added inline comments to D90853: [RISCV] Add DAG nodes to represent read/write CSR.
Sun, Jan 10, 3:52 AM · Restricted Project

Sat, Jan 9

sepavloff added a comment to D90853: [RISCV] Add DAG nodes to represent read/write CSR.

Hi Serge, would it make sense to use a Pseudo for those specific cases with a custom inserter? (usesCustomInserter = 1 in the tablegen definition of the Pseudo)

This way you could have PseudoCSRW and PseudoCSRWI (it looks to me you do not need the other cases, did I get that right?) that you can use in the patterns. Then you can expand them to the existing MachineInstructions CSRRW, CSRRWI, respectively (hope I didn't get the names wrong), that use X0 as the destination register in RISCVTargetLowering::EmitInstrWithCustomInserter.

Sat, Jan 9, 10:27 PM · Restricted Project

Wed, Jan 6

sepavloff added a comment to D90853: [RISCV] Add DAG nodes to represent read/write CSR.

, fake writes to X0 would create false output dependencies, which would require specific treatment. Using instructions without output is a natural way to represent such cases.

LLVM knows it’s a constant register. The correct thing to do IMO is fix any places in LLVM that don’t account for constant registers, if there are any, and then have a generic solution, rather than try and work around any deficiencies by adding special cases to backends every single time it comes up.

Wed, Jan 6, 7:14 AM · Restricted Project
sepavloff requested review of D94165: [RISCV] Set dependency on floating point CSRs, 3/3.
Wed, Jan 6, 2:43 AM · Restricted Project
sepavloff requested review of D94164: [RISCV] Set dependency on floating point CSRs, 2/3.
Wed, Jan 6, 2:41 AM · Restricted Project
sepavloff abandoned D93624: [RISCV] Fix rounding mode in lowering of float operations.

This change is merged into D94163 and subsequent changes.

Wed, Jan 6, 2:37 AM · Restricted Project
sepavloff added a comment to D93624: [RISCV] Fix rounding mode in lowering of float operations.

I have a feeling that a lot of code out there uses fesetround without changing compiler flags, and probably "works" on x86 because everything uses the dynamic rounding mode.

Wed, Jan 6, 2:35 AM · Restricted Project
sepavloff requested review of D94163: [RISCV] Set dependency on floating point CSRs, 1/3.
Wed, Jan 6, 2:31 AM · Restricted Project

Mon, Dec 21

sepavloff added a comment to D93624: [RISCV] Fix rounding mode in lowering of float operations.

Doesn't this render fesetround useless?

Mon, Dec 21, 6:33 AM · Restricted Project
sepavloff updated the diff for D93624: [RISCV] Fix rounding mode in lowering of float operations.

Changed test

Mon, Dec 21, 6:25 AM · Restricted Project
sepavloff requested review of D93624: [RISCV] Fix rounding mode in lowering of float operations.
Mon, Dec 21, 3:17 AM · Restricted Project

Nov 17 2020

sepavloff added a comment to D90853: [RISCV] Add DAG nodes to represent read/write CSR.

Even if there were a way to specify particular register in outputs, fake writes to X0 would create false output dependencies, which would require specific treatment. Using instructions without output is a natural way to represent such cases.

Nov 17 2020, 4:42 AM · Restricted Project
sepavloff added a comment to D78903: [Driver] Add option -fproc-stat-report.

Could you add quotation marks around the executable name to make the CSV file easier to parse?

Nov 17 2020, 4:32 AM · Restricted Project
sepavloff committed rG9faedb2d7146: [Driver] Quote executable in reports generated by -fproc-stat-report (authored by sepavloff).
[Driver] Quote executable in reports generated by -fproc-stat-report
Nov 17 2020, 12:17 AM

Nov 16 2020

sepavloff added a comment to D74729: [FPEnv] Intrinsic for setting rounding mode.

Ping.

Nov 16 2020, 7:43 AM · Restricted Project

Nov 15 2020

sepavloff abandoned D69272: Enable '#pragma STDC FENV_ACCESS' in frontend.

Implemented in D87528.

Nov 15 2020, 10:07 PM · Restricted Project

Nov 12 2020

sepavloff committed rG92d7a84e128a: [Driver] Add option -fproc-stat-report (authored by sepavloff).
[Driver] Add option -fproc-stat-report
Nov 12 2020, 11:16 PM
sepavloff closed D78903: [Driver] Add option -fproc-stat-report.
Nov 12 2020, 11:16 PM · Restricted Project
sepavloff updated the diff for D90854: [RISCV] Custom lowering of FLT_ROUNDS_.

Fixed comments

Nov 12 2020, 10:12 AM · Restricted Project
sepavloff updated the diff for D90854: [RISCV] Custom lowering of FLT_ROUNDS_.

Small changes similar to those made in D91242

Nov 12 2020, 9:47 AM · Restricted Project
sepavloff added a comment to D91242: [RISCV] Custom lowering of SET_ROUNDING.

Would a SELECT not be more friendly to optimisations like known-bits analysis, or does that cause too much code to be emitted in the general case?

Nov 12 2020, 5:57 AM · Restricted Project
sepavloff updated the diff for D91242: [RISCV] Custom lowering of SET_ROUNDING.

Updated patch according to reviewer's notes.

Nov 12 2020, 5:45 AM · Restricted Project

Nov 11 2020

sepavloff added a comment to D74729: [FPEnv] Intrinsic for setting rounding mode.

Do we need type legalization support for targets like RISCV where i32 isn't a legal type in SelectionDAG?

Lowering of the intrinsic is anyway custom. Default promotion to i64 is OK.

There is no default promotion code. Each opcode that needs to be promoted by type legalization must be handled in LegalizeIntegerTypes.cpp

Nov 11 2020, 6:41 AM · Restricted Project
sepavloff added a comment to D90853: [RISCV] Add DAG nodes to represent read/write CSR.

I’m pretty sure you can use X0 as the output...

Nov 11 2020, 6:30 AM · Restricted Project
sepavloff added a comment to D90853: [RISCV] Add DAG nodes to represent read/write CSR.

What's the motivation for this?

Nov 11 2020, 4:08 AM · Restricted Project
sepavloff updated the diff for D90853: [RISCV] Add DAG nodes to represent read/write CSR.

Updated patch

Nov 11 2020, 2:40 AM · Restricted Project
sepavloff requested review of D91242: [RISCV] Custom lowering of SET_ROUNDING.
Nov 11 2020, 2:37 AM · Restricted Project

Nov 10 2020

sepavloff accepted D90218: Fix PR47973: Addressing integer division edge case with INT_MIN.

LGTM

Nov 10 2020, 4:22 AM · Restricted Project

Nov 9 2020

sepavloff added inline comments to D90218: Fix PR47973: Addressing integer division edge case with INT_MIN.
Nov 9 2020, 11:06 PM · Restricted Project

Nov 6 2020

sepavloff accepted D88913: [FPEnv] Use strictfp metadata in casting nodes.

LGTM.

Nov 6 2020, 6:13 AM · Restricted Project, Restricted Project

Nov 5 2020

sepavloff requested review of D90854: [RISCV] Custom lowering of FLT_ROUNDS_.
Nov 5 2020, 8:06 AM · Restricted Project
sepavloff requested review of D90853: [RISCV] Add DAG nodes to represent read/write CSR.
Nov 5 2020, 8:03 AM · Restricted Project
sepavloff updated the diff for D74729: [FPEnv] Intrinsic for setting rounding mode.

Add support in DAGTypeLegalizer::PromoteIntegerOperand

Nov 5 2020, 1:57 AM · Restricted Project

Nov 4 2020

sepavloff committed rG20b4f4f76030: [Driver] Add callback to Command execution (authored by sepavloff).
[Driver] Add callback to Command execution
Nov 4 2020, 9:23 PM
sepavloff closed D78899: [Driver] Add callback to Command execution.
Nov 4 2020, 9:23 PM · Restricted Project

Nov 3 2020

sepavloff updated the diff for D78899: [Driver] Add callback to Command execution.

Added documentation

Nov 3 2020, 6:04 AM · Restricted Project

Nov 2 2020

sepavloff committed rGee63acc37e31: Put back the test pragma-fp-exc.cpp (authored by sepavloff).
Put back the test pragma-fp-exc.cpp
Nov 2 2020, 10:20 PM

Oct 31 2020

sepavloff committed rG5963e028e714: Temporarily remove test CodeGen/pragma-fp-exc (authored by sepavloff).
Temporarily remove test CodeGen/pragma-fp-exc
Oct 31 2020, 5:50 AM
sepavloff committed rG6021cbea4d34: Add option 'exceptions' to pragma clang fp (authored by sepavloff).
Add option 'exceptions' to pragma clang fp
Oct 31 2020, 3:37 AM
sepavloff closed D89849: Add option 'exceptions' to pragma clang fp.
Oct 31 2020, 3:37 AM · Restricted Project

Oct 30 2020

sepavloff accepted D90316: [FPEnv] Diagnose pragmas FENV_ROUND,_ACCESS and float_control if target does not support StrictFP.

LGTM.

Oct 30 2020, 12:10 AM · Restricted Project

Oct 29 2020

sepavloff added a comment to D88913: [FPEnv] Use strictfp metadata in casting nodes.

This patch contains many tests and they are valuable. However many of them are likely to be compatible with unpatched compiler, so are not related to casting nodes. I would propose to move such tests into a separate patch and make this one dependent on it. Leave here only tests that depend on the changes made by this patch.

Oct 29 2020, 11:55 PM · Restricted Project, Restricted Project

Oct 28 2020

sepavloff committed rG08bb5d9196b3: [FPEnv] Tests for rounding properties of constant evalution (authored by sepavloff).
[FPEnv] Tests for rounding properties of constant evalution
Oct 28 2020, 11:54 PM
sepavloff closed D90026: [FPEnv] Tests for rounding properties of constant evalution.
Oct 28 2020, 11:54 PM · Restricted Project
sepavloff added a comment to D74729: [FPEnv] Intrinsic for setting rounding mode.

Do we need type legalization support for targets like RISCV where i32 isn't a legal type in SelectionDAG?

Oct 28 2020, 5:20 AM · Restricted Project
sepavloff updated the diff for D74729: [FPEnv] Intrinsic for setting rounding mode.

Removed method IRBuilderBase::createSetRounding.

Oct 28 2020, 3:02 AM · Restricted Project

Oct 27 2020

sepavloff added a comment to D88913: [FPEnv] Use strictfp metadata in casting nodes.
In D88913#2356152, @kpn wrote:

Generally the patch looks good. But the need to expect incorrect values in tests is a concern. Maybe this is a consequence of storing exception behavior in a separate field of CGFPOptionsRAII. This misbehavior should be fixed.

In this patch? Because that's going to be a huge patch. Fixing all the issues with strictfp AST->IRBuilder is going to be large. Fixing them incrementally seems better to me. Eliminating the incorrect values in the tests marked FIXME would sweep the problem under the rug.

It's true that incorrect values in tests is _not_ the desired end state. But it seems to me that as a _temporary_ incremental step it beats the alternatives.

Oct 27 2020, 9:55 AM · Restricted Project, Restricted Project

Oct 26 2020

sepavloff added inline comments to D74729: [FPEnv] Intrinsic for setting rounding mode.
Oct 26 2020, 11:17 PM · Restricted Project
sepavloff updated the diff for D74729: [FPEnv] Intrinsic for setting rounding mode.

Added TODO.

Oct 26 2020, 11:16 PM · Restricted Project
sepavloff added inline comments to D74729: [FPEnv] Intrinsic for setting rounding mode.
Oct 26 2020, 8:42 AM · Restricted Project
sepavloff added a comment to D88913: [FPEnv] Use strictfp metadata in casting nodes.

Generally the patch looks good. But the need to expect incorrect values in tests is a concern. Maybe this is a consequence of storing exception behavior in a separate field of CGFPOptionsRAII. This misbehavior should be fixed.

Oct 26 2020, 6:12 AM · Restricted Project, Restricted Project

Oct 23 2020

sepavloff requested review of D90026: [FPEnv] Tests for rounding properties of constant evalution.
Oct 23 2020, 4:41 AM · Restricted Project
sepavloff added a comment to D78899: [Driver] Add callback to Command execution.

Ping.
This is the only remaining prerequisite for D78903.

Oct 23 2020, 4:06 AM · Restricted Project
sepavloff added a comment to D74729: [FPEnv] Intrinsic for setting rounding mode.

Ping.

Oct 23 2020, 4:05 AM · Restricted Project
sepavloff added inline comments to D87528: Enable '#pragma STDC FENV_ACCESS' in frontend.
Oct 23 2020, 3:46 AM · Restricted Project

Oct 22 2020

sepavloff committed rG7975b8c38da2: [IR] Merge metadata manipulation code into Value (authored by sepavloff).
[IR] Merge metadata manipulation code into Value
Oct 22 2020, 9:10 PM
sepavloff closed D67626: [IR] Merge metadata manipulation code into Value.
Oct 22 2020, 9:10 PM · Restricted Project
sepavloff added inline comments to D89849: Add option 'exceptions' to pragma clang fp.
Oct 22 2020, 12:34 AM · Restricted Project
sepavloff updated the diff for D89849: Add option 'exceptions' to pragma clang fp.

Added ActOnPragmaFPExceptions

Oct 22 2020, 12:31 AM · Restricted Project

Oct 21 2020

sepavloff added a comment to D67626: [IR] Merge metadata manipulation code into Value.

Sadly I completely missed your update here. I’m skeptical there’s another Value subclass that needs or should have metadata (do you have something in mind?), but this is nevertheless a massive simplification and I like the direction!

Oct 21 2020, 11:18 PM · Restricted Project
sepavloff updated the summary of D67626: [IR] Merge metadata manipulation code into Value.
Oct 21 2020, 11:10 PM · Restricted Project
sepavloff updated the diff for D67626: [IR] Merge metadata manipulation code into Value.

Made metadata manipulation methods protected

Oct 21 2020, 11:09 PM · Restricted Project
sepavloff added inline comments to D89849: Add option 'exceptions' to pragma clang fp.
Oct 21 2020, 6:20 AM · Restricted Project

Oct 20 2020

sepavloff requested review of D89849: Add option 'exceptions' to pragma clang fp.
Oct 20 2020, 11:35 PM · Restricted Project
sepavloff accepted D87528: Enable '#pragma STDC FENV_ACCESS' in frontend.

There is concern with restoring FP options but it could be solved separately.

Oct 20 2020, 11:28 PM · Restricted Project
sepavloff abandoned D88498: [FPEnv] Apply dynamic rounding to function body only.

The tests in this patch exhibit the same behavior with and without the patch applied; I think almost all the functionality changes from here are superseded by the change to consider whether we're in a manifestly constant evaluated context.

Oct 20 2020, 4:49 AM · Restricted Project

Oct 19 2020

sepavloff accepted D89690: [clang] update of the DragonFlyBSD's driver for the 5.8.x releases..

LGTM.

Oct 19 2020, 5:17 AM · Restricted Project
sepavloff added inline comments to D88913: [FPEnv] Use strictfp metadata in casting nodes.
Oct 19 2020, 5:15 AM · Restricted Project, Restricted Project

Oct 15 2020

sepavloff added a comment to D89360: Treat constant contexts as being in the default rounding mode..

Probably there is an issue with code generation. The source:

constexpr float func_01(float x, float y) {
  return x + y;
}
Oct 15 2020, 11:35 PM · Restricted Project
sepavloff added a comment to D89360: Treat constant contexts as being in the default rounding mode..

As C++ case is much more complicated and we need a ruleset based on essential properties rather than implementation viewpoint, I am convinced that the solution based on manifestly constant-evaluated property is the best.
Thank you for the discussion!

Oct 15 2020, 11:15 AM · Restricted Project
sepavloff added a comment to D88498: [FPEnv] Apply dynamic rounding to function body only.

Actually this solution also behaves wrong in some cases.

Oct 15 2020, 11:06 AM · Restricted Project
sepavloff added a comment to D89360: Treat constant contexts as being in the default rounding mode..

I would propose to consider solution in D88498. It tries to fix the real reason of the malfunction - using dynamic rounding mode for evaluation of global variable initializers.

That is not the real reason for the malfunction. If you narrowly look at C, you can convince yourself otherwise, but that's only because global variable initializers are the only place where we need to evaluate floating-point constant expressions in C. In C++, this problem affects all contexts where constant evaluation might happen (array bounds, bit-field widths, and a whole host of others).

Oct 15 2020, 7:34 AM · Restricted Project
sepavloff retitled D88498: [FPEnv] Apply dynamic rounding to function body only from [FPEnv] Evaluate initializers in constant rounding mode to [FPEnv] Apply dynamic rounding to function body only.
Oct 15 2020, 7:23 AM · Restricted Project
sepavloff updated the diff for D88498: [FPEnv] Apply dynamic rounding to function body only.

Remade the patch

Oct 15 2020, 7:21 AM · Restricted Project

Oct 14 2020

sepavloff added a comment to D89360: Treat constant contexts as being in the default rounding mode..

I would propose to consider solution in D88498. It tries to fix the real reason of the malfunction - using dynamic rounding mode for evaluation of global variable initializers. With the workaround for constexpr functions it allows to compile the test attached and still correctly detect runtime nature of local variable initializers.

Oct 14 2020, 4:56 AM · Restricted Project
sepavloff updated the diff for D88498: [FPEnv] Apply dynamic rounding to function body only.

Updated patch

Oct 14 2020, 4:53 AM · Restricted Project

Oct 12 2020

sepavloff added inline comments to D88913: [FPEnv] Use strictfp metadata in casting nodes.
Oct 12 2020, 3:19 AM · Restricted Project, Restricted Project

Oct 8 2020

sepavloff committed rG70bf35070a74: [Driver] Add output file to properties of Command (authored by sepavloff).
[Driver] Add output file to properties of Command
Oct 8 2020, 4:26 AM
sepavloff closed D78902: [Driver] Add output file to properties of Command.
Oct 8 2020, 4:26 AM · Restricted Project

Oct 7 2020

sepavloff added inline comments to D88913: [FPEnv] Use strictfp metadata in casting nodes.
Oct 7 2020, 4:12 AM · Restricted Project, Restricted Project
sepavloff added inline comments to D78902: [Driver] Add output file to properties of Command.
Oct 7 2020, 2:50 AM · Restricted Project
sepavloff updated the diff for D78902: [Driver] Add output file to properties of Command.

Add default argument for parameter Output in constructors of Command*

Oct 7 2020, 2:33 AM · Restricted Project

Oct 6 2020

sepavloff added a comment to D87528: Enable '#pragma STDC FENV_ACCESS' in frontend.

For the LIT test clang/test/AST/const-fpfeatures.cpp, currently failing in this patch, the variables V1 and others are initialized via call to "global var init" which performs the rounding at execution time, I think that's correct not certain.

Oct 6 2020, 7:51 AM · Restricted Project
sepavloff added inline comments to D78902: [Driver] Add output file to properties of Command.
Oct 6 2020, 7:08 AM · Restricted Project
sepavloff updated the diff for D78902: [Driver] Add output file to properties of Command.

Use MakeArgString to get persistent string

Oct 6 2020, 7:02 AM · Restricted Project

Oct 5 2020

sepavloff updated the diff for D74729: [FPEnv] Intrinsic for setting rounding mode.

Removed check from Verifier

Oct 5 2020, 11:31 PM · Restricted Project
sepavloff added inline comments to D87528: Enable '#pragma STDC FENV_ACCESS' in frontend.
Oct 5 2020, 12:25 AM · Restricted Project

Oct 4 2020

sepavloff added a comment to D78902: [Driver] Add output file to properties of Command.

Ping.

Oct 4 2020, 11:30 PM · Restricted Project
sepavloff added a comment to D74729: [FPEnv] Intrinsic for setting rounding mode.

Any feedback is appreciated.

Oct 4 2020, 11:02 PM · Restricted Project

Oct 1 2020

sepavloff updated the diff for D74729: [FPEnv] Intrinsic for setting rounding mode.

Removed clang-tidy warning

Oct 1 2020, 9:52 AM · Restricted Project

Sep 30 2020

sepavloff added inline comments to D88498: [FPEnv] Apply dynamic rounding to function body only.
Sep 30 2020, 10:54 PM · Restricted Project
sepavloff added inline comments to D88498: [FPEnv] Apply dynamic rounding to function body only.
Sep 30 2020, 1:01 AM · Restricted Project
sepavloff added inline comments to D88498: [FPEnv] Apply dynamic rounding to function body only.
Sep 30 2020, 12:57 AM · Restricted Project
sepavloff updated the diff for D88498: [FPEnv] Apply dynamic rounding to function body only.

Updated patch

Sep 30 2020, 12:54 AM · Restricted Project

Sep 29 2020

sepavloff added a comment to D87822: [FPEnv] Evaluate constant expressions under non-default rounding modes.

The change https://reviews.llvm.org/rG4e4f926e83cf removes the problematic
test.
Sorry for troubles.

Sep 29 2020, 9:15 PM · Restricted Project
sepavloff committed rG4e4f926e83cf: Remove test AST/const-fpfeatures-diag.c (authored by sepavloff).
Remove test AST/const-fpfeatures-diag.c
Sep 29 2020, 9:11 PM
sepavloff added a comment to D87822: [FPEnv] Evaluate constant expressions under non-default rounding modes.

Thanks for looking into it. We have that commit but it still seems to be
failing for us with the same error.

Sep 29 2020, 10:31 AM · Restricted Project
sepavloff added a comment to D88462: FP math settings for static duration initialization - work in progress.

Please look at D88498.

Sep 29 2020, 9:03 AM · Restricted Project
sepavloff requested review of D88498: [FPEnv] Apply dynamic rounding to function body only.
Sep 29 2020, 9:02 AM · Restricted Project