[PATCH] D109621: [clang] [Driver] Fall back to default.cfg when calling clang w/o prefix

2022-09-19 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff added inline comments. Comment at: clang/docs/UsersManual.rst:915 +in the directory where Clang resides. If Clang is started via an executable +without target prefix, Clang will use ``default.cfg`` instead. What about using default config based on dri

[PATCH] D109621: [clang] [Driver] Fall back to default.cfg when calling clang w/o prefix

2022-09-19 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff added a comment. In D109621#3791511 , @mstorsjo wrote: > On this topic, it would be great if we could pick up a per-target default > config file too, if clang is invoked with `clang -target `. Currently > this is done automatically if clang is

[PATCH] D134208: [clang] [Driver] Do not transform explicit --config filename

2022-09-19 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff accepted this revision. sepavloff added a comment. LGTM. Thanks! CHANGES SINCE LAST ACTION https://reviews.llvm.org/D134208/new/ https://reviews.llvm.org/D134208 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.

[PATCH] D134270: [clang] [Driver] Support multiple configuration files

2022-09-20 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff added a comment. What about the case, when executable file has a target prefix (so implicit config file may be used) and the option `--config` is specified in command line? Now this case becomes possible and we should either reject it (because explicit config files have precedence) or

[PATCH] D134270: [clang] [Driver] Support multiple configuration files

2022-09-21 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff added inline comments. Comment at: clang/lib/Driver/Driver.cpp:1061 return false; + if (ClangNameParts.TargetPrefix.empty()) +return false; Does it mean that executable without prefix won't load implicit config file? For example, execution of

[PATCH] D134270: [clang] [Driver] Support multiple configuration files

2022-09-21 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff accepted this revision. sepavloff added a comment. This revision is now accepted and ready to land. LGTM. Thanks! CHANGES SINCE LAST ACTION https://reviews.llvm.org/D134270/new/ https://reviews.llvm.org/D134270 ___ cfe-commits mailing li

[PATCH] D132379: [Support] Class for response file expansion

2022-09-23 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff updated this revision to Diff 462528. sepavloff added a comment. Address reviewer's notes - Pass BumpPtrAllocator instead of StringSaver, - Use setter to specify file system object. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D132379/new

[PATCH] D132379: [Support] Class for response file expansion

2022-09-23 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff added inline comments. Comment at: llvm/include/llvm/Support/CommandLine.h:2098 +public: + ExpansionContext(StringSaver &S, TokenizerCallback T, + llvm::vfs::FileSystem *FS = nullptr); rnk wrote: > StringSaver is a stateless class tha

[PATCH] D134337: [clang] [Driver] More flexible rules for loading default configs (WIP)

2022-09-25 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff added a comment. I would propose to slightly modify the config file search algorithm. For the tool named as `x86_64-pc-linux-gnu-clang`, the existing algorithm would search for the files: - `i386-clang.cfg` - `i386.cfg` - `x86_64-clang.cfg` - `x86_64.cfg` We could modify this algorit

[PATCH] D134337: [clang] [Driver] More flexible rules for loading default configs (WIP)

2022-09-26 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff added a comment. In D134337#3813798 , @mgorny wrote: > In D134337#3813779 , @sepavloff > wrote: > >> First clang tries to find `x86_64-pc-linux-gnu-clang.cfg`. Just tool name >> with added suffix `cfg`

[PATCH] D134337: [clang] [Driver] More flexible rules for loading default configs (WIP)

2022-09-27 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff added a comment. In D134337#3815705 , @MaskRay wrote: > In D134337#3815412 , @mgorny wrote: > >> In D134337#3815339 , @sepavloff >> wrote: >> >>> In D134337#380

[PATCH] D134337: [clang] [Driver] More flexible rules for loading default configs (WIP)

2022-09-27 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff added a comment. In D134337#3817878 , @mgorny wrote: > Ok, how about this variant? I think it's the simplest I can come up with that > roughly matches the old behavior and adds what's necessary for the new. > > The algorithm is to use: > > 1. `

[PATCH] D132379: [Support] Class for response file expansion

2022-09-27 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff added a comment. Thanks! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D132379/new/ https://reviews.llvm.org/D132379 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.or

[PATCH] D132379: [Support] Class for response file expansion

2022-09-27 Thread Serge Pavlov via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG6e491c48d6b9: [Support] Class for response file expansion (NFC) (authored by sepavloff). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D132379/new/ https://r

[PATCH] D134337: [clang] [Driver] More flexible rules for loading default configs

2022-09-28 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff added inline comments. Comment at: clang/docs/ReleaseNotes.rst:236-239 +- Clang now supports loading multiple configuration files. The files from + default configuration paths are loaded first, unless ``--no-default-config`` + option is used. All files explicitly spec

[PATCH] D134337: [clang] [Driver] More flexible rules for loading default configs

2022-09-28 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff added inline comments. Comment at: clang/docs/ReleaseNotes.rst:236-239 +- Clang now supports loading multiple configuration files. The files from + default configuration paths are loaded first, unless ``--no-default-config`` + option is used. All files explicitly spec

[PATCH] D134337: [clang] [Driver] More flexible rules for loading default configs

2022-09-28 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff added inline comments. Comment at: clang/lib/Driver/Driver.cpp:1098 + // Try loading separate config for the target (variants 3. and 4.) + CfgFileName = RealTriple.str() + ".cfg"; + if (searchForFile(CfgFilePath, CfgFileSearchDirs, CfgFileName, getVFS()) && -

[PATCH] D134337: [clang] [Driver] More flexible rules for loading default configs

2022-09-28 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff added inline comments. Comment at: clang/lib/Driver/Driver.cpp:1098 + // Try loading separate config for the target (variants 3. and 4.) + CfgFileName = RealTriple.str() + ".cfg"; + if (searchForFile(CfgFilePath, CfgFileSearchDirs, CfgFileName, getVFS()) && -

[PATCH] D134337: [clang] [Driver] More flexible rules for loading default configs

2022-09-28 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff added inline comments. Comment at: clang/test/Driver/config-file3.c:27 -//--- Invocation qqq-clang-g++ tries to find config file qqq-clang-g++.cfg first. +//--- Invocation x86_64-unknown-linux-gnu-clang-g++ tries x86_64-unknown-linux-gnu-clang++.cfg first. // -

[PATCH] D134337: [clang] [Driver] More flexible rules for loading default configs

2022-09-28 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff added inline comments. Comment at: clang/test/Driver/config-file3.c:27 -//--- Invocation qqq-clang-g++ tries to find config file qqq-clang-g++.cfg first. +//--- Invocation x86_64-unknown-linux-gnu-clang-g++ tries x86_64-unknown-linux-gnu-clang++.cfg first. // -

[PATCH] D134337: [clang] [Driver] More flexible rules for loading default configs

2022-09-28 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff added inline comments. Comment at: clang/test/Driver/config-file3.c:27 -//--- Invocation qqq-clang-g++ tries to find config file qqq-clang-g++.cfg first. +//--- Invocation x86_64-unknown-linux-gnu-clang-g++ tries x86_64-unknown-linux-gnu-clang++.cfg first. // -

[PATCH] D134337: [clang] [Driver] More flexible rules for loading default configs

2022-09-29 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff accepted this revision. sepavloff added a comment. LGTM. Thanks! CHANGES SINCE LAST ACTION https://reviews.llvm.org/D134337/new/ https://reviews.llvm.org/D134337 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.

[PATCH] D134905: [clang] [Driver] Disable default configs via envvar during testing

2022-09-29 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff added a comment. A more flexible way is to implement support for environment variable like `CL` and `_CL` (https://learn.microsoft.com/en-us/cpp/build/reference/cl-environment-variables?view=msvc-170 ). They could be used to deliver `--no-default-config` and would have wide usage tha

[PATCH] D135439: Keep configuration file search directories in ExpansionContext. NFC

2022-10-07 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff created this revision. sepavloff added reviewers: MaskRay, mgorny. Herald added subscribers: StephenFan, hiraditya. Herald added a project: All. sepavloff requested review of this revision. Herald added projects: clang, LLVM. Herald added a subscriber: llvm-commits. Class ExpansionContex

[PATCH] D135439: Keep configuration file search directories in ExpansionContext. NFC

2022-10-17 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff updated this revision to Diff 468137. sepavloff added a comment. Change parameter type of findConfigFile, rebased Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D135439/new/ https://reviews.llvm.org/D135439 Files: clang/include/clang/Dri

[PATCH] D135439: Keep configuration file search directories in ExpansionContext. NFC

2022-10-17 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff added inline comments. Comment at: llvm/include/llvm/Support/CommandLine.h:2138 + /// directories specified by SearchDirs field. + bool findConfigFile(StringRef FileName, std::string &FilePath); + mgorny wrote: > I'm sorry if I'm missing something obv

[PATCH] D135439: Keep configuration file search directories in ExpansionContext. NFC

2022-10-17 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff added a comment. Thanks! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D135439/new/ https://reviews.llvm.org/D135439 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.or

[PATCH] D136090: Handle errors in expansion of response files

2022-10-17 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff created this revision. sepavloff added reviewers: kadircet, mgorny, MaskRay, smeenai. Herald added subscribers: StephenFan, hiraditya. Herald added a reviewer: awarzynski. Herald added projects: Flang, All. sepavloff requested review of this revision. Herald added subscribers: llvm-commit

[PATCH] D135439: Keep configuration file search directories in ExpansionContext. NFC

2022-10-17 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff added a comment. In D135439#3864165 , @MaskRay wrote: > I am not familiar with `ExpansionContext`. Is there any behavior difference > which can be demonstrated by a test? This is an NFC test, it does not change behavior. However moving these

[PATCH] D134859: [clang][Interp] Implement basic support for floating point values

2022-12-19 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff accepted this revision. sepavloff added a comment. This revision is now accepted and ready to land. LGTM. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D134859/new/ https://reviews.llvm.org/D134859 ___ cfe-commits mailing list cfe-co

[PATCH] D112932: Use llvm.is_fpclass to implement FP classification functions

2022-12-19 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff updated this revision to Diff 483994. sepavloff added a comment. Remove __builtin_isfpclass Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D112932/new/ https://reviews.llvm.org/D112932 Files: clang/include/clang/Basic/Builtins.def clan

[PATCH] D140294: clang: Replace implementation of __builtin_isnormal

2022-12-20 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff added a comment. 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

[PATCH] D140294: clang: Replace implementation of __builtin_isnormal

2022-12-25 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff added a comment. 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_isnorm

[PATCH] D112932: Use llvm.is_fpclass to implement FP classification functions

2022-12-26 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff updated this revision to Diff 485307. sepavloff added a comment. Update patch - Rebase, - Add test that checks inlining. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D112932/new/ https://reviews.llvm.org/D112932 Files: clang/include/c

[PATCH] D112932: Use llvm.is_fpclass to implement FP classification functions

2023-01-11 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff updated this revision to Diff 488159. sepavloff added a comment. Remove support of __builtin_is{subnormal,zero,signaling}, rebased Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D112932/new/ https://reviews.llvm.org/D112932 Files: clang/

[PATCH] D136090: Handle errors in expansion of response files

2022-11-03 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff added a comment. Thank you for reporting the issue. It was fixed in fdab9f1203ee . Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D136090/new/ https://reviews.llvm.org/D1

[Diffusion] rGfdab9f1203ee: [Clang] Check for response file existence prior to check for recursion

2022-11-04 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff added a comment. Fixed in: https://reviews.llvm.org/rGc14df228ff3c. BRANCHES main Users: sepavloff (Author) https://reviews.llvm.org/rGfdab9f1203ee ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/

[PATCH] D134859: [clang][Interp] Implement basic support for floating point values

2022-11-05 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff added inline comments. Comment at: clang/lib/AST/Interp/Opcodes.td:502 + let Types = [AluTypeClass]; + let Args = [ArgFltSemantics]; + let HasGroup = 1; tbaeder wrote: > jcranmer-intel wrote: > > Integer-to-floating point conversion is dependent on r

[PATCH] D137719: [clang] Missed rounding mode use in constant evaluation

2022-11-09 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff created this revision. sepavloff added reviewers: rjmccall, efriedma, aaron.ballman. Herald added a project: All. sepavloff requested review of this revision. Herald added a project: clang. Integer-to-float conversion was handled in constant evaluator with default rounding mode. This cha

[PATCH] D134859: [clang][Interp] Implement basic support for floating point values

2022-11-09 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff added a comment. Patch https://reviews.llvm.org/D137719 fixed int->float conversion. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D134859/new/ https://reviews.llvm.org/D134859 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D137719: [clang] Missed rounding mode use in constant evaluation

2022-11-09 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff updated this revision to Diff 474303. sepavloff added a comment. Removed unused parateters from HandleIntToFloatCast Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D137719/new/ https://reviews.llvm.org/D137719 Files: clang/lib/AST/ExprCo

[PATCH] D137719: [clang] Missed rounding mode use in constant evaluation

2022-11-09 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff updated this revision to Diff 474304. sepavloff added a comment. Remove accidentally added file Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D137719/new/ https://reviews.llvm.org/D137719 Files: clang/lib/AST/ExprConstant.cpp clang/te

[PATCH] D136354: [Driver] Enable nested configuration files

2022-11-09 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff updated this revision to Diff 474455. sepavloff added a comment. Rebase patch Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D136354/new/ https://reviews.llvm.org/D136354 Files: clang/docs/UsersManual.rst clang/include/clang/Basic/Diag

[PATCH] D137719: [clang] Missed rounding mode use in constant evaluation

2022-11-14 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff added a comment. Ping. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D137719/new/ https://reviews.llvm.org/D137719 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/

[PATCH] D136354: [Driver] Enable nested configuration files

2022-11-14 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff added a comment. Ping. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D136354/new/ https://reviews.llvm.org/D136354 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/

[PATCH] D136354: [Driver] Enable nested configuration files

2022-11-14 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff updated this revision to Diff 475349. sepavloff added a comment. Removed support of `--config file`. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D136354/new/ https://reviews.llvm.org/D136354 Files: clang/docs/UsersManual.rst clang/i

[PATCH] D136354: [Driver] Enable nested configuration files

2022-11-15 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff updated this revision to Diff 475400. sepavloff added a comment. Missed changes in tests Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D136354/new/ https://reviews.llvm.org/D136354 Files: clang/docs/UsersManual.rst clang/include/clang

[PATCH] D136354: [Driver] Enable nested configuration files

2022-11-15 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff added a comment. Thanks! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D136354/new/ https://reviews.llvm.org/D136354 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.or

[PATCH] D136354: [Driver] Enable nested configuration files

2022-11-15 Thread Serge Pavlov via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG1f67dc8b7c22: [Driver] Enable nested configuration files (authored by sepavloff). Changed prior to commit: https://reviews.llvm.org/D136354?vs=475400&id=475685#toc Repository: rG LLVM Github Monorepo

[PATCH] D137719: [clang] Missed rounding mode use in constant evaluation

2022-11-16 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff added a comment. Thanks! Comment at: clang/test/AST/const-fpfeatures.c:37 float _Complex C1d = C0; // CHECK: @C1d = {{.*}} { float, float } { float 1.00e+00, float 1.00e+00 } aaron.ballman wrote: > Should we add a test without the `-fexperi

[PATCH] D137719: [clang] Missed rounding mode use in constant evaluation

2022-11-16 Thread Serge Pavlov via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG1ddd5863088b: [clang] Missed rounding mode use in constant evaluation (authored by sepavloff). Changed prior to commit: https://reviews.llvm.org/D137719?vs=474304&id=475999#toc Repository: rG LLVM Gi

[PATCH] D141765: [FPEnv] Fix complex operations in strictfp mode

2023-01-24 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff added a comment. Thanks! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D141765/new/ https://reviews.llvm.org/D141765 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.or

[PATCH] D141765: [FPEnv] Fix complex operations in strictfp mode

2023-01-24 Thread Serge Pavlov via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rGd595b59d5c9c: [FPEnv] Fix complex operations in strictfp mode (authored by sepavloff). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACT

[PATCH] D133325: [Driver] Allow search of included response files as configuration files

2023-02-02 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff abandoned this revision. sepavloff added a comment. The alternative solution in D136354 was implemented. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D133325/new/ https://reviews.llvm.org/D133325 _

[PATCH] D143241: [Clang] Reset FP options before function instantiations

2023-02-02 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff created this revision. sepavloff added reviewers: rsmith, rjmccall, aaron.ballman, efriedma. Herald added a project: All. sepavloff requested review of this revision. Herald added a project: clang. Previously function template instantiations occurred with FP options that were in effect a

[PATCH] D141765: [FPEnv] Fix complex operations in strictfp mode

2023-01-14 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff created this revision. sepavloff added reviewers: rjmccall, kpn, aaron.ballman. Herald added a project: All. sepavloff requested review of this revision. Herald added a project: clang. Operations on floating-point complex data had incorrect FP attributes in strictfp mode, because IRBuild

[PATCH] D140377: [clang][Interp] Compound assign operators for FP values

2023-01-17 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff accepted this revision. sepavloff added a comment. This revision is now accepted and ready to land. LGTM. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D140377/new/ https://reviews.llvm.org/D140377

[PATCH] D142001: [clang] Use FP options from AST for emitting code for casts

2023-01-18 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff created this revision. sepavloff added reviewers: rjmccall, kpn, aaron.ballman. Herald added a subscriber: pengfei. Herald added a project: All. sepavloff requested review of this revision. Herald added a project: clang. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D14

[PATCH] D141765: [FPEnv] Fix complex operations in strictfp mode

2023-01-18 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff updated this revision to Diff 490088. sepavloff added a comment. Updated comment in test as proposed by Kevin Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D141765/new/ https://reviews.llvm.org/D141765 Files: clang/lib/CodeGen/CGExprCom

[PATCH] D141765: [FPEnv] Fix complex operations in strictfp mode

2023-01-18 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff added a comment. In D141765#4059214 , @kpn wrote: > Are we testing _Complex multiply or subtraction anywhere? I have a vague > memory of multiply not working correctly. There is a test `clang/test/CodeGen/complex-math.c` that checks complex o

[PATCH] D142001: [clang] Use FP options from AST for emitting code for casts

2023-01-19 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff updated this revision to Diff 490504. sepavloff added a comment. Use --implicit-check-not in tests Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D142001/new/ https://reviews.llvm.org/D142001 Files: clang/lib/CodeGen/CGExprScalar.cpp c

[PATCH] D142001: [clang] Use FP options from AST for emitting code for casts

2023-01-20 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff added a comment. Thanks! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D142001/new/ https://reviews.llvm.org/D142001 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.or

[PATCH] D142001: [clang] Use FP options from AST for emitting code for casts

2023-01-20 Thread Serge Pavlov via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG65cf77d218cf: [clang] Use FP options from AST for emitting code for casts (authored by sepavloff). Repository: rG LLVM Github Monorepo CHANGES SI

[PATCH] D141765: [FPEnv] Fix complex operations in strictfp mode

2023-01-23 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff updated this revision to Diff 491397. sepavloff added a comment. Use --implicit-check-not in test Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D141765/new/ https://reviews.llvm.org/D141765 Files: clang/lib/CodeGen/CGExprComplex.cpp c

[PATCH] D126364: Fix interaction of pragma FENV_ACCESS with other pragmas

2022-06-17 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff updated this revision to Diff 437807. sepavloff added a comment. Remade the patch according to the review notes Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D126364/new/ https://reviews.llvm.org/D126364 Files: clang/include/clang/Basic

[PATCH] D126364: Fix interaction of pragma FENV_ACCESS with other pragmas

2022-06-17 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff added inline comments. Comment at: clang/include/clang/Basic/LangOptions.h:622 setFPContractMode(LangOptions::FPM_Off); setRoundingMode(static_cast(LangOptions::FPR_ToNearest)); setFPExceptionMode(LangOptions::FPE_Ignore); efriedma wrote:

[PATCH] D126364: Fix interaction of pragma FENV_ACCESS with other pragmas

2022-06-22 Thread Serge Pavlov via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG706e89db97d3: Fix interaction of pragma FENV_ACCESS with other pragmas (authored by sepavloff). Repository: rG LLVM Github Monorepo CHANGES SINCE

[PATCH] D126364: Fix interaction of pragma FENV_ACCESS with other pragmas

2022-05-25 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff created this revision. sepavloff added reviewers: aaron.ballman, andrew.w.kaylor, rjmccall, efriedma, kpn. Herald added a project: All. sepavloff requested review of this revision. Herald added a project: clang. Previously `#pragma STDC FENV_ACCESS ON` always set dynamic rounding mode a

[PATCH] D126364: Fix interaction of pragma FENV_ACCESS with other pragmas

2022-05-26 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff added a comment. In D126364#3537964 , @efriedma wrote: > Could you lay out the expected interaction between "STDC FENV_ACCESS", "clang > fp exceptions", "float_control", and "fenv_access"? If there's some way to > map everything to "#pragma c

[PATCH] D126364: Fix interaction of pragma FENV_ACCESS with other pragmas

2022-05-27 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff added a comment. In D126364#3540673 , @efriedma wrote: > For FENV_ROUND, I think we should try to stick to the standard as closely as > possible in Sema; since the standard models FENV_ROUND as a separate state, > Sema should also model it as

[PATCH] D126364: Fix interaction of pragma FENV_ACCESS with other pragmas

2022-05-30 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff added a comment. In D126364#3542917 , @efriedma wrote: > I mean that ActOnPragmaFEnvAccess shouldn't call > hasRoundingModeOverride()/setRoundingModeOverride(), and setRoundingMode > shouldn't call getAllowFEnvAccess(). setRoundingMode defini

[PATCH] D126364: Fix interaction of pragma FENV_ACCESS with other pragmas

2022-05-30 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff added a comment. In D126364#3546173 , @efriedma wrote: >> setRoundingMode definitely should not call getAllowFEnvAccess() and it does >> not > > Yes, it does? > > // C2x: 7.6.2p3 If the FE_DYNAMIC mode is specified and FENV_ACCESS is > "off

[PATCH] D126364: Fix interaction of pragma FENV_ACCESS with other pragmas

2022-06-02 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff updated this revision to Diff 433963. sepavloff added a comment. Update the patch - Add a flag to reflect rounding mode change by FENV_ROUND, - Keep dynamic mode in AST and change it later in CodeGen, - Add new tests. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D126364: Fix interaction of pragma FENV_ACCESS with other pragmas

2022-06-02 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff added a comment. In D126364#3548815 , @efriedma wrote: > The way I see it, there are two possibilities here: > > 1. In Sema, we have two rounding modes that correspond to FE_DYNAMIC: > llvm::RoundingMode::Dynamic, and llvm::RoundingMode::Neares

[PATCH] D126364: Fix interaction of pragma FENV_ACCESS with other pragmas

2022-06-06 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff added a comment. In D126364#3556943 , @efriedma wrote: > Given we have getEffectiveRoundingMode(), I think the calls to > setRoundingModeOverride shouldn't be necessary? And if we drop those calls, > we can also drop the IsRoundingModeSet var

[PATCH] D126364: Fix interaction of pragma FENV_ACCESS with other pragmas

2022-06-06 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff added a comment. In D126364#3560877 , @efriedma wrote: > Shouldn't the rounding mode be FE_DYNAMIC by default? According to the standard it must be FE_TONEAREST: F.8.3p1: At program startup the dynamic floating-point environment is initial

[PATCH] D126364: Fix interaction of pragma FENV_ACCESS with other pragmas

2022-06-06 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff added a comment. In D126364#3560997 , @efriedma wrote: > In D126364#3560984 , @sepavloff > wrote: > >> In D126364#3560877 , @efriedma >> wrote: >> >>> Shouldn'

[PATCH] D126364: Fix interaction of pragma FENV_ACCESS with other pragmas

2022-06-06 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff added inline comments. Comment at: clang/include/clang/Basic/LangOptions.h:622 setFPContractMode(LangOptions::FPM_Off); setRoundingMode(static_cast(LangOptions::FPR_ToNearest)); setFPExceptionMode(LangOptions::FPE_Ignore); efriedma wrote:

[PATCH] D126364: Fix interaction of pragma FENV_ACCESS with other pragmas

2022-06-07 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff added inline comments. Comment at: clang/include/clang/Basic/LangOptions.h:622 setFPContractMode(LangOptions::FPM_Off); setRoundingMode(static_cast(LangOptions::FPR_ToNearest)); setFPExceptionMode(LangOptions::FPE_Ignore); efriedma wrote:

[PATCH] D126364: Fix interaction of pragma FENV_ACCESS with other pragmas

2022-06-07 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff added inline comments. Comment at: clang/include/clang/Basic/LangOptions.h:622 setFPContractMode(LangOptions::FPM_Off); setRoundingMode(static_cast(LangOptions::FPR_ToNearest)); setFPExceptionMode(LangOptions::FPE_Ignore); efriedma wrote:

[PATCH] D126364: Fix interaction of pragma FENV_ACCESS with other pragmas

2022-06-08 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff added inline comments. Comment at: clang/include/clang/Basic/LangOptions.h:622 setFPContractMode(LangOptions::FPM_Off); setRoundingMode(static_cast(LangOptions::FPR_ToNearest)); setFPExceptionMode(LangOptions::FPE_Ignore); efriedma wrote:

[PATCH] D156989: FloatingPointMode: Use -1 for "Dynamic"

2023-09-29 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff added a comment. `Dynamic` cannot have value `-1`, its value must fits 3 bits. Some targets encode rounding mode in instructions, RISCV is an example. It allows five "real" rounding modes, enlisted now in `RoundingMode` to be specified in a special field or FP instruction. This field

[PATCH] D158158: [clang] Set FP options in Sema when instantiating CompoundStmt

2023-08-17 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff created this revision. sepavloff added reviewers: rjmccall, aaron.ballman, efriedma, zahiraam. Herald added a project: All. sepavloff requested review of this revision. Herald added a project: clang. When an expression is instantiated, TreeTransform skips ImplicitCastExpr nodes, assuming

[PATCH] D158158: [clang] Set FP options in Sema when instantiating CompoundStmt

2023-08-20 Thread Serge Pavlov via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG0baf85c33109: [clang] Set FP options in Sema when instantiating CompoundStmt (authored by sepavloff). Changed prior to commit: https://reviews.llv

[PATCH] D156989: FloatingPointMode: Use -1 for "Dynamic"

2023-08-03 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff added a comment. Rounding mode is presented in FPOptions with 3 bits, so there is only 8 values available for particular modes. 5 of them, which are specified in IEEE-754, are listed in `RoundingMode`. `Dynamic` (which is -1 in 3-bit numbers) is not a real rounding mode, it represents

[PATCH] D156989: FloatingPointMode: Use -1 for "Dynamic"

2023-08-03 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff added a comment. In D156989#4558134 , @arsenm wrote: > In D156989#4558133 , @sepavloff > wrote: > >> Rounding mode is presented in FPOptions with 3 bits, so there is only 8 >> values available for part

[PATCH] D157911: clang: Add __builtin_exp10* and use new llvm.exp10 intrinsic

2023-09-09 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff accepted this revision. sepavloff added a comment. This revision is now accepted and ready to land. LGTM. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D157911/new/ https://reviews.llvm.org/D157911 ___ cfe-commits mailing list cfe-co

[PATCH] D154359: [clang] Reset FP options before template instantiation

2023-07-03 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff created this revision. sepavloff added reviewers: rsmith, rjmccall, aaron.ballman, efriedma. Herald added a project: All. sepavloff requested review of this revision. Herald added a project: clang. AST nodes that may depend on FP options keep them as a difference relative to the options

[PATCH] D143241: [Clang] Reset FP options before function instantiations

2023-07-06 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff added a comment. In D143241#4475741 , @Jake-Egan wrote: > Hi, the following assertion is getting tripped on AIX: > > Assertion failed: *FpPragmaCurrentValue == > SemaObj->FpPragmaStack.DefaultValue && "Expected a default pragma > float_contr

[PATCH] D153339: [clang] Support vectors in __builtin_isfpclass

2023-07-10 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff added a comment. Ping. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D153339/new/ https://reviews.llvm.org/D153339 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/

[PATCH] D112932: Use llvm.is_fpclass to implement FP classification functions

2023-07-11 Thread Serge Pavlov via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG7d6c2e18114d: [clang] Use llvm.is_fpclass to implement FP classification functions (authored by sepavloff). Changed prior to commit: https://revie

[PATCH] D154359: [clang] Reset FP options before template instantiation

2023-07-12 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff updated this revision to Diff 539597. sepavloff added a comment. Fix test Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D154359/new/ https://reviews.llvm.org/D154359 Files: clang/lib/Sema/SemaTemplateInstantiateDecl.cpp clang/test/Cod

[PATCH] D154359: [clang] Reset FP options before template instantiation

2023-07-12 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff added inline comments. Comment at: clang/test/CodeGen/fp-template.cpp:28 +// CHECK-LABEL: define {{.*}} float @_ZN7PR6354211stable_sortIiEEffT_( +// CHECK: fadd float + zahiraam wrote: > Shouldn't we be expecting a constraint add here? Yes, you

[PATCH] D154359: [clang] Reset FP options before template instantiation

2023-07-12 Thread Serge Pavlov via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGfde5924dcc69: [clang] Reset FP options before template instantiation (authored by sepavloff). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D154359/new/ http

[PATCH] D155380: [clang] Fix delayed template parsing

2023-07-15 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff created this revision. sepavloff added reviewers: rsmith, rjmccall, aaron.ballman, efriedma, mgorny. Herald added a project: All. sepavloff requested review of this revision. Herald added a project: clang. Commit 98390ccb80569e8fbb20e6c996b4b8cff87fbec6

[PATCH] D155380: [clang] Fix delayed template parsing

2023-07-16 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff updated this revision to Diff 540764. sepavloff added a comment. Use calculated default FP options Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D155380/new/ https://reviews.llvm.org/D155380 Files: clang/include/clang/Sema/Sema.h clan

[PATCH] D155380: [clang] Fix delayed template parsing

2023-07-16 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff updated this revision to Diff 540861. sepavloff added a comment. Fix clang-format errors Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D155380/new/ https://reviews.llvm.org/D155380 Files: clang/include/clang/Sema/Sema.h clang/lib/Pars

[PATCH] D155380: [clang] Fix delayed template parsing

2023-07-17 Thread Serge Pavlov via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGcc006acdd6d7: [clang] Fix delayed template parsing (authored by sepavloff). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D155380/new/ https://reviews.llvm.o

[PATCH] D153339: [clang] Support vectors in __builtin_isfpclass

2023-08-28 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff updated this revision to Diff 553908. sepavloff added a comment. Herald added a subscriber: sunshaoce. Use representation of logical vectors similar to OpenCL Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D153339/new/ https://reviews.llvm.

[PATCH] D153339: [clang] Support vectors in __builtin_isfpclass

2023-08-28 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff added a comment. In D153339#4489025 , @aaron.ballman wrote: > This seems reasonable to me, but I do wonder if changing the return type from > int to bool will cause surprises for anyone. I see why it's done, but this > seems more like a C int

<    1   2   3   4   5   6   7   >