[all-commits] [llvm/llvm-project] 4059c1: [SimplifyInst] Use correct type for GEPs with vect...

Florian Hahn via All-commits all-commits at lists.llvm.org
Tue Apr 6 09:56:39 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 4059c1c32d37ff3738428dcc2a4c98c4677d3a24
      https://github.com/llvm/llvm-project/commit/4059c1c32d37ff3738428dcc2a4c98c4677d3a24
  Author: Florian Hahn <flo at fhahn.com>
  Date:   2021-04-06 (Tue, 06 Apr 2021)

  Changed paths:
    M llvm/lib/Analysis/InstructionSimplify.cpp
    M llvm/test/Transforms/InstSimplify/gep.ll

  Log Message:
  -----------
  [SimplifyInst] Use correct type for GEPs with vector indices.

The current code does not properly handle vector indices unless they are
the first index.

At the moment LangRef gives the impression that the vector index must be
the one and only index (https://llvm.org/docs/LangRef.html#getelementptr-instruction).

But vector indices can appear at any position and according to the
verifier there may be multiple vector indices. If that's the case, the
number of elements must match.

This patch updates SimplifyGEPInst to properly handle those additional
cases.

Reviewed By: nikic

Differential Revision: https://reviews.llvm.org/D99961




More information about the All-commits mailing list