[PATCH] D81634: Remove assert from ShuffleVectorInst

Sam Parker via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 11 05:27:00 PDT 2020


samparker marked an inline comment as done.
samparker added a comment.

> Was the failure only a fuzzer problem?

Not sure, but either it seems harsh to assert of technically legal IR.

Ideally, callers shouldn't be wasting their time on analysis of degenerate code, so that assert might have actually been useful for real code.

> I'll have a look into the callsites to see if it's easier enough to skip on undef masks.



================
Comment at: llvm/lib/IR/Instructions.cpp:2056
   }
-  assert((UsesLHS ^ UsesRHS) && "Should have selected from exactly 1 source");
   return true;
----------------
spatel wrote:
> I think it would be better to change to:
>   // Allow for degenerate case: completely undef mask means neither source is used.
>   return UsesLHS || UsesRHS;
Looks good.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D81634/new/

https://reviews.llvm.org/D81634





More information about the llvm-commits mailing list