OSDN Git Service

[ConstantFolding] check applicability of AllOnes constant creation first
authorJameson Nash <vtjnash@gmail.com>
Wed, 15 Jul 2020 13:17:42 +0000 (09:17 -0400)
committerJameson Nash <vtjnash@gmail.com>
Sun, 19 Jul 2020 17:13:57 +0000 (13:13 -0400)
commit8b354cc8db413f596c95b4f3240fabaa3e2c931e
treefa879aa22458de98c2718961cbacc17094b2ddd0
parent6187eeb683d8c639282d437e6af585e9b7f9c93e
[ConstantFolding] check applicability of AllOnes constant creation first

The getAllOnesValue can only handle things that are bitcast from a
ConstantInt, while here we bitcast through a pointer, so we may see more
complex objects (like Array or Struct).

Differential Revision: https://reviews.llvm.org/D83870
llvm/lib/Analysis/ConstantFolding.cpp
llvm/test/Analysis/ConstantFolding/allones.ll [new file with mode: 0644]