This is an archive of the discontinued LLVM Phabricator instance.

[TTI] BasicTTIImpl assumes no vector registers
ClosedPublic

Authored by jingyue on Jul 10 2015, 1:56 PM.

Details

Summary

Following the discussion on r241884, it's more reasonable to assume that a
target has no vector registers by default instead of letting every such
target overrides getNumberOfRegisters.

Therefore, this patch modifies BasicTTIImpl::getNumberOfRegisters to
return 0 when Vector is true, and partially reverts r241884 which
modifies NVPTXTTIImpl::getNumberOfRegisters.

It also fixes a performance bug in LoopVectorizer. Even if a target has
no vector registers, vectorization may still help ILP. So, we need both
checks to be false before disabling loop vectorization all together.

Diff Detail

Event Timeline

jingyue updated this revision to Diff 29491.Jul 10 2015, 1:56 PM
jingyue updated this revision to Diff 29492.
jingyue retitled this revision from to [TTI] BasicTTIImpl assumes no vector registers.
jingyue updated this object.
jingyue added a reviewer: hfinkel.
jingyue added subscribers: jholewinski, llvm-commits.

describe tests

hfinkel accepted this revision.Jul 10 2015, 2:00 PM
hfinkel edited edge metadata.

LGTM.

This revision is now accepted and ready to land.Jul 10 2015, 2:00 PM

Hal, I didn't change TargetTransformInfoImplBase::getNumberOfRegisters because many tests under LoopVectorize depends on NoTTI to have vector registers.

Hal, I didn't change TargetTransformInfoImplBase::getNumberOfRegisters because many tests under LoopVectorize depends on NoTTI to have vector registers.

Yea, I figured it was not testable ;)

jingyue closed this revision.Jul 10 2015, 2:14 PM