[all-commits] [llvm/llvm-project] 87087a: [InstCombine] Add tests for gep of null (NFC)

Nikita Popov via All-commits all-commits at lists.llvm.org
Wed Dec 23 12:46:39 PST 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 87087a02ae49a907e0ec9e6dfe62c9b9ca232936
      https://github.com/llvm/llvm-project/commit/87087a02ae49a907e0ec9e6dfe62c9b9ca232936
  Author: Nikita Popov <nikita.ppv at gmail.com>
  Date:   2020-12-23 (Wed, 23 Dec 2020)

  Changed paths:
    M llvm/test/Transforms/InstCombine/getelementptr.ll

  Log Message:
  -----------
  [InstCombine] Add tests for gep of null (NFC)

We were only considering the gep of null pattern in conjunction
with a load/store. Also test it independently.


  Commit: eb79fd3c928dbbb97f7937963361c1dad2bf8222
      https://github.com/llvm/llvm-project/commit/eb79fd3c928dbbb97f7937963361c1dad2bf8222
  Author: Nikita Popov <nikita.ppv at gmail.com>
  Date:   2020-12-23 (Wed, 23 Dec 2020)

  Changed paths:
    M llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp
    M llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
    M llvm/test/Transforms/InstCombine/getelementptr.ll
    M llvm/test/Transforms/InstCombine/store.ll

  Log Message:
  -----------
  [InstCombine] Fold gep inbounds of null to null

Effectively, this is what we were previously already doing when
the GEP was used in conjunction with a load or store, but this
fold can also be applied more generally:

> The only in bounds address for a null pointer in the default
> address-space is the null pointer itself.


Compare: https://github.com/llvm/llvm-project/compare/c7e825b910a9...eb79fd3c928d


More information about the All-commits mailing list