Page MenuHomePhabricator

mcberg2017 (Michael Berg)
User

Projects

User does not belong to any projects.

User Details

User Since
Jul 18 2017, 1:54 PM (142 w, 3 h)

Recent Activity

Fri, Mar 13

mcberg2017 added a comment to D74988: Propagate MIFlags in table gen.

Ping, 2nd time...

Fri, Mar 13, 3:40 PM · Restricted Project

Mar 4 2020

mcberg2017 added a comment to D74988: Propagate MIFlags in table gen.

Ping.

Mar 4 2020, 9:00 AM · Restricted Project

Feb 26 2020

mcberg2017 added a comment to D74851: [x86] use instruction-level fast-math-flags to drive MachineCombiner.

All in all LGTM, will check back in bit to see what others have to say.

Feb 26 2020, 9:10 AM · Restricted Project

Feb 21 2020

mcberg2017 created D74988: Propagate MIFlags in table gen.
Feb 21 2020, 2:57 PM · Restricted Project

Jan 16 2020

mcberg2017 added a comment to D72675: [Clang][Driver] Fix -ffast-math/-ffp-contract interaction.

I should do the other DAG combiner fma changes after this is wrapped up.

Jan 16 2020, 11:01 AM · Restricted Project

Jan 15 2020

mcberg2017 added a comment to D72675: [Clang][Driver] Fix -ffast-math/-ffp-contract interaction.

We crossed that bridge internally at Apple a while ago, meaning I have some code debt for cleaning up open source for fma formation that uses contract and reassoc differently than we do today, both together and separately, case by case.

Jan 15 2020, 5:47 PM · Restricted Project

Jan 14 2020

mcberg2017 added a reviewer for D72675: [Clang][Driver] Fix -ffast-math/-ffp-contract interaction: hfinkel.
Jan 14 2020, 5:08 PM · Restricted Project
mcberg2017 accepted D72521: [InstCombine] reassociate fsub+fsub into fsub+fadd.

Looked at this internally for us and looks ok. LGTM.

Jan 14 2020, 12:50 PM · Restricted Project

Dec 19 2019

mcberg2017 added a comment to D71495: [SelectionDAG] Copy FP flags when visiting a binary instruction..

I like the notion of avoiding/reducing intersect context hits by placing it in the vector reduction scope (line 3128).

Dec 19 2019, 11:22 AM · Restricted Project
mcberg2017 added a comment to D71495: [SelectionDAG] Copy FP flags when visiting a binary instruction..

When I looked at this recently as well, it looked like intersect was were we lost our flags.

Dec 19 2019, 11:02 AM · Restricted Project

Nov 20 2019

mcberg2017 added a comment to D70488: [InstCombine] Infer fast math flags on fadd/fsub/fmul/fcmp.

For us this would be an impediment as we have math models that want ieee behavior while relaxing precision. Adding nnan or ninf would obstruct those choices.

Nov 20 2019, 11:28 AM · Restricted Project, Restricted Project

Nov 7 2019

mcberg2017 accepted D69720: [InstCombine] propagate fast-math-flags (FMF) to select when inverting fcmp+select.

It is a step in the right direction. I tried it out internally and its fine for us. We too have work to do wrt phi mapping in GiSel wrt flags. So initially, LGTM. You might want to see what others say and so leave it for bit...

Nov 7 2019, 4:55 PM · Restricted Project

Oct 14 2019

mcberg2017 committed rG5af0201c2a08: Add FMF to vector ops for phi (authored by mcberg2017).
Add FMF to vector ops for phi
Oct 14 2019, 10:44 AM
mcberg2017 committed rL374794: Add FMF to vector ops for phi.
Add FMF to vector ops for phi
Oct 14 2019, 10:43 AM
mcberg2017 closed D68748: Add FMF to vector ops for phi.
Oct 14 2019, 10:43 AM · Restricted Project

Oct 11 2019

mcberg2017 updated subscribers of D68748: Add FMF to vector ops for phi.
Oct 11 2019, 11:55 AM · Restricted Project

Oct 9 2019

mcberg2017 created D68748: Add FMF to vector ops for phi.
Oct 9 2019, 5:17 PM · Restricted Project

Sep 13 2019

mcberg2017 added a comment to D67564: [IR] allow fast-math-flags on phi of FP values.

WRT divergent phi FMF, if you wanted to be pessimistic you could do an intersection(and), doing an inclusion(or) might include too much. Either way behavior would change. The intersection already has other prior context in FMF.

Sep 13 2019, 2:59 PM · Restricted Project

Aug 22 2019

mcberg2017 added a comment to D61675: [WIP] Update IRBuilder::CreateFNeg(...) to return a UnaryOperator.

Follow on note from D66612, I am testing the rest of the Reassociate.cpp changes that were talked about there(+some tests as well). Cameron, do you want to incorporate those changes here?

Aug 22 2019, 6:57 PM · Restricted Project, Restricted Project
mcberg2017 accepted D66612: [Reassoc] Small fix to support unary FNeg in NegateValue(...).
Aug 22 2019, 3:25 PM · Restricted Project
mcberg2017 added a comment to D66612: [Reassoc] Small fix to support unary FNeg in NegateValue(...).

BTW, general comment: Many of the remaining BinaryOperator contexts in Reassociate.cpp will need re-examaination too as UnaryOperator may also be present in places where it currently is not.

Aug 22 2019, 1:05 PM · Restricted Project
mcberg2017 added a comment to D66612: [Reassoc] Small fix to support unary FNeg in NegateValue(...).

LGTM, but I will give Sanjay some time before moving forward.

Aug 22 2019, 12:43 PM · Restricted Project

Aug 20 2019

mcberg2017 added a comment to D61675: [WIP] Update IRBuilder::CreateFNeg(...) to return a UnaryOperator.

Cameron here is an example with the issue:

Aug 20 2019, 2:53 PM · Restricted Project, Restricted Project

Aug 19 2019

mcberg2017 added a comment to D61675: [WIP] Update IRBuilder::CreateFNeg(...) to return a UnaryOperator.

Just putting a place holder for NegateValue in Reassociate.cpp to be updated for both binary and unary context when examining the uses of the Value V. In fact the full file should be looked over for other cases as well. I tried out the current patch and we hit the first case pretty quickly internally.

Aug 19 2019, 2:46 PM · Restricted Project, Restricted Project
mcberg2017 added a comment to D65954: [Reassociate] try harder to convert negative FP constants to positive.

Just to close the loop, the issues I saw are internal manifested only, they do not port to other targets.

Aug 19 2019, 10:00 AM · Restricted Project

Aug 9 2019

mcberg2017 accepted D65954: [Reassociate] try harder to convert negative FP constants to positive.
Aug 9 2019, 11:42 AM · Restricted Project

Aug 8 2019

mcberg2017 added a comment to D65954: [Reassociate] try harder to convert negative FP constants to positive.

Tell you what, I don't want to hold up this patch. I will see if I can abstract a test example into common form for a public target with an example or two and send it to you offline.

Aug 8 2019, 1:53 PM · Restricted Project
mcberg2017 added a comment to D65954: [Reassociate] try harder to convert negative FP constants to positive.

We have some stir(some regressions - a few instructions here and there), however the change is overall beneficial for us.

Aug 8 2019, 12:11 PM · Restricted Project
mcberg2017 added a comment to D65954: [Reassociate] try harder to convert negative FP constants to positive.

I worked through some of the tests, but would like another set of eyes to verify. Doing a quick internal validation with this for regressions.

Aug 8 2019, 10:55 AM · Restricted Project
mcberg2017 added inline comments to D65954: [Reassociate] try harder to convert negative FP constants to positive.
Aug 8 2019, 9:09 AM · Restricted Project

Jul 31 2019

mcberg2017 committed rG005d705d4392: Migrate some more fadd and fsub cases away from UnsafeFPMath control to utilize… (authored by mcberg2017).
Migrate some more fadd and fsub cases away from UnsafeFPMath control to utilize…
Jul 31 2019, 3:03 PM
mcberg2017 committed rL367486: Migrate some more fadd and fsub cases away from UnsafeFPMath control to utilize….
Migrate some more fadd and fsub cases away from UnsafeFPMath control to utilize…
Jul 31 2019, 3:01 PM
mcberg2017 closed D65170: Migrate some more fadd and fsub cases away from UnsafeFPMath control to utilize NoSignedZerosFPMath options control.
Jul 31 2019, 3:01 PM · Restricted Project
mcberg2017 updated the diff for D65170: Migrate some more fadd and fsub cases away from UnsafeFPMath control to utilize NoSignedZerosFPMath options control.

added a TODO comment for machine combines in test/CodeGen/AArch64/fadd-combines.ll,
test/CodeGen/PowerPC/fma-mutate.ll, test/CodeGen/PowerPC/qpx-recipest.ll, test/CodeGen/PowerPC/recipest.ll, test/CodeGen/X86/fp-fold.ll now have just standard CHECK lines. The fmf contract flag was
removed from test/CodeGen/X86/dagcombine-unsafe-math.ll and test/CodeGen/X86/fp-fast.ll.

Jul 31 2019, 11:01 AM · Restricted Project

Jul 30 2019

mcberg2017 updated the diff for D65170: Migrate some more fadd and fsub cases away from UnsafeFPMath control to utilize NoSignedZerosFPMath options control.

Note: test/CodeGen/AMDGPU/fneg-combines.ll needs rearchitecting, so i left it in options flag form, test/CodeGen/PowerPC/fmf-propagation.ll has portions that can be removed once we stop using the options flags and so i am leaving it in its current form with mods until that happens. test/CodeGen/X86/fp-fast.ll uses a subset of fmf that equate to the options flag that were used (let me know if you just want to generalize to fast or smaller subset), all the others use either fast or context relevant fmf and have been converted to not use options flags. Have a look and see what needs editing, currently this all passes testing.

Jul 30 2019, 12:53 PM · Restricted Project

Jul 29 2019

mcberg2017 added a comment to D65170: Migrate some more fadd and fsub cases away from UnsafeFPMath control to utilize NoSignedZerosFPMath options control.

The new code is actually better by 1 instruction, we just never completed the full match on the test. In the old path we had -enable-no-signed-zeros-fp-math on but no way to reach it for the zero fold of the fadd via llc as the flags are all user controlled. This should not be a regression.

Jul 29 2019, 12:26 PM · Restricted Project
mcberg2017 added a comment to D65399: [InstCombine] canonicalize fneg before fmul/fdiv.

How about we add a TODO comment regarding Cameron's topic wrt? Would that be sufficient?

Jul 29 2019, 11:46 AM · Restricted Project
mcberg2017 accepted D65399: [InstCombine] canonicalize fneg before fmul/fdiv.

Turning off inst combining fneg opts does not make things better for us however. It seems to consistently cause additional regressions. We can live with the new change then.

Jul 29 2019, 11:37 AM · Restricted Project
mcberg2017 added a comment to D65399: [InstCombine] canonicalize fneg before fmul/fdiv.

General comment: For us internally at Apple this does cause regressions, its small but there. Mostly because fneg becomes a side effect for fp arithmetic ops for us. I would request a target info guard which we can turn off to avoid the drift. If not, this is small enough to live with,

Jul 29 2019, 10:45 AM · Restricted Project
mcberg2017 added inline comments to D65170: Migrate some more fadd and fsub cases away from UnsafeFPMath control to utilize NoSignedZerosFPMath options control.
Jul 29 2019, 10:32 AM · Restricted Project
mcberg2017 added inline comments to D65170: Migrate some more fadd and fsub cases away from UnsafeFPMath control to utilize NoSignedZerosFPMath options control.
Jul 29 2019, 9:51 AM · Restricted Project

Jul 24 2019

mcberg2017 updated the diff for D65170: Migrate some more fadd and fsub cases away from UnsafeFPMath control to utilize NoSignedZerosFPMath options control.

updated with one case...

Jul 24 2019, 12:47 PM · Restricted Project

Jul 23 2019

mcberg2017 added inline comments to D65170: Migrate some more fadd and fsub cases away from UnsafeFPMath control to utilize NoSignedZerosFPMath options control.
Jul 23 2019, 4:00 PM · Restricted Project
mcberg2017 created D65170: Migrate some more fadd and fsub cases away from UnsafeFPMath control to utilize NoSignedZerosFPMath options control.
Jul 23 2019, 3:57 PM · Restricted Project

Jul 15 2019

mcberg2017 added a comment to D64713: [InstCombine] X *fast (C ? 1.0 : 0.0) -> C ? X : 0.0.

Looks ok to me, but I would like some of the others to chime in first.

Jul 15 2019, 6:52 AM · Restricted Project
mcberg2017 added reviewers for D64713: [InstCombine] X *fast (C ? 1.0 : 0.0) -> C ? X : 0.0: spatel, arsenm.
Jul 15 2019, 6:09 AM · Restricted Project

Jul 10 2019

mcberg2017 committed rGf4572249d78d: Move three folds for FADD, FSUB and FMUL in the DAG combiner away from Unsafe… (authored by mcberg2017).
Move three folds for FADD, FSUB and FMUL in the DAG combiner away from Unsafe…
Jul 10 2019, 11:26 AM
mcberg2017 committed rL365679: Move three folds for FADD, FSUB and FMUL in the DAG combiner away from Unsafe….
Move three folds for FADD, FSUB and FMUL in the DAG combiner away from Unsafe…
Jul 10 2019, 11:23 AM
mcberg2017 closed D64450: Move three folds for FADD, FSUB and FMUL in the DAG combiner away from Unsafe to more aligned checks that reflect context.
Jul 10 2019, 11:23 AM · Restricted Project
mcberg2017 updated subscribers of D64450: Move three folds for FADD, FSUB and FMUL in the DAG combiner away from Unsafe to more aligned checks that reflect context.
Jul 10 2019, 11:23 AM · Restricted Project

Jul 9 2019

mcberg2017 created D64450: Move three folds for FADD, FSUB and FMUL in the DAG combiner away from Unsafe to more aligned checks that reflect context.
Jul 9 2019, 2:43 PM · Restricted Project

Jun 17 2019

mcberg2017 committed rGf9bff2a55e74: Propagate fmf in IRTranslate for fneg (authored by mcberg2017).
Propagate fmf in IRTranslate for fneg
Jun 17 2019, 4:18 PM
mcberg2017 committed rL363631: Propagate fmf in IRTranslate for fneg.
Propagate fmf in IRTranslate for fneg
Jun 17 2019, 4:17 PM
mcberg2017 closed D63458: Propagate fmf in IRTranslate for fneg.
Jun 17 2019, 4:17 PM · Restricted Project
mcberg2017 updated the diff for D63458: Propagate fmf in IRTranslate for fneg.

With cloned tests for FMF.

Jun 17 2019, 3:52 PM · Restricted Project
mcberg2017 updated the diff for D63458: Propagate fmf in IRTranslate for fneg.

There was an existing test, here it is with the modification for FMF

Jun 17 2019, 3:21 PM · Restricted Project
mcberg2017 created D63458: Propagate fmf in IRTranslate for fneg.
Jun 17 2019, 1:53 PM · Restricted Project
mcberg2017 accepted D63405: GlobalISel: Don't lose fneg flags when lowering to fsub.

Ok.

Jun 17 2019, 11:05 AM
mcberg2017 added a comment to D63405: GlobalISel: Don't lose fneg flags when lowering to fsub.

So I agree, but I think there should be a target specific combine with guards for Unsafe and nsz and this legalization case (for those who do not have it).

Jun 17 2019, 11:05 AM
mcberg2017 added a comment to D63405: GlobalISel: Don't lose fneg flags when lowering to fsub.

For your target. But as a catch all for legalization should do this.

Jun 17 2019, 10:58 AM
mcberg2017 added a comment to D63405: GlobalISel: Don't lose fneg flags when lowering to fsub.

We do this as a combine earlier in target specific code under this constraint. Matt, perhaps you just missing that combine in GlobalIsel?

Jun 17 2019, 10:56 AM
mcberg2017 added a comment to D63405: GlobalISel: Don't lose fneg flags when lowering to fsub.

I am saying you have it right Matt for using MI flags, but we should guard folding based on Unsafe or nsz in the Flags.

Jun 17 2019, 10:34 AM
mcberg2017 added a comment to D63405: GlobalISel: Don't lose fneg flags when lowering to fsub.

SDAG fails isNegatibleForFree if that constraint is not met and we do not translate.

Jun 17 2019, 10:29 AM
mcberg2017 added a comment to D63405: GlobalISel: Don't lose fneg flags when lowering to fsub.

Should we not also guard GlobslIsel translation in this case and avoid if not met?

Jun 17 2019, 10:21 AM
mcberg2017 added a comment to D63405: GlobalISel: Don't lose fneg flags when lowering to fsub.

Ok, with the constraint like in the DAG:

Jun 17 2019, 10:16 AM
mcberg2017 accepted D63405: GlobalISel: Don't lose fneg flags when lowering to fsub.

Seems reasonable to me.

Jun 17 2019, 8:25 AM

Jun 14 2019

mcberg2017 committed rGad6bb86b2dc0: adding more fmf propagation for selects plus updated tests (authored by mcberg2017).
adding more fmf propagation for selects plus updated tests
Jun 14 2019, 9:52 PM
mcberg2017 committed rL363484: adding more fmf propagation for selects plus updated tests.
adding more fmf propagation for selects plus updated tests
Jun 14 2019, 9:51 PM
mcberg2017 added a comment to rL363474: adding more fmf propagation for selects plus tests.

I was just about to change the test to assembler check test, not using the assert path...

Jun 14 2019, 8:55 PM
mcberg2017 committed rG69394bedc54c: adding more fmf propagation for selects plus tests (authored by mcberg2017).
adding more fmf propagation for selects plus tests
Jun 14 2019, 4:30 PM
mcberg2017 committed rL363474: adding more fmf propagation for selects plus tests.
adding more fmf propagation for selects plus tests
Jun 14 2019, 4:30 PM

Jun 3 2019

mcberg2017 committed rG6ff978ee0546: Propagate fmf for setcc in SDAG for select folds (authored by mcberg2017).
Propagate fmf for setcc in SDAG for select folds
Jun 3 2019, 2:51 PM
mcberg2017 committed rL362448: Propagate fmf for setcc in SDAG for select folds.
Propagate fmf for setcc in SDAG for select folds
Jun 3 2019, 2:51 PM
mcberg2017 committed rG0b7f98da6569: Propagate fmf for setcc/select folds (authored by mcberg2017).
Propagate fmf for setcc/select folds
Jun 3 2019, 12:11 PM
mcberg2017 committed rL362439: Propagate fmf for setcc/select folds.
Propagate fmf for setcc/select folds
Jun 3 2019, 12:09 PM
mcberg2017 closed D62552: Propagate fmf for setcc/select folds.
Jun 3 2019, 12:09 PM · Restricted Project

May 28 2019

mcberg2017 created D62552: Propagate fmf for setcc/select folds.
May 28 2019, 3:31 PM · Restricted Project

May 1 2019

mcberg2017 accepted D61331: [SelectionDAG] remove constant folding limitations based on FP exceptions.

LGTM, thanks Sanjay

May 1 2019, 1:32 PM · Restricted Project

Apr 30 2019

mcberg2017 added a reviewer for D61331: [SelectionDAG] remove constant folding limitations based on FP exceptions: scanon.
Apr 30 2019, 1:49 PM · Restricted Project

Apr 18 2019

mcberg2017 committed rGd573aa0156b6: [NFC] FMF propagation for GlobalIsel (authored by mcberg2017).
[NFC] FMF propagation for GlobalIsel
Apr 18 2019, 11:49 AM
mcberg2017 committed rL358702: [NFC] FMF propagation for GlobalIsel.
[NFC] FMF propagation for GlobalIsel
Apr 18 2019, 11:48 AM

Feb 6 2019

mcberg2017 committed rGf0d81a31b628: Move IR flag handling directly into builder calls for cases translated from… (authored by mcberg2017).
Move IR flag handling directly into builder calls for cases translated from…
Feb 6 2019, 11:58 AM
mcberg2017 committed rL353336: Move IR flag handling directly into builder calls for cases translated from….
Move IR flag handling directly into builder calls for cases translated from…
Feb 6 2019, 11:57 AM
mcberg2017 closed D57630: Move IR flag handling directly into builder calls for cases translated from Instructions in GlobalIsel.
Feb 6 2019, 11:57 AM · Restricted Project

Feb 5 2019

mcberg2017 updated the diff for D57630: Move IR flag handling directly into builder calls for cases translated from Instructions in GlobalIsel.

Migrated flag copy utility function to MachineInstr as a static function.

Feb 5 2019, 7:30 PM · Restricted Project

Feb 4 2019

mcberg2017 added a reviewer for D57630: Move IR flag handling directly into builder calls for cases translated from Instructions in GlobalIsel: volkan.
Feb 4 2019, 12:32 PM · Restricted Project

Feb 1 2019

mcberg2017 created D57630: Move IR flag handling directly into builder calls for cases translated from Instructions in GlobalIsel.
Feb 1 2019, 4:23 PM · Restricted Project

Jan 28 2019

mcberg2017 committed rL352396: [NFC] TLI query with default(on) behavior wrt DAG combines for fmin/fmax target….
[NFC] TLI query with default(on) behavior wrt DAG combines for fmin/fmax target…
Jan 28 2019, 10:04 AM

Dec 18 2018

mcberg2017 committed rL349514: Add FMF management to common fp intrinsics in GlobalIsel.
Add FMF management to common fp intrinsics in GlobalIsel
Dec 18 2018, 9:58 AM
mcberg2017 closed D55668: Add FMF management to common fp intrinsics in GlobalIsel.
Dec 18 2018, 9:58 AM

Dec 17 2018

mcberg2017 updated the diff for D55668: Add FMF management to common fp intrinsics in GlobalIsel.

Updated for posterity with the post review changes...

Dec 17 2018, 8:24 PM

Dec 16 2018

mcberg2017 added a reviewer for D55668: Add FMF management to common fp intrinsics in GlobalIsel: bogner.
Dec 16 2018, 12:06 PM
mcberg2017 updated the diff for D55668: Add FMF management to common fp intrinsics in GlobalIsel.

As requested, add one more component for copy ir flags in to this review

Dec 16 2018, 12:06 PM

Dec 13 2018

mcberg2017 retitled D55668: Add FMF management to common fp intrinsics in GlobalIsel from Add FMF management to common fp intrinsics to Add FMF management to common fp intrinsics in GlobalIsel.
Dec 13 2018, 1:02 PM
mcberg2017 created D55668: Add FMF management to common fp intrinsics in GlobalIsel.
Dec 13 2018, 1:01 PM

Oct 30 2018

mcberg2017 accepted D53874: [InstSimplify] fold 'fcmp nnan oge X, 0.0' when X is not negative.
Oct 30 2018, 1:17 PM
mcberg2017 added inline comments to D53874: [InstSimplify] fold 'fcmp nnan oge X, 0.0' when X is not negative.
Oct 30 2018, 1:17 PM
mcberg2017 added inline comments to D53874: [InstSimplify] fold 'fcmp nnan oge X, 0.0' when X is not negative.
Oct 30 2018, 11:21 AM

Sep 19 2018

mcberg2017 added a comment to rL342576: Copy utilities updated and added for MI flags.

The fixed test for WebAssembly is in rL342598.

Sep 19 2018, 3:59 PM
mcberg2017 committed rL342598: [WEB] add new flags to a DebugInfo lit test.
[WEB] add new flags to a DebugInfo lit test
Sep 19 2018, 3:58 PM