[PATCH] D62025: Expand llvm.is.constant earlier

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 6 18:27:47 PDT 2019


efriedma added a comment.

We already fold llvm.is.constant to true early, in ConstantFoldScalarCall.

> The only thing that should fold llvm.is.constant to false should be FastISel or SelectionDAG.

The point of this patch is that we don't want to fold it quite that late.  We want to try to hold off folding it until we've resolved all the information we can get through inlining etc, but we miss some very basic optimizations if we wait for SelectionDAG.  PR41027 contains a case of an invalid inline asm block, which compiles with gcc because it throws away the asm before it tries to check the constraints.

That said, this patch is horribly confusing. It isn't related to the normal functionality of the InstSimplify pass.  And even if InstSimplifyPass.cpp happens to run in the correct position at the moment, that's likely to change in the future.


Repository:
  rL LLVM

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

https://reviews.llvm.org/D62025





More information about the llvm-commits mailing list