[PATCH] PRE: hoist operations into common dominator when possible.
Joey Gouly
joey.gouly at gmail.com
Fri Aug 15 03:58:09 PDT 2014
Two minor comments:
You check that "NumWithout == 1", but on line 2532 we 'continue' if
"NumWithout != 1". I suppose you could assert(NumWithout ==1) inside your
if statement.
Also,
+ if (predMap[0].first) {
+ I = cast<Instruction>(predMap[0].first);
+ BB = predMap[0].second;
+ } else {
+ I = cast<Instruction>(predMap[1].first);
+ BB = predMap[1].second;
+ }
If you write this as:
unsigned Index = predMap[0].first ? 0 : 1;
I = cast<Instruction>(predMap[index].first);
BB = predMap[index].second;
Does it look nicer to you?
Joey
On 15 August 2014 11:36, Erik Verbruggen <erikjv at me.com> wrote:
> When PRE detects a common operation after a basic diamond case and in
> one predecessor in that diamond, then hoist that operation in the common
> dominator of the predecessors instead of moving the operation into the
> predecessor lacking it.
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140815/a67f321e/attachment.html>
More information about the llvm-commits
mailing list