[PATCH] D86871: [SelectionDAG] Let NSW/NUW flags be cleared by default in call to getNode().

Ulrich Weigand via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 1 09:29:25 PDT 2020


uweigand added a comment.

Thanks for the links, @spatel !  It seems to me that the change in "D46854 <https://reviews.llvm.org/D46854> - changed code in SelectionDAGBuilder::visit()" is actually not correctly respecting the shared flags semantics.  The node returned from getNodeForIRValue, while implementing the translation of this IR, might at the same be be used elsewhere (due to DAG node merging).  If that other place does not allow FMF semantics, the flags in the DAG node can still be "undefined", and therefore the new code in "visit" will just replace the flags with a version appropriate only for this IR (which may allow FMF).

Am I missing something here?   More generally, how can **any** after-the-fact setFlags ever be correct, given that the node might have already been merged?


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

https://reviews.llvm.org/D86871



More information about the llvm-commits mailing list