Page MenuHomePhabricator
Feed Advanced Search

Yesterday

sepavloff added a child revision for D75246: Fix reporting inexact status in IEEEFloat::roundToIntegral: D72930: [FEnv] Constfold some unary constrained operations.
Thu, Feb 27, 9:45 AM · Restricted Project
sepavloff added a parent revision for D72930: [FEnv] Constfold some unary constrained operations: D75246: Fix reporting inexact status in IEEEFloat::roundToIntegral.
Thu, Feb 27, 9:45 AM · Restricted Project
sepavloff added inline comments to D72930: [FEnv] Constfold some unary constrained operations.
Thu, Feb 27, 8:53 AM · Restricted Project
sepavloff updated the diff for D72930: [FEnv] Constfold some unary constrained operations.

Updated patch according to reviewer's notes

Thu, Feb 27, 8:32 AM · Restricted Project
sepavloff created D75246: Fix reporting inexact status in IEEEFloat::roundToIntegral.
Thu, Feb 27, 5:27 AM · Restricted Project

Tue, Feb 25

sepavloff added inline comments to D72930: [FEnv] Constfold some unary constrained operations.
Tue, Feb 25, 10:46 AM · Restricted Project
sepavloff updated the diff for D72930: [FEnv] Constfold some unary constrained operations.

Updated patch according to review notes

Tue, Feb 25, 10:18 AM · Restricted Project

Mon, Feb 24

sepavloff added a comment to D72930: [FEnv] Constfold some unary constrained operations.

Ping.

Mon, Feb 24, 9:53 AM · Restricted Project

Tue, Feb 18

sepavloff added inline comments to D74730: [FPEnv][X86] Implement lowering of llvm.set.rounding.
Tue, Feb 18, 12:06 AM · Restricted Project

Mon, Feb 17

sepavloff updated the diff for D74730: [FPEnv][X86] Implement lowering of llvm.set.rounding.

Modified patch according to reviewer's notes

Mon, Feb 17, 11:57 PM · Restricted Project
sepavloff added a child revision for D74729: [FPEnv] Intrinsic for setting rounding mode: D74730: [FPEnv][X86] Implement lowering of llvm.set.rounding.
Mon, Feb 17, 10:31 AM · Restricted Project
sepavloff added a parent revision for D74730: [FPEnv][X86] Implement lowering of llvm.set.rounding: D74729: [FPEnv] Intrinsic for setting rounding mode.
Mon, Feb 17, 10:31 AM · Restricted Project
sepavloff created D74730: [FPEnv][X86] Implement lowering of llvm.set.rounding.
Mon, Feb 17, 10:31 AM · Restricted Project
sepavloff created D74729: [FPEnv] Intrinsic for setting rounding mode.
Mon, Feb 17, 10:21 AM · Restricted Project

Thu, Feb 13

sepavloff added inline comments to D72930: [FEnv] Constfold some unary constrained operations.
Thu, Feb 13, 10:25 PM · Restricted Project

Tue, Feb 11

sepavloff added inline comments to D72930: [FEnv] Constfold some unary constrained operations.
Tue, Feb 11, 10:32 AM · Restricted Project

Mon, Feb 3

sepavloff updated the diff for D72930: [FEnv] Constfold some unary constrained operations.

Rebase and ping.

Mon, Feb 3, 9:16 PM · Restricted Project
sepavloff updated the diff for D69798: Implement inlining of strictfp functions.

Updated patch

Mon, Feb 3, 5:42 AM · Restricted Project
sepavloff removed a child revision for D71742: Added intrinsics for access to FP environment: D69798: Implement inlining of strictfp functions.
Mon, Feb 3, 5:42 AM · Restricted Project
sepavloff removed a parent revision for D69798: Implement inlining of strictfp functions: D71742: Added intrinsics for access to FP environment.
Mon, Feb 3, 5:42 AM · Restricted Project
sepavloff updated the diff for D69562: Mapping of FP operations to constrained intrinsics.

Updated patch

Mon, Feb 3, 5:02 AM · Restricted Project

Thu, Jan 30

sepavloff added a comment to D72841: [RFC] Add support for pragma float_control, to control precision and exception behavior at the source level.

You could check the scope where the pragma appears is the same way as pragma clang fp does. The code

Thu, Jan 30, 10:23 PM · Restricted Project, Restricted Project

Wed, Jan 29

sepavloff updated the diff for D69272: Enable '#pragma STDC FENV_ACCESS' in frontend.

Avoid using custom attribute, use Function::useFPIntrin instead.

Wed, Jan 29, 10:34 PM · Restricted Project

Jan 27 2020

sepavloff added a comment to D72841: [RFC] Add support for pragma float_control, to control precision and exception behavior at the source level.

Could you please rebase the patch against current master?
The commit "4aea70ed3292: [FPEnv] Extended FPOptions with new attributes" changed layout of FPOptions, which affects your patch.

Jan 27 2020, 6:58 AM · Restricted Project, Restricted Project

Jan 26 2020

sepavloff committed rG4aea70ed3292: [FPEnv] Extended FPOptions with new attributes (authored by sepavloff).
[FPEnv] Extended FPOptions with new attributes
Jan 26 2020, 6:07 AM
sepavloff closed D65994: Extended FPOptions with new attributes.
Jan 26 2020, 6:07 AM · Restricted Project
sepavloff added inline comments to D72930: [FEnv] Constfold some unary constrained operations.
Jan 26 2020, 4:02 AM · Restricted Project
sepavloff updated the diff for D72930: [FEnv] Constfold some unary constrained operations.

Updated patch

Jan 26 2020, 3:56 AM · Restricted Project

Jan 23 2020

sepavloff updated the diff for D65994: Extended FPOptions with new attributes.

Rebased the patch

Jan 23 2020, 7:07 AM · Restricted Project
sepavloff updated the diff for D69562: Mapping of FP operations to constrained intrinsics.

Rebased patch

Jan 23 2020, 5:17 AM · Restricted Project

Jan 21 2020

sepavloff added a comment to D72841: [RFC] Add support for pragma float_control, to control precision and exception behavior at the source level.

I don't see tests for correctness of the pragma stack (pragma float_control(... push), pragma float_control(pop)). Can you add them?

Jan 21 2020, 11:57 PM · Restricted Project, Restricted Project

Jan 20 2020

sepavloff added inline comments to D72841: [RFC] Add support for pragma float_control, to control precision and exception behavior at the source level.
Jan 20 2020, 10:43 PM · Restricted Project, Restricted Project

Jan 18 2020

sepavloff updated the diff for D72930: [FEnv] Constfold some unary constrained operations.

Changed rounding to nearest from roundTiesToAway to roundTiesToEven

Jan 18 2020, 8:53 AM · Restricted Project
sepavloff added a comment to D72930: [FEnv] Constfold some unary constrained operations.

Andrew, Craig, thank you for explanations!

Jan 18 2020, 8:52 AM · Restricted Project

Jan 17 2020

sepavloff added inline comments to D72930: [FEnv] Constfold some unary constrained operations.
Jan 17 2020, 11:30 AM · Restricted Project
sepavloff added inline comments to D72930: [FEnv] Constfold some unary constrained operations.
Jan 17 2020, 9:34 AM · Restricted Project
sepavloff added inline comments to D72841: [RFC] Add support for pragma float_control, to control precision and exception behavior at the source level.
Jan 17 2020, 9:15 AM · Restricted Project, Restricted Project
sepavloff created D72930: [FEnv] Constfold some unary constrained operations.
Jan 17 2020, 8:34 AM · Restricted Project

Jan 16 2020

sepavloff added inline comments to D72841: [RFC] Add support for pragma float_control, to control precision and exception behavior at the source level.
Jan 16 2020, 10:44 PM · Restricted Project, Restricted Project

Dec 26 2019

sepavloff updated the diff for D69272: Enable '#pragma STDC FENV_ACCESS' in frontend.

Updated patch

Dec 26 2019, 11:56 PM · Restricted Project
sepavloff retitled D69272: Enable '#pragma STDC FENV_ACCESS' in frontend from Restricted variant of '#pragma STDC FENV_ACCESS' to Enable '#pragma STDC FENV_ACCESS' in frontend.
Dec 26 2019, 11:56 PM · Restricted Project

Dec 23 2019

sepavloff added a comment to D69798: Implement inlining of strictfp functions.
In D69798#1794921, @kpn wrote:
In D69798#1793237, @kpn wrote:

If FENV_ACCESS is ON and a function is called that expects it to be OFF then isn't that just plain undefined behavior? Unless it was changed since C99 I don't see how this is the compiler's problem to solve. And the compiler really shouldn't be changing the FP environment implicitly just because an arbitrary function was called, or we fell out of an FENV_ACCESS=ON scope, or whatever.

This is a matter of convention. If it is a user responsibility to call only 'proper' functions, FP state switch is not required. It however could be a fragile solution, because in complex programs it is hard to guarantee that non of the call recursively does not imply default FP environment. The safer solution is to save/restore the environment in unclear cases, and let backend to optimize out unnecessary calls.

It _is_ the responsibility of the user to not call problematic functions. That _is_ the current convention. Yes, it may be fragile, but that's still the user's problem to solve. And the compiler can't know when the calls aren't needed because that information about functions in other TU simply isn't available. Plus, there are cases where functions are compiled with the #pragma and are expecting to be called with a non-default FP environment, but they don't change the environment themselves. So having the compiler insert calls to change the environment before calling would be an error. It's a mistake to trade off a set of potential errors caused by the programmer in exchange for a set of problems caused by the compiler.

Dec 23 2019, 8:57 AM · Restricted Project
sepavloff added a comment to D71742: Added intrinsics for access to FP environment.
In D71742#1794901, @kpn wrote:
In D71742#1793243, @kpn wrote:

I don't see the need. Changing the FP environment in a mixed environment program is the responsibility of the programmer, and standard calls already exist for this.

This is about inlining. In the code like this:

double f1(double x, double y) {
  return x + y;
}
double f2(double x, double y) {
  #pragma STDC FENV_ACCESS ON
  ...
  return f1(x, y);
}

compiler might inline call to f1 in f2. However the inlined function f1 expects default FP environment but is called in some other one.

Nothing here changes my statement. The compiler does _not_ change the FP environment because of the #pragma. So f1() here would behave the same whether it was inlined or not.

Dec 23 2019, 8:48 AM · Restricted Project

Dec 22 2019

sepavloff added a comment to D69798: Implement inlining of strictfp functions.
In D69798#1793237, @kpn wrote:

When function that uses default FP environment is inlined into strictfp function, code of the former will be executed in the FP environment set in the strictfp function. To fix this behavior the FP environment should be saved upon entry to the inlined function, FP environment reset to default state, and the saved state must be restored upon leaving the inlined function.

So if the function is inlined it would use the reset state, but if it doesn't get inlined it would use the caller's state. Doesn't that mean whether or not the compiler inlines the function changes the behavior of the program?

It is so now. If a code in which #pargma STDC FENV_ACCESS ON acts calls an external function, it would be executed in caller's FP environment. This is wrong if the callee expects default one. We could put get_fenv, reset_fenv and set_fenv, introduced in D71742, around all calls, unless the called function has strictfp attribute, or we know that it does not use FP operation. It however could create unneeded code, which is bad for performance. We need to elaborate proper solution.

If FENV_ACCESS is ON and a function is called that expects it to be OFF then isn't that just plain undefined behavior? Unless it was changed since C99 I don't see how this is the compiler's problem to solve. And the compiler really shouldn't be changing the FP environment implicitly just because an arbitrary function was called, or we fell out of an FENV_ACCESS=ON scope, or whatever.

Dec 22 2019, 10:14 PM · Restricted Project
sepavloff added a comment to D71742: Added intrinsics for access to FP environment.
In D71742#1793243, @kpn wrote:

I don't see the need. Changing the FP environment in a mixed environment program is the responsibility of the programmer, and standard calls already exist for this.

Dec 22 2019, 9:54 PM · Restricted Project
sepavloff added a comment to D69272: Enable '#pragma STDC FENV_ACCESS' in frontend.

@hfinkel proposed to use outlining to extract a block with the #pragma to separate function. It could be a basis for a full implementation.

I don't think outlining is a reasonable approach. Outlining has a *lot* of other performance consequences, and we'd have to support arbitrary control flow (e.g. goto) in and out of the outlined function, which adds a lot of frontend complexity in pursuit of something that ought be handled at the optimizer level.

Dec 22 2019, 9:36 PM · Restricted Project

Dec 20 2019

sepavloff added a comment to D69272: Enable '#pragma STDC FENV_ACCESS' in frontend.
In D69272#1792877, @kpn wrote:

My understanding of this patch is that it only allows the #pragma at the top of each function. It doesn't allow it in blocks inside the function. So if a function has a block inside it that uses strict FP the patch doesn't change the rest of the function to use constrained FP with the settings like you said. And my question was asking if there was a way forward with this patch to a full implementation.

Dec 20 2019, 8:39 AM · Restricted Project
sepavloff added a comment to D69798: Implement inlining of strictfp functions.

When function that uses default FP environment is inlined into strictfp function, code of the former will be executed in the FP environment set in the strictfp function. To fix this behavior the FP environment should be saved upon entry to the inlined function, FP environment reset to default state, and the saved state must be restored upon leaving the inlined function.

So if the function is inlined it would use the reset state, but if it doesn't get inlined it would use the caller's state. Doesn't that mean whether or not the compiler inlines the function changes the behavior of the program?

Dec 20 2019, 8:29 AM · Restricted Project

Dec 19 2019

sepavloff planned changes to D69798: Implement inlining of strictfp functions.

When function that uses default FP environment is inlined into strictfp function, code of the former will be executed in the FP environment set in the strictfp function. To fix this behavior the FP environment should be saved upon entry to the inlined function, FP environment reset to default state, and the saved state must be restored upon leaving the inlined function.

Dec 19 2019, 11:03 PM · Restricted Project
sepavloff added a parent revision for D69798: Implement inlining of strictfp functions: D71742: Added intrinsics for access to FP environment.
Dec 19 2019, 11:03 PM · Restricted Project
sepavloff added a child revision for D71742: Added intrinsics for access to FP environment: D69798: Implement inlining of strictfp functions.
Dec 19 2019, 11:03 PM · Restricted Project
sepavloff created D71742: Added intrinsics for access to FP environment.
Dec 19 2019, 10:53 PM · Restricted Project
sepavloff added a child revision for D71741: Add size of FP environment to DataLayout: D71742: Added intrinsics for access to FP environment.
Dec 19 2019, 10:53 PM · Restricted Project
sepavloff added a parent revision for D71742: Added intrinsics for access to FP environment: D71741: Add size of FP environment to DataLayout.
Dec 19 2019, 10:53 PM · Restricted Project
sepavloff created D71741: Add size of FP environment to DataLayout.
Dec 19 2019, 10:23 PM · Restricted Project

Nov 20 2019

sepavloff committed rGea8678d1c78e: Move floating point related entities to namespace level (authored by sepavloff).
Move floating point related entities to namespace level
Nov 20 2019, 4:14 AM

Nov 19 2019

sepavloff committed rG0c50c0b0552e: [FEnv] File with properties of constrained intrinsics (authored by sepavloff).
[FEnv] File with properties of constrained intrinsics
Nov 19 2019, 10:37 PM
sepavloff closed D69887: [FEnv] File with properties of constrained intrinsics.
Nov 19 2019, 10:37 PM · Restricted Project
sepavloff updated the diff for D69887: [FEnv] File with properties of constrained intrinsics.

Updated patch according to reviewer's notes

Nov 19 2019, 4:28 AM · Restricted Project

Nov 18 2019

sepavloff added a comment to rGe6584b2b7b2d: Move floating point related entities to namespace level.

I am going to recommit this patch without changes that intersect with "Add support for options -frounding-math, ftrapping-math…". If it is undesirable for some reason, please let me know.

Nov 18 2019, 10:03 PM

Nov 15 2019

sepavloff committed rGe6584b2b7b2d: Move floating point related entities to namespace level (authored by sepavloff).
Move floating point related entities to namespace level
Nov 15 2019, 4:58 AM
sepavloff closed D69552: Move floating point related entities to namespace level.
Nov 15 2019, 4:58 AM · Restricted Project, Restricted Project

Nov 13 2019

sepavloff added inline comments to D69798: Implement inlining of strictfp functions.
Nov 13 2019, 9:23 AM · Restricted Project
sepavloff updated the diff for D69798: Implement inlining of strictfp functions.

Updated patch

Nov 13 2019, 8:46 AM · Restricted Project

Nov 11 2019

sepavloff updated the diff for D69798: Implement inlining of strictfp functions.

Updated patch

Nov 11 2019, 9:45 AM · Restricted Project
sepavloff updated the diff for D69887: [FEnv] File with properties of constrained intrinsics.

Updated patch

Nov 11 2019, 3:12 AM · Restricted Project

Nov 7 2019

sepavloff added a parent revision for D69562: Mapping of FP operations to constrained intrinsics: D69887: [FEnv] File with properties of constrained intrinsics.
Nov 7 2019, 4:28 AM · Restricted Project
sepavloff added inline comments to D69562: Mapping of FP operations to constrained intrinsics.
Nov 7 2019, 4:28 AM · Restricted Project
sepavloff added a child revision for D69887: [FEnv] File with properties of constrained intrinsics: D69562: Mapping of FP operations to constrained intrinsics.
Nov 7 2019, 4:28 AM · Restricted Project
sepavloff updated the diff for D69562: Mapping of FP operations to constrained intrinsics.

Updated patch

Nov 7 2019, 3:14 AM · Restricted Project

Nov 6 2019

sepavloff updated the diff for D69552: Move floating point related entities to namespace level.

Updated patch according to reviewer's notes

Nov 6 2019, 11:28 PM · Restricted Project, Restricted Project
sepavloff added a comment to D69552: Move floating point related entities to namespace level.

I think these enums should go into the same header as added in D69598

Nov 6 2019, 9:27 PM · Restricted Project, Restricted Project
sepavloff updated the diff for D69552: Move floating point related entities to namespace level.

Updated patch according to reviewers notes

Nov 6 2019, 9:00 PM · Restricted Project, Restricted Project
sepavloff added a comment to D69887: [FEnv] File with properties of constrained intrinsics.

I really like that approach. Unfortunately, this part of it does sort of partially revert one of the changes I recently made:

if (Opcode == ISD::STRICT_FP_ROUND)
  Opers.push_back(
      DAG.getTargetConstant(0, sdl, TLI.getPointerTy(DAG.getDataLayout())));

Actually it was moved below in the same file to the line 6900.

What I meant was: originally, there were two IR opcode checks, a first check (switch statement) to determine the DAG opcode, and a second check (just one "if" now, but needs to become another switch with the comparison patch) to determine extra DAG operands. My recent patch merged the two into a single opcode check (switch statement) -- and this patch again creates two separate checks.

Nov 6 2019, 7:59 AM · Restricted Project
sepavloff added a comment to D69562: Mapping of FP operations to constrained intrinsics.
In D69562#1732337, @kpn wrote:

The IRBuilder handles mapping non-constrained operations to constrained operations already. So a front-end just needs to enable strict mode in the IRBuilder and most everything "just works". And clang uses the IRBuilder, so we're good there. Are you working on a front-end that doesn't use the IRBuilder?

Nov 6 2019, 6:26 AM · Restricted Project
sepavloff added a comment to D69887: [FEnv] File with properties of constrained intrinsics.

I really like that approach. Unfortunately, this part of it does sort of partially revert one of the changes I recently made:

if (Opcode == ISD::STRICT_FP_ROUND)
  Opers.push_back(
      DAG.getTargetConstant(0, sdl, TLI.getPointerTy(DAG.getDataLayout())));
Nov 6 2019, 6:08 AM · Restricted Project
sepavloff updated the diff for D69552: Move floating point related entities to namespace level.

Updated patch according to reviewers notes

Nov 6 2019, 5:48 AM · Restricted Project, Restricted Project
sepavloff created D69887: [FEnv] File with properties of constrained intrinsics.
Nov 6 2019, 3:53 AM · Restricted Project

Nov 4 2019

sepavloff added a parent revision for D69272: Enable '#pragma STDC FENV_ACCESS' in frontend: D69798: Implement inlining of strictfp functions.
Nov 4 2019, 4:11 AM · Restricted Project
sepavloff added a child revision for D69798: Implement inlining of strictfp functions: D69272: Enable '#pragma STDC FENV_ACCESS' in frontend.
Nov 4 2019, 4:11 AM · Restricted Project
sepavloff updated the diff for D69272: Enable '#pragma STDC FENV_ACCESS' in frontend.

Removed diagnostics on inline functions

Nov 4 2019, 4:11 AM · Restricted Project
sepavloff added a child revision for D69562: Mapping of FP operations to constrained intrinsics: D69798: Implement inlining of strictfp functions.
Nov 4 2019, 3:11 AM · Restricted Project
sepavloff added a parent revision for D69798: Implement inlining of strictfp functions: D69562: Mapping of FP operations to constrained intrinsics.
Nov 4 2019, 3:11 AM · Restricted Project
sepavloff created D69798: Implement inlining of strictfp functions.
Nov 4 2019, 2:59 AM · Restricted Project

Oct 30 2019

sepavloff updated the diff for D69562: Mapping of FP operations to constrained intrinsics.

Fixed typo

Oct 30 2019, 3:27 AM · Restricted Project

Oct 29 2019

sepavloff added a parent revision for D69562: Mapping of FP operations to constrained intrinsics: D69552: Move floating point related entities to namespace level.
Oct 29 2019, 6:25 AM · Restricted Project
sepavloff created D69562: Mapping of FP operations to constrained intrinsics.
Oct 29 2019, 6:25 AM · Restricted Project
sepavloff added a child revision for D69552: Move floating point related entities to namespace level: D69562: Mapping of FP operations to constrained intrinsics.
Oct 29 2019, 6:25 AM · Restricted Project, Restricted Project
sepavloff created D69552: Move floating point related entities to namespace level.
Oct 29 2019, 12:30 AM · Restricted Project, Restricted Project

Oct 22 2019

sepavloff added inline comments to D69272: Enable '#pragma STDC FENV_ACCESS' in frontend.
Oct 22 2019, 10:09 AM · Restricted Project
sepavloff added a comment to D69272: Enable '#pragma STDC FENV_ACCESS' in frontend.
In D69272#1717967, @kpn wrote:

Baking into the front end the fact that the backend implementation is not yet complete doesn't strike me as a good idea.

Oct 22 2019, 9:45 AM · Restricted Project
sepavloff added a comment to D69272: Enable '#pragma STDC FENV_ACCESS' in frontend.

Try to organize replies for better references.

Oct 22 2019, 12:30 AM · Restricted Project

Oct 21 2019

sepavloff created D69272: Enable '#pragma STDC FENV_ACCESS' in frontend.
Oct 21 2019, 10:55 AM · Restricted Project

Oct 10 2019

sepavloff committed rL374508: Request commit access for sepavloff.
Request commit access for sepavloff
Oct 10 2019, 9:00 PM

Oct 2 2019

sepavloff committed rG110a24fb44cf: Fix driver tests when `LLVM_ENABLE_PER_TARGET_RUNTIME_DIR` is `ON` (authored by sepavloff).
Fix driver tests when `LLVM_ENABLE_PER_TARGET_RUNTIME_DIR` is `ON`
Oct 2 2019, 9:52 PM
sepavloff committed rL373565: Fix driver tests when `LLVM_ENABLE_PER_TARGET_RUNTIME_DIR` is `ON`.
Fix driver tests when `LLVM_ENABLE_PER_TARGET_RUNTIME_DIR` is `ON`
Oct 2 2019, 9:52 PM
sepavloff closed D66981: Fix driver tests when `LLVM_ENABLE_PER_TARGET_RUNTIME_DIR` is `ON`.
Oct 2 2019, 9:52 PM · Restricted Project, Restricted Project

Sep 28 2019

sepavloff committed rG4bc056271992: Driver tests: set `--sysroot=""` to support clang with `DEFAULT_SYSROOT` (authored by sepavloff).
Driver tests: set `--sysroot=""` to support clang with `DEFAULT_SYSROOT`
Sep 28 2019, 5:20 AM
sepavloff committed rL373147: Driver tests: set `--sysroot=""` to support clang with `DEFAULT_SYSROOT`.
Driver tests: set `--sysroot=""` to support clang with `DEFAULT_SYSROOT`
Sep 28 2019, 5:20 AM
sepavloff closed D66834: Driver tests: set `--sysroot=""` to support clang with `DEFAULT_SYSROOT`.
Sep 28 2019, 5:20 AM · Restricted Project, Restricted Project