[PATCH] D133198: [SCCP] convert signed div/rem to unsigned for non-negative operands

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 2 13:40:06 PDT 2022


fhahn added a comment.

> I didn't find an explanation for skipping a constant operand in the existing zext code (ie, sext i8 42 -> zext i8 42 is valid, but we skip it). So that clause is not included for this transform, but there is a test diff for that pattern in case it should be bypassed.

Do those operations have users left? If they can be simplified to a constant, I'd expect `tryToReplaceWithConstant` to take care of replacing all users of them.

> I'd split this into a refactoring NFC patch that adds the helper function, then add the code for sdiv/srem cases if approved. I

Splitting off the helper first would make sense, overall this looks like a nice improvement.


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

https://reviews.llvm.org/D133198



More information about the llvm-commits mailing list