]> granicus.if.org Git - llvm/commit
[SDAG] Add SDNode/SDValue getConstantOperandAPInt helper. NFCI.
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Sat, 2 Feb 2019 17:35:06 +0000 (17:35 +0000)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Sat, 2 Feb 2019 17:35:06 +0000 (17:35 +0000)
commit5893e44c14b9b0dea6ba1d7786ab80b405dfd883
treee7fa7ec40837da11bbccefc6aa7de18d4a9c1ae7
parent959d06a65c3abc13f45b26729c60355f95537c4d
[SDAG] Add SDNode/SDValue getConstantOperandAPInt helper. NFCI.

We already have the getConstantOperandVal helper which returns a uint64_t, but along comes the fuzzer and inserts a i128 -1 constant or something and the whole thing asserts.......

I've updated a few obvious cases, and tried to make use of the const reference where possible, but there's more to do. A number of existing oss-fuzz tickets should be fixed if we start using APInt and perform value clamping where necessary.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@352961 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/CodeGen/SelectionDAGNodes.h
lib/CodeGen/SelectionDAG/DAGCombiner.cpp
lib/Target/X86/X86ISelLowering.cpp