[all-commits] [llvm/llvm-project] 4c9e31: [funcattrs] Use early return to clarify code in de...

Philip Reames via All-commits all-commits at lists.llvm.org
Fri Dec 17 10:00:53 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 4c9e31a4814592bbda7153833e46728dc7b21100
      https://github.com/llvm/llvm-project/commit/4c9e31a4814592bbda7153833e46728dc7b21100
  Author: Philip Reames <listmail at philipreames.com>
  Date:   2021-12-17 (Fri, 17 Dec 2021)

  Changed paths:
    M llvm/lib/Transforms/IPO/FunctionAttrs.cpp

  Log Message:
  -----------
  [funcattrs] Use early return to clarify code in determinePointerAccessAttrs [NFC]

Instead of having the speculative path be the untaken path in the branch, explicitly have it return.  This does require tail duplicating one call, but the resulting code is shorter and easier to understand.  Also rewrite the condition using appropriate accessors.




More information about the All-commits mailing list