[PATCH] D35040: [IR] Implement Constant::isNegativeZeroValue/isZeroValue/isAllOnesValue/isOneValue/isMinSignedValue for ConstantDataVector without going through getElementAsConstant

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 5 21:11:11 PDT 2017


craig.topper created this revision.

Currently these methods call ConstantDataVector::getSplatValue which uses getElementsAsConstant to create a Constant object representing the element value. This method incurs a map lookup to see if we already have created such a Constant before and if not allocates a new Constant object.

This patch changes these methods to use getElementAsAPFloat and getElementAsInteger so we can just examine the data values directly.


https://reviews.llvm.org/D35040

Files:
  include/llvm/IR/Constants.h
  lib/IR/Constants.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D35040.105369.patch
Type: text/x-patch
Size: 5483 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170706/aa11f594/attachment.bin>


More information about the llvm-commits mailing list