[PATCH] D126175: [SelectionDAG] Add a freeze to ISD::ABS expansion.

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun May 22 14:06:34 PDT 2022


efriedma accepted this revision.
efriedma added a comment.
This revision is now accepted and ready to land.

LGTM

> Looking at the test deltas I wonder if it be valid to combine (sext_inreg (freeze (aextload X))) -> (freeze (sextload X)).

That doesn't directly work: if the loaded value is poison, it isn't sign-extended.  You'd have to represent it some other way.

For example, you could introduce a "frozen sextload".  Or you could combine abs(sextload(x)) -> y = (freeze (sextload X)); umin(y,sub(0,y)).  Or you could introduce a form of "freeze" that freezes undef, but not poison.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D126175



More information about the llvm-commits mailing list