[all-commits] [llvm/llvm-project] 1bd11d: [ConstFold] Add additional icmp of gep of global t...

Nikita Popov via All-commits all-commits at lists.llvm.org
Tue Dec 28 05:14:18 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 1bd11d34feecde09958669f6c507b9a10cc6b2ab
      https://github.com/llvm/llvm-project/commit/1bd11d34feecde09958669f6c507b9a10cc6b2ab
  Author: Nikita Popov <npopov at redhat.com>
  Date:   2021-12-28 (Tue, 28 Dec 2021)

  Changed paths:
    A llvm/test/Transforms/InstSimplify/ConstProp/icmp-global.ll
    R llvm/test/Transforms/InstSimplify/ConstProp/icmp-null.ll

  Log Message:
  -----------
  [ConstFold] Add additional icmp of gep of global tests (NFC)

The fold is incorrect for the sgt case, as gep inbounds is allowed
to cross the sign boundary.


  Commit: 23de66d1636b53ff4e52be91f6b84f014a6ae279
      https://github.com/llvm/llvm-project/commit/23de66d1636b53ff4e52be91f6b84f014a6ae279
  Author: Nikita Popov <npopov at redhat.com>
  Date:   2021-12-28 (Tue, 28 Dec 2021)

  Changed paths:
    M llvm/lib/IR/ConstantFold.cpp
    M llvm/test/Assembler/ConstantExprFold.ll
    M llvm/test/Transforms/InstSimplify/ConstProp/icmp-global.ll

  Log Message:
  -----------
  [ConstFold] Don't fold signed comparison of gep of global

An inbounds GEP may still cross the sign boundary, so signed icmps
cannot be folded (https://alive2.llvm.org/ce/z/XSgi4D). This was
previously fixed for other folds in this function, but this one
was missed.


Compare: https://github.com/llvm/llvm-project/compare/7d850a0c4d26...23de66d1636b


More information about the All-commits mailing list