[SVE] Fix invalid usage of VectorType::getNumElements() in InstCombine
authorChristopher Tetreault <ctetreau@quicinc.com>
Fri, 1 May 2020 17:17:54 +0000 (10:17 -0700)
committerChristopher Tetreault <ctetreau@quicinc.com>
Fri, 1 May 2020 17:56:29 +0000 (10:56 -0700)
commitbeeabe382ddab1c47ca01de1d5e6165d5167bc7d
tree61eeef8286642d71339ebc6f418ba147caf9e453
parent7fa150203f882bd7e4fbbfcff4580efe84d036c9
[SVE] Fix invalid usage of VectorType::getNumElements() in InstCombine

Summary:
Make foldVectorBinop return null if the instruction type is a scalable
vector. It is unclear what, if any, of this function works with scalable
vectors.

Identified by test LLVM.Transforms/InstCombine::nsw.ll

Reviewers: efriedma, david-arm, fpetrogalli, spatel

Reviewed By: efriedma

Subscribers: tschuett, hiraditya, rkruppe, psnobl, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D79196
llvm/lib/Transforms/InstCombine/InstructionCombining.cpp