[llvm] 94049db - [RISCV] Make computeIncomingVLVTYPE more conservative when merging predecessor state.
Craig Topper via llvm-commits
llvm-commits at lists.llvm.org
Mon Sep 19 15:58:05 PDT 2022
Author: Craig Topper
Date: 2022-09-19T15:57:55-07:00
New Revision: 94049db913af32c5dfd8a09d0ba100f070363bdf
URL: https://github.com/llvm/llvm-project/commit/94049db913af32c5dfd8a09d0ba100f070363bdf
DIFF: https://github.com/llvm/llvm-project/commit/94049db913af32c5dfd8a09d0ba100f070363bdf.diff
LOG: [RISCV] Make computeIncomingVLVTYPE more conservative when merging predecessor state.
If we have already calculated the incoming state before, use that
as our starting point to ensure we are conservative.
This fixes an infinite loop found in our downstream where we
we allowed two waves of updates to propagate through a loop and
the merge points allowed us to toggle back and forth between states.
No small reproducer right now.
Differential Revision: https://reviews.llvm.org/D134229
Added:
Modified:
llvm/lib/Target/RISCV/RISCVInsertVSETVLI.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Target/RISCV/RISCVInsertVSETVLI.cpp b/llvm/lib/Target/RISCV/RISCVInsertVSETVLI.cpp
index ade89e86cb753..187a1dcd2349d 100644
--- a/llvm/lib/Target/RISCV/RISCVInsertVSETVLI.cpp
+++ b/llvm/lib/Target/RISCV/RISCVInsertVSETVLI.cpp
@@ -1088,7 +1088,9 @@ void RISCVInsertVSETVLI::computeIncomingVLVTYPE(const MachineBasicBlock &MBB) {
BBInfo.InQueue = false;
- VSETVLIInfo InInfo;
+ // Start with the previous entry so that we keep the most conservative state
+ // we have ever found.
+ VSETVLIInfo InInfo = BBInfo.Pred;
if (MBB.pred_empty()) {
// There are no predecessors, so use the default starting status.
InInfo.setUnknown();
More information about the llvm-commits
mailing list