[PATCH] D75808: [ValueTracking] isKnownNonZero, computeKnownBits for freeze

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 8 00:35:24 PDT 2020


nikic added inline comments.


================
Comment at: llvm/lib/Analysis/ValueTracking.cpp:1800
     break;
+  case Instruction::Freeze:
+    if (isGuaranteedNotToBeUndefOrPoison(I->getOperand(0), true, Q.CxtI, Q.DT))
----------------
aqjune wrote:
> reames wrote:
> > I don't think this is worth adding.  Such a freeze is trivial, and I'd expect the optimizer to simply remove it instead.
> KnownBits analysis on freeze can be done when the operand is partially undef. (isGuaranteedNotToBePoison vs. isGuaranteedNotToBeUndefOrPoison)
And we can do that because "computeKnownBits" provides a "KnownBits or poison" result and not a "KnownBits or undef/poison" result, right?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D75808



More information about the llvm-commits mailing list