OSDN Git Service

[ConstnatFolding] Teach the folder how to fold ConstantVector
authorDavid Majnemer <david.majnemer@gmail.com>
Fri, 29 Jul 2016 03:27:26 +0000 (03:27 +0000)
committerDavid Majnemer <david.majnemer@gmail.com>
Fri, 29 Jul 2016 03:27:26 +0000 (03:27 +0000)
commite43ff14879342fa0b49a56e8622cf05ec7119f7b
tree00c4b9e3fac7dcb1733d0eb864f269507c78a160
parentc6c1814d38905ae31faf406e74a557516399bcda
[ConstnatFolding] Teach the folder how to fold ConstantVector

A ConstantVector can have ConstantExpr operands and vice versa.
However, the folder had no ability to fold ConstantVectors which, in
some cases, was an optimization barrier.

Instead, rephrase the folder in terms of Constants instead of
ConstantExprs and teach callers how to deal with failure.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277099 91177308-0d34-0410-b5e6-96231b3b80d8
13 files changed:
include/llvm/Analysis/ConstantFolding.h
include/llvm/Analysis/TargetFolder.h
lib/Analysis/ConstantFolding.cpp
lib/Analysis/Lint.cpp
lib/CodeGen/AsmPrinter/AsmPrinter.cpp
lib/Target/NVPTX/NVPTXAsmPrinter.cpp
lib/Transforms/IPO/GlobalOpt.cpp
lib/Transforms/InstCombine/InstCombineCasts.cpp
lib/Transforms/InstCombine/InstCombineShifts.cpp
lib/Transforms/InstCombine/InstructionCombining.cpp
lib/Transforms/Scalar/GVN.cpp
lib/Transforms/Utils/Evaluator.cpp
test/Transforms/InstCombine/icmp-vec.ll