[PATCH] D149587: InstSimplify: Simplifications for ldexp

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 11 04:17:07 PDT 2023


arsenm added inline comments.


================
Comment at: llvm/lib/Analysis/InstructionSimplify.cpp:6084
+    if (Q.isUndefValue(Op0))
+      return ConstantFP::getNaN(Op0->getType());
+
----------------
arsenm wrote:
> foad wrote:
> > arsenm wrote:
> > > foad wrote:
> > > > Why is this not strictfp-safe?
> > > If undef resolved to a signaling nan it wouldn't raise an exception
> > But here you are //choosing// what you want the undef value to be, so choose a quiet NaN.
> https://github.com/llvm/llvm-project/blob/67a212af4c24426de6e436e9b82590d41faa665c/llvm/lib/Analysis/InstructionSimplify.cpp#L5513
> 
> This is checking this which is a more refined check of strictfp
although really I should probably just call simplifyFPOp in the first place


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

https://reviews.llvm.org/D149587



More information about the llvm-commits mailing list