[LoopUnroll] Prevent LoopFullUnrollPass to perform partial/runtime unrolling
authorYashwant Singh <Yashwant.Singh@amd.com>
Thu, 13 Apr 2023 04:19:40 +0000 (09:49 +0530)
committerYashwant Singh <Yashwant.Singh@amd.com>
Thu, 13 Apr 2023 04:51:24 +0000 (10:21 +0530)
commitaea2a147363197f3cef140ebcd27b534fd41877b
tree4f5dbbd133b9eab289275c851d314e200022657d
parent18bfc92aac4fc382ca41c235dea3b61481996171
[LoopUnroll] Prevent LoopFullUnrollPass to perform partial/runtime unrolling

FullLoopUnroll was performing runtime unrolling in certain cases when
'#pragma unroll' was specified. Patch to fix this by introducing new parameter
to tryToUnrollLoop() to differentiate between LoopUnrollPass and
FullLoopUnrollPass. Based on the discussion here
(https://discourse.llvm.org/t/loop-unroller-fails-to-unroll-loop/69834)

Reviewed By: nikic

Differential Revision: https://reviews.llvm.org/D148071
llvm/lib/Transforms/Scalar/LoopUnrollPass.cpp
llvm/test/Transforms/LoopUnroll/full-unroll-avoid-partial.ll [new file with mode: 0644]
llvm/test/Transforms/LoopUnroll/revisit.ll