[PATCH] D153619: [NFC][GlobalISel] Don't return `bool` from apply functions

Pierre van Houtryve via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 23 03:27:26 PDT 2023


Pierre-vh created this revision.
Pierre-vh added reviewers: foad, arsenm, dsanders, aemerson.
Herald added subscribers: StephenFan, hiraditya.
Herald added a project: All.
Pierre-vh requested review of this revision.
Herald added subscribers: llvm-commits, wdng.
Herald added a project: LLVM.

There is no case where those functions return false. It's always return true.
Even if they were to return false, it's not really something we should rely on I think.
With the current combiner implementation, it would just make `tryCombineAll` return false without retrying anymore rules.

I also believe that if an applyer were to return false, it would mean that the match function is not good enough. Asserting on failure in an apply function is a better idea, IMO.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D153619

Files:
  llvm/include/llvm/CodeGen/GlobalISel/CombinerHelper.h
  llvm/include/llvm/Target/GlobalISel/Combine.td
  llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp
  llvm/lib/Target/AArch64/AArch64Combine.td
  llvm/lib/Target/AArch64/GISel/AArch64PostLegalizerCombiner.cpp
  llvm/lib/Target/AArch64/GISel/AArch64PostLegalizerLowering.cpp
  llvm/lib/Target/AArch64/GISel/AArch64PreLegalizerCombiner.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D153619.533915.patch
Type: text/x-patch
Size: 22994 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230623/deea2726/attachment.bin>


More information about the llvm-commits mailing list