[llvm-commits] [llvm] r48822 - in /llvm/trunk: include/llvm/CodeGen/ScheduleDAG.h include/llvm/CodeGen/SelectionDAGNodes.h lib/CodeGen/SelectionDAG/DAGCombiner.cpp lib/CodeGen/SelectionDAG/LegalizeDAG.cpp lib/CodeGen/SelectionDAG/LegalizeTypes.cp

Roman Levenstein romix.llvm at googlemail.com
Fri Apr 4 04:53:34 PDT 2008


Hi Dan, Hi Evan.

>  On Apr 2, 2008, at 2:28 PM, Dan Gohman wrote:
>
>  >
>  > On Mar 26, 2008, at 5:39 AM, Roman Levenstein wrote:
>  >>
>  >> +
>  >> +  SmallSetVector<SDNode*, 16> Users;
>  >>  while (!From->use_empty()) {
>  >> -    // Process users until they are all gone.
>  >> -    SDNode *U = *From->use_begin();
>  >> -
>  >> +    SDNode::use_iterator UI = From->use_begin();
>  >> +    SDNode *U = UI->getUser();
>  >> +
>  >> +    // Remember that this node is about to morph.
>  >> +    if (Users.count(U))
>  >> +      continue;
>  >> +    Users.insert(U);
>  >
>  > Hi Roman,
>  >
>  > This code that remembers users is causing the loop to
>  > repeat infinitely in some cases. Actually, if Users.count(U)
>  > is ever true, it gooes into an infinite loop because
>  > nothing happens that will make From->use_list()
>  > get closer to being empty.
>  >
>  > You can reproduce this by unmerging revision 48994 and
>  > running llc on the attached testcase. 48994 is otherwise
>  > unrelated, but it happens to change the way this testcase
>  > gets compiled such that the above bug doesn't get triggered.
>  >
>  > Can you take a look at this?
>  >
>  > Thanks,
>  >
>  > Dan

OK. I confirm your failure and can reproduce it.

>  +    if (Users.count(U))
>  +      continue;
>  +    Users.insert(U);

Oops. This three lines should be removed! This solves the problem and
makes things faster as well, since now set operations are necessary
anymore. BTW, there are 2 or 3 other similar places with the same
problem. I fixed all of them

2008/4/3, Evan Cheng <evan.cheng at apple.com>:
> I've backed this out for now. Please fix the infinite looping and then
> re-commit.

I have a stupid question regarding this. My source tree is newer than
that revision and some other unrelated things are changed in the
affected files already. Therefore I cannot so simply commit the fix.
How can I do that? Probably I can edit the backed-out patch, but how
do I commit this patch file  to the SVN? Is it possible to commit the
file containing a patch, i.e. without SVN analyzing the source files
on my side?

-Roman



More information about the llvm-commits mailing list