[PATCH] D36996: [X86] Prevent several calls to ISD::isConstantSplatVector from returning a narrower APInt than the original scalar type

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 21 22:10:22 PDT 2017


craig.topper created this revision.

ISD::isConstantSplatVector can shrink to the smallest splat width. But we don't check the size of the resulting APInt at all. This can cause us to misinterpret the results.

This patch just adds a flag to prevent the APInt from changing width.

Fixes PR34271.


https://reviews.llvm.org/D36996

Files:
  include/llvm/CodeGen/SelectionDAGNodes.h
  lib/CodeGen/SelectionDAG/SelectionDAG.cpp
  lib/Target/X86/X86ISelLowering.cpp
  test/CodeGen/X86/pr34271-1.ll
  test/CodeGen/X86/pr34271.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D36996.112112.patch
Type: text/x-patch
Size: 5607 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170822/535d7ff1/attachment.bin>


More information about the llvm-commits mailing list