diff options
| author | Hal Finkel <hfinkel@anl.gov> | 2013-08-18 00:16:23 +0000 |
|---|---|---|
| committer | Hal Finkel <hfinkel@anl.gov> | 2013-08-18 00:16:23 +0000 |
| commit | 3f5279cc2646cafdce99f7e2f769d04845585369 (patch) | |
| tree | 1cb576007f1f67705a747a95eecd1445a8aed054 /llvm/lib/Support | |
| parent | 9dce26947e3bd5da661f96a77d32c01b0413fd5f (diff) | |
| download | bcm5719-llvm-3f5279cc2646cafdce99f7e2f769d04845585369.tar.gz bcm5719-llvm-3f5279cc2646cafdce99f7e2f769d04845585369.zip | |
Fix SCEVExpander creating distinct duplicate PHI entries
This fixes SCEVExpander so that it does not create multiple distinct induction
variables for duplicate PHI entries. Specifically, given some code like this:
do.body6: ; preds = %do.body6, %do.body6, %if.then5
%end.0 = phi i8* [ undef, %if.then5 ], [ %incdec.ptr, %do.body6 ], [ %incdec.ptr, %do.body6 ]
...
Note that it is legal to have multiple entries for a basic block so long as the
associated value is the same. So the above input is okay, but expanding an
AddRec in this loop could produce code like this:
do.body6: ; preds = %do.body6, %do.body6, %if.then5
%indvar = phi i64 [ %indvar.next, %do.body6 ], [ %indvar.next1, %do.body6 ], [ 0, %if.then5 ]
%end.0 = phi i8* [ undef, %if.then5 ], [ %incdec.ptr, %do.body6 ], [ %incdec.ptr, %do.body6 ]
...
%indvar.next = add i64 %indvar, 1
%indvar.next1 = add i64 %indvar, 1
And this is not legal because there are two PHI entries for %do.body6 each with
a distinct value.
Unfortunately, I don't have an in-tree test case.
llvm-svn: 188614
Diffstat (limited to 'llvm/lib/Support')
0 files changed, 0 insertions, 0 deletions

