]> granicus.if.org Git - llvm/commit
[X86] Cleanups and safety checks around the isFNEG
authorCraig Topper <craig.topper@intel.com>
Mon, 24 Jun 2019 17:28:26 +0000 (17:28 +0000)
committerCraig Topper <craig.topper@intel.com>
Mon, 24 Jun 2019 17:28:26 +0000 (17:28 +0000)
commit172944c965d443c4902f4a5004f5d871c53f77c7
treeb78785fc375fbba9dfe70a0ba7a444940369061c
parente5fd1b30e7c88493cb4b04e4d881ce007fb4a414
[X86] Cleanups and safety checks around the isFNEG

This patch does a few things to start cleaning up the isFNEG function.

-Remove the Op0/Op1 peekThroughBitcast calls that seem unnecessary. getTargetConstantBitsFromNode has its own peekThroughBitcast inside. And we have a separate peekThroughBitcast on the return value.
-Add a check of the scalar size after the first peekThroughBitcast to ensure we haven't changed the element size and just did something like f32->i32 or f64->i64.
-Remove an unnecessary check that Op1's type is floating point after the peekThroughBitcast. We're just going to look for a bit pattern from a constant. We don't care about its type.
-Add VT checks on several places that consume the return value of isFNEG. Due to the peekThroughBitcasts inside, the type of the return value isn't guaranteed. So its not safe to use it to build other nodes without ensuring the type matches the type being used to build the node. We might be able to replace these checks with bitcasts instead, but I don't have a test case so a bail out check seemed better for now.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@364206 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/X86/X86ISelLowering.cpp
test/CodeGen/X86/avx512-intrinsics-fast-isel.ll