[PATCH] D156401: [PatternMatch] Do not match constant expressions for binops

Noah Goldstein via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 27 13:00:57 PDT 2023


goldstein.w.n accepted this revision.
goldstein.w.n added a comment.
This revision is now accepted and ready to land.

In D156401#4539923 <https://reviews.llvm.org/D156401#4539923>, @nikic wrote:

> In D156401#4539763 <https://reviews.llvm.org/D156401#4539763>, @goldstein.w.n wrote:
>
>> Is there a way to check/get a ConstantExpr as a ImmConstant? If so maybe this should come with an update to `m_ImmConstant` to also try to extract from a ConstantExpr match.
>
> I don't really get what you mean here. Isn't m_ImmConstant specifically about //not// matching constant expressions? m_Constant() is the way to match arbitrary constants (including ConstantExpr).

Err yeah nvm I misread some of the test changes.

Sorry.

Code change LGTM.

Regarding the regressions, as long as its temporary state its fine imo.
Might want to give others a day or so to comment as to that affect, however.


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

https://reviews.llvm.org/D156401



More information about the llvm-commits mailing list