[PATCH] D86449: [SelectionDAG] Handle non-power-of-2 bitwidths in expandROT

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 25 13:50:22 PDT 2020


nikic added a comment.

In D86449#2236491 <https://reviews.llvm.org/D86449#2236491>, @spatel wrote:

> Do we guarantee that the rotate amount is not undef? (Can we assert that?)
> The expansion may fail if the rotate amount is 'undef':
> https://alive2.llvm.org/ce/z/tqjuC7

Undef is a legal rotate amount (because we spec rotate to be modulo the bitwidth, unlike normal shifts, where it is poison). However, I don't think it makes sense to consider undef-related issues at the SDAG layer at this point in time. They are much less likely to cause practical miscompiles here, and it's much harder to be undef-correct in SDAG (because expansion and legalization will often introduce multiple uses of the values, with the issues that may entail, as in this case). Being pedantic about this would need a lot of FREEZE.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D86449



More information about the llvm-commits mailing list