OSDN Git Service

[LV] Wrap LV illegality reporting in a function. NFC.
authorRenato Golin <rengolin@systemcall.eu>
Thu, 6 Jun 2019 19:15:52 +0000 (19:15 +0000)
committerRenato Golin <rengolin@systemcall.eu>
Thu, 6 Jun 2019 19:15:52 +0000 (19:15 +0000)
commit04351b7a7aabce9d1b5671c50ff7754e546571d6
tree54d467c682b30200838f39baca20302d14c03e15
parent3d1f1eb0455a6b169b1cbf9af755dcf7416300d2
[LV] Wrap LV illegality reporting in a function. NFC.

A function for loop vectorization illegality reporting has been
introduced:

void LoopVectorizationLegality::reportVectorizationFailure(
    const StringRef DebugMsg, const StringRef OREMsg,
    const StringRef ORETag, Instruction * const I) const;

The function prints a debug message when the debug for the compilation
unit is enabled as well as invokes the optimization report emitter to
generate a message with a specified tag. The function doesn't cover any
complicated logic when a custom lambda should be passed to the emitter,
only generating a message with a tag is supported.

The function always prints the instruction `I` after the debug message
whenever the instruction is specified, otherwise the debug message
ends with a dot: 'LV: Not vectorizing: Disabled/already vectorized.'

Patch by Pavel Samolysov <samolisov@gmail.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@362736 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Transforms/Vectorize/LoopVectorizationLegality.h
lib/Transforms/Vectorize/LoopVectorizationLegality.cpp