OSDN Git Service

[DAG] isBitwiseNot / isConstOrConstSplat - add support for build vector undefs +...
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Sun, 2 Jun 2019 11:56:39 +0000 (11:56 +0000)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Sun, 2 Jun 2019 11:56:39 +0000 (11:56 +0000)
commit40263ea2de82abd70c41f5821448797f498d4d75
treeefe5fcaee1169fd00d95aa4dc2244ad6e4b89d97
parent6620a82b14d00528e40d816f3ead22ba3f40a2b8
[DAG] isBitwiseNot / isConstOrConstSplat - add support for build vector undefs + truncation (PR41020)

Add (opt-in) support for implicit truncation to isConstOrConstSplat, which allows us to match truncated 'all ones' cases in isBitwiseNot.

PR41020 compares against using ISD::isBuildVectorAllOnes() instead, but that predicate silently accepts any UNDEF elements in the build vector which might not be what we want in isBitwiseNot - so I've added an opt-in 'AllowUndefs' flag that is set to false by default but will allow us to enable it on individual cases where its safe.

Differential Revision: https://reviews.llvm.org/D62783

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@362323 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/CodeGen/SelectionDAGNodes.h
lib/CodeGen/SelectionDAG/SelectionDAG.cpp
test/CodeGen/AArch64/sat-add.ll