[llvm] r210414 - Do materialize for floating point

Alp Toker alp at nuanti.com
Sun Jun 8 09:15:44 PDT 2014


On 08/06/2014 18:04, Daniel Sanders wrote:
>
> Hi All,
>
> Reed, please don't re-commit until you understand and make the 
> requested change that the LGTM was conditional on. I'll add an 
> explanation to the review.
>
> I think Alp did the right thing by reverting the commit. He had 
> serious concerns about the patch, the review, and whether the process 
> had been followed. It's important to note that the commit message is 
> at least as important than the content. People should be able to read 
> the commit message and form opinions on what the commit does and why. 
> One important misconception I need to clear up here is that there's no 
> such thing as an 'authorized llvm Mips maintainer'. The developer 
> policy only distinguishes between those who maintain/contributed the 
> relevant code and those who don't/didn't. In this case, the question 
> of maintainer/contributor is irrelevant since everybody has the same 
> rights to 'make obvious changes' such as reverting an 'obviously bad 
> commit'.
>
> I forgot to make the LGTM conditional on the commit message correction 
> too, sorry. On the subject of the requested change that the LGTM was 
> predicated on: I have a lot of sympathy for the issues the 8 hour 
> timezone difference causes but they shouldn't be used as an excuse to 
> take shortcuts. I agree that understanding the request comes first, 
> and the delay wouldn't have hurt.
>
> Marking the review as accepted in Phabricator based on a conditional 
> LGTM is a compromise caused by the timezone difference and a 
> Phabricator update. It used to be the case that 'arc commit' would 
> allow committing unaccepted revisions and would close it. The commit 
> message didn't report a reviewer in this case. One of the Phabricator 
> updates changed this behaviour so that while you could commit an 
> unaccepted revision, the revision will not move to the closed state 
> and stays open. The workarounds to this is either:
>
> 1.the author accepts his own patch in the web interface (resulting in 
> the commit message reporting the author as the reviewer)
>
> 2.someone manually closes it
>
> 3.the reviewer accepts the revision in anticipation of the condition 
> being met
>
> 4.wait a day for the reviewer to mark the new revision accepted
>
> The third one seems to be the least bad in practice since everybody 
> forgets to manually close it and waiting 24 hours for someone to 
> simply click a button seems excessive. It would be great if the old 
> behaviour could return.
>

Indeed Phabricator might be adding to the confusion. It seems to create 
very "human" commit logs where it's difficult to tell a script generated 
the text. It looks like the author has written the commit log, applied 
an explicit sign-off and landed the patch whereas I'm starting to get 
the impression the script is building these commit logs and making it 
easy to generate bogus commits with a single keystroke.

If so, it might be an idea to go easy on the Phabricator until it gets 
fixed, rather that the other way round.

But the "commit and try to understand review comments later" isn't a 
technical problem and you'll know best how to handle as code owner.

> One other misconception that I need to clear up is that our pre-commit 
> reviews in Phabricator are actually intended for public review. It is 
> intended to create public-accessible record that a review happened 
> along with the content of that review. We then commit under the 'you 
> can commit to code you maintain without pre-commit review' rule (rule 
> 3 of 
> http://llvm.org/docs/DeveloperPolicy.html#obtaining-commit-access). As 
> far as the LLVM community is concerned, it is unreviewed at this point 
> but it is expected that the availability of the pre-commit review 
> makes most post-commit reviews trivial. Previously, we were trying to 
> do this kind of thing with our public-accessible-yet-internal bugzilla 
> but even though that system created a review that was publicly 
> visible, the LLVM community had no way of finding the review and 
> therefore it effectively did not exist.
>

So, that workflow is equivalent to reviewing on the office whiteboard, 
then sharing a snapshot of the whiteboard in the commit log, right?

I personally think that workflow you describe *is* acceptable to give a 
little transparency where there's otherwise none, though others here may 
disagree..

The caveat is that those whiteboard snapshots will be naturally subject 
to *greater* scrutiny than usual. They're the sum of your work, your 
portfolio and review board all in one and a way of saying "we're skilled 
enough that we pre-screen our own patches".

If you get it right, it's an opportunity to show off the effectiveness 
of your internal process in coordination with post-commit review. But if 
that whiteboard is full of unrecognisable scrawls ending in doodles and 
"LGTM", not so good ;-)

> Alp, I believe this explains points 3 and 4 in your revert commit 
> message. Do you agree?
>

I agree Daniel -- thanks for your considered response. if you do 
continue using the whiteboard workflow instead of the usual mailing list 
review procedure, please at least aim to work with Reed so that the 
content of those review snapshots matches the same high standard as your 
code.

Regards,
Alp.



> *From:*James Molloy [mailto:mankeyrabbit at gmail.com]
> *Sent:* 08 June 2014 11:57
> *To:* Alp Toker; Reed Kotler; Daniel Sanders; llvm-commits at cs.uiuc.edu
> *Subject:* RE: [llvm] r210414 - Do materialize for floating point
>
> Hi,
>
> To weigh in my two penniworth, the commit message was undescriptive 
> and just seemed a disjointed set of sentences.
>
> Please remember that even though you are code owner, this is an open 
> source project and it must remain accessible to everyone. Commit 
> messages like that just make it obvious that work is going on behind 
> closed doors.
>
> If you're reviewing patches externally, it must be visible to others. 
> Particularly, it looks in this case as if the code reviewer has had 
> legitimate concerns (that I share) and you went and committed anyway. 
> This utterly defeats the point of code review. If you do this, you 
> should certainly not mark the patch as signed off because it hasn't been!
>
> What we care about is that a due (and not particularly onerous!) 
> process has been followed. The specifics of the patch in question 
> (whether I understand fast-isel or not, for example ) is completely 
> besides the point.
>
> Cheers,
>
> James
>
> ------------------------------------------------------------------------
>
> *From: *Alp Toker <mailto:alp at nuanti.com>
> *Sent: *‎08/‎06/‎2014 11:27
> *To: *Reed Kotler <mailto:reed.kotler at imgtec.com>; Daniel Sanders 
> <mailto:Daniel.Sanders at imgtec.com>; llvm-commits at cs.uiuc.edu 
> <mailto:llvm-commits at cs.uiuc.edu>
> *Subject: *Re: [llvm] r210414 - Do materialize for floating point
>
>
> On 08/06/2014 13:12, Reed Kotler wrote:
> > This is a very trivial change to "Do materialize for floating point".
>
> Hi Reed,
>
> That's great. LGTM with that description!
>
> Please use the code owner system responsibly in future to keep it
> viable. It shouldn't be used to cover up situations like:
>
>    "I did not understand the comment about using dyn_cast instead of
> isa. I will commit as is and make the update after."
>
> Alp.
>
>
>
>
> >
> > If you understand what fast-isel does, that is all you need to say.
> > Each port has a materialize function for floating point literals.
> > That is the summary of the check in. It implements materialize for
> > floating point.
> >
> > I'm not used to using Phabricator yet but checked in a whole code
> > generator for Mips16
> > on my own and passed all of test suite without any problems.
> >
> > I have a lot of changes backed up right now and don't have the perfect
> > work flow
> > with Daniel yet to deal with that and all these deltas and keep
> > phabricator straight
> > at check in time. I'm doing the best I can there but it's not a
> > requirement and most people
> > are not even using phabricator at this time.
> >
> > Phabricator is being included just to make it easier for people to see
> > the checking
> > without having to just look at the diffs.
> >
> > The commit is fine and it has very good test case.
> >
> > Reed
> >
> > On 06/08/2014 02:40 AM, Alp Toker wrote:
> >>
> >> On 08/06/2014 11:42, Reed Kotler wrote:
> >>> The summary area in the putback comment was messed up but the patch
> >>> is fine.
> >>> I'm not very good with phabricator yet.
> >>
> >> Reed, I understand that your commit log was messed up but that's not
> >> the actual problem.
> >>
> >> I've reverted the change in r210424 with a full explanation and will
> >> follow up shortly to the list.
> >>
> >> Alp.
> >>
> >>
> >>>
> >>> I don't understand your concerns.
> >>>
> >>> You should look at the other fast-isel implementations, i.e. ppc,
> >>> arm and x86.
> >>>
> >>> This one is almost identical.
> >>>
> >>> All the implementations are all essentially the same.
> >>>
> >>> You are reading too much into the comment "creates lot of core
> >>> infrastructure".
> >>> It's not "core infrastructure" for llvm in general.
> >>>
> >>> This comment actually applied to an earlier commit. I have a lot of
> >>> patches backed up for
> >>> review and phabricator was seeing earlier comments and I should have
> >>> deleted them
> >>> but forgot to.
> >>>
> >>> The only thing this patch does is to add the additional
> >>> functionality for materializing
> >>> floats.
> >>>
> >>> Reed
> >>>
> >>> On 06/08/2014 12:11 AM, Alp Toker wrote:
> >>>> Hi Daniel,
> >>>>
> >>>> I'm concerned about the quality of your review...
> >>>>
> >>>>
> >>>> On 08/06/2014 06:30, Reed Kotler wrote:
> >>>>> Author: rkotler
> >>>>> Date: Sat Jun  7 22:30:32 2014
> >>>>> New Revision: 210414
> >>>>>
> >>>>> URL: http://llvm.org/viewvc/llvm-project?rev=210414&view=rev
> >>>>> Log:
> >>>>> Do materialize for floating point
> >>>>>
> >>>>> Summary:
> >>>>> start to do simple constants
> >>>>>
> >>>>> finish simplestore
> >>>>>
> >>>>> add test case
> >>>>>
> >>>>> format
> >>>>>
> >>>>> Merge branch 'master' into 1756_8
> >>>>>
> >>>>> Add basic functionality for assignment of ints. This creates a lot
> >>>>> of core infrastructure in which to add, with little effort, quite
> >>>>> a bit more to mips fast-isel
> >>>>
> >>>> A patch that "creates lot of core infrastructure" should have been
> >>>> reviewed on-list.
> >>>>
> >>>>>
> >>>>> Merge branch 'master' into 1756_8
> >>>>>
> >>>>> Add basic functionality for assignment of ints. This creates a lot
> >>>>> of core infrastructure in which to add, with little effort, quite
> >>>>> a bit more to mips fast-isel
> >>>>>
> >>>>> in progress
> >>>>>
> >>>>> finish integer materialize
> >>>>>
> >>>>> test cases
> >>>>>
> >>>>> test cases
> >>>>>
> >>>>> in progress
> >>>>>
> >>>>> Finish up fast-isel materialize for ints.
> >>>>>
> >>>>> Finish materialize for ints
> >>>>>
> >>>>> test cases
> >>>>>
> >>>>> simplestorei.ll
> >>>>>
> >>>>> Merge branch 'master' into 1756_8
> >>>>>
> >>>>> fix fp constants for fast-isel
> >>>>>
> >>>>> Merge branch '1758_1' of dmz-portal.mips.com:llvm into 1758_1
> >>>>>
> >>>>> in progress
> >>>>>
> >>>>> lastest for fp materialization
> >>>>>
> >>>>> clean up
> >>>>>
> >>>>> Merge branch 'master' into 1758_1
> >>>>>
> >>>>> formatting
> >>>>>
> >>>>> add test case
> >>>>>
> >>>>> finish test case
> >>>>>
> >>>>> Merge branch 'master' into 1758_2
> >>>>>
> >>>>> Test Plan:
> >>>>> simplestore.ll
> >>>>>
> >>>>> simplestore.ll
> >>>>>
> >>>>> Reviewers: dsanders
> >>>>>
> >>>>> Reviewed By: dsanders
> >>>>
> >>>> ?
> >>>>
> >>>>>
> >>>>> Differential Revision: http://reviews.llvm.org/D3659
> >>>>
> >>>> If I'm reading correctly, the quality issues were identified and
> >>>> just ignored to get a final LGTM and commit.
> >>>>
> >>>> What's going on here?
> >>>>
> >>>> Alp.
> >>>>
> >>>>
> >>>>>
> >>>>> Added:
> >>>>> llvm/trunk/test/CodeGen/Mips/Fast-ISel/simplestorefp1.ll
> >>>>> Modified:
> >>>>> llvm/trunk/lib/Target/Mips/MipsFastISel.cpp
> >>>>>
> >>>>> Modified: llvm/trunk/lib/Target/Mips/MipsFastISel.cpp
> >>>>> URL:
> >>>>> 
> http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsFastISel.cpp?rev=210414&r1=210413&r2=210414&view=diff
> >>>>> 
> ==============================================================================
> >>>>>
> >>>>> --- llvm/trunk/lib/Target/Mips/MipsFastISel.cpp (original)
> >>>>> +++ llvm/trunk/lib/Target/Mips/MipsFastISel.cpp Sat Jun  7
> >>>>> 22:30:32 2014
> >>>>> @@ -167,9 +167,14 @@ bool MipsFastISel::EmitStore(MVT VT, uns
> >>>>>     //
> >>>>>     // more cases will be handled here in following patches.
> >>>>>     //
> >>>>> -  if (VT != MVT::i32)
> >>>>> +  if (VT == MVT::i32)
> >>>>> +    EmitInstStore(Mips::SW, SrcReg, Addr.Base.Reg, Addr.Offset);
> >>>>> +  else if (VT == MVT::f32)
> >>>>> +    EmitInstStore(Mips::SWC1, SrcReg, Addr.Base.Reg, Addr.Offset);
> >>>>> +  else if (VT == MVT::f64)
> >>>>> +    EmitInstStore(Mips::SDC1, SrcReg, Addr.Base.Reg, Addr.Offset);
> >>>>> +  else
> >>>>>       return false;
> >>>>> -  EmitInstStore(Mips::SW, SrcReg, Addr.Base.Reg, Addr.Offset);
> >>>>>     return true;
> >>>>>   }
> >>>>>   @@ -229,6 +234,22 @@ bool MipsFastISel::TargetSelectInstructi
> >>>>>   }
> >>>>>     unsigned MipsFastISel::MaterializeFP(const ConstantFP *CFP,
> >>>>> MVT VT) {
> >>>>> +  int64_t Imm = CFP->getValueAPF().bitcastToAPInt().getZExtValue();
> >>>>> +  if (VT == MVT::f32) {
> >>>>> +    const TargetRegisterClass *RC = &Mips::FGR32RegClass;
> >>>>> +    unsigned DestReg = createResultReg(RC);
> >>>>> +    unsigned TempReg = Materialize32BitInt(Imm,
> >>>>> &Mips::GPR32RegClass);
> >>>>> +    EmitInst(Mips::MTC1, DestReg).addReg(TempReg);
> >>>>> +    return DestReg;
> >>>>> +  } else if (VT == MVT::f64) {
> >>>>> +    const TargetRegisterClass *RC = &Mips::AFGR64RegClass;
> >>>>> +    unsigned DestReg = createResultReg(RC);
> >>>>> +    unsigned TempReg1 = Materialize32BitInt(Imm >> 32,
> >>>>> &Mips::GPR32RegClass);
> >>>>> +    unsigned TempReg2 =
> >>>>> +        Materialize32BitInt(Imm & 0xFFFFFFFF, 
> &Mips::GPR32RegClass);
> >>>>> +    EmitInst(Mips::BuildPairF64,
> >>>>> DestReg).addReg(TempReg2).addReg(TempReg1);
> >>>>> +    return DestReg;
> >>>>> +  }
> >>>>>     return 0;
> >>>>>   }
> >>>>>
> >>>>> Added: llvm/trunk/test/CodeGen/Mips/Fast-ISel/simplestorefp1.ll
> >>>>> URL:
> >>>>> 
> http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Mips/Fast-ISel/simplestorefp1.ll?rev=210414&view=auto
> >>>>> 
> ==============================================================================
> >>>>>
> >>>>> --- llvm/trunk/test/CodeGen/Mips/Fast-ISel/simplestorefp1.ll (added)
> >>>>> +++ llvm/trunk/test/CodeGen/Mips/Fast-ISel/simplestorefp1.ll Sat
> >>>>> Jun  7 22:30:32 2014
> >>>>> @@ -0,0 +1,39 @@
> >>>>> +; RUN: llc -march=mipsel -relocation-model=pic -O0
> >>>>> -mips-fast-isel -fast-isel-abort -mcpu=mips32r2 \
> >>>>> +; RUN:     < %s | FileCheck %s
> >>>>> +
> >>>>> + at f = common global float 0.000000e+00, align 4
> >>>>> + at de = common global double 0.000000e+00, align 8
> >>>>> +
> >>>>> +; Function Attrs: nounwind
> >>>>> +define void @f1() #0 {
> >>>>> +entry:
> >>>>> +  store float 0x3FFA76C8C0000000, float* @f, align 4
> >>>>> +  ret void
> >>>>> +; CHECK:    .ent    f1
> >>>>> +; CHECK:    lui    $[[REG1:[0-9]+]], 16339
> >>>>> +; CHECK:    ori    $[[REG2:[0-9]+]], $[[REG1]], 46662
> >>>>> +; CHECK:    mtc1    $[[REG2]], $f[[REG3:[0-9]+]]
> >>>>> +; CHECK:    lw    $[[REG4:[0-9]+]], %got(f)(${{[0-9]+}})
> >>>>> +; CHECK:    swc1    $f[[REG3]], 0($[[REG4]])
> >>>>> +; CHECK:     .end    f1
> >>>>> +
> >>>>> +}
> >>>>> +
> >>>>> +; Function Attrs: nounwind
> >>>>> +define void @d1() #0 {
> >>>>> +entry:
> >>>>> +  store double 1.234567e+00, double* @de, align 8
> >>>>> +; CHECK:    .ent    d1
> >>>>> +; CHECK:    lui    $[[REG1a:[0-9]+]], 16371
> >>>>> +; CHECK:    ori    $[[REG2a:[0-9]+]], $[[REG1a]], 49353
> >>>>> +; CHECK:    lui    $[[REG1b:[0-9]+]], 21403
> >>>>> +; CHECK:    ori    $[[REG2b:[0-9]+]], $[[REG1b]], 34951
> >>>>> +; CHECK:    mtc1    $[[REG2b]], $f[[REG3b:[0-9]+]]
> >>>>> +; CHECK:    mtc1    $[[REG2a]], $f[[REG3a:[0-9]+]]
> >>>>> +; CHECK:    sdc1    $f[[REG3b]], 0(${{[0-9]+}})
> >>>>> +; CHECK:    .end    d1
> >>>>> +  ret void
> >>>>> +}
> >>>>> +
> >>>>> +attributes #0 = { nounwind "less-precise-fpmad"="false"
> >>>>> "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf"
> >>>>> "no-infs-fp-math"="false" "no-nans-fp-math"="false"
> >>>>> "stack-protector-buffer-size"="8" "unsafe-fp-math"="false"
> >>>>> "use-soft-float"="false" }
> >>>>> +
> >>>>>
> >>>>>
> >>>>> _______________________________________________
> >>>>> llvm-commits mailing list
> >>>>> llvm-commits at cs.uiuc.edu
> >>>>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
> >>>>
> >>>
> >>
> >
>
> -- 
> http://www.nuanti.com
> the browser experts
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>

-- 
http://www.nuanti.com
the browser experts




More information about the llvm-commits mailing list