[PATCH] D21165: Disable MSan-hostile loop unswitching.

Sanjoy Das via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 8 18:42:05 PDT 2016


sanjoy added a comment.

I want to think this through some more, but overall this doesn't sound
too scary to me.  Generally, I don't think we _can_ have branches on
undef be side effects, since we'd like to allow transforming:

  %v = maybe_undef()
  if (some_cond)
    return;
  %v0 = select i1 %v, X, Y

to

  %v = maybe_undef()
  %v0 = select i1 %v, X, Y
  if (some_cond)
    return;

to

  %v = maybe_undef()
  br %v, label %left, label %right
  
  left:
    br merge
  
  right:
    br merge
  
  merge:
    %v0 = phi([X, left], [Y, right])
  
  if (some_cond)
    return;

In other words, since we want selects to be side-effect free, and also
selects to be equivalent to br-phi, we need branches to be side-effect
free as well.


Repository:
  rL LLVM

http://reviews.llvm.org/D21165





More information about the llvm-commits mailing list