[all-commits] [llvm/llvm-project] 02dda1: [Local] Clean up EmitGEPOffset

Nikita Popov via All-commits all-commits at lists.llvm.org
Fri Nov 13 09:31:18 PST 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 02dda1c659e8d675a20ace06dc060b787345b972
      https://github.com/llvm/llvm-project/commit/02dda1c659e8d675a20ace06dc060b787345b972
  Author: Nikita Popov <nikita.ppv at gmail.com>
  Date:   2020-11-13 (Fri, 13 Nov 2020)

  Changed paths:
    M llvm/include/llvm/Analysis/Utils/Local.h
    M llvm/lib/Transforms/InstCombine/InstCombineAddSub.cpp
    M llvm/test/Transforms/InstCombine/sub-gep.ll

  Log Message:
  -----------
  [Local] Clean up EmitGEPOffset

Handle the emission of the add in a single place, instead of three
different ones.

Don't emit an unnecessary add with zero to start with. It will get
dropped by InstCombine, but we may as well not create it in the
first place. This also means that InstCombine does not need to
specially handle this extra add.

This is conceptually NFC, but can affect worklist order etc.




More information about the All-commits mailing list