[llvm] [SandboxVec][InstrInterval] Add ArrayRef constructor (PR #109357)
Sriraman Tallam via llvm-commits
llvm-commits at lists.llvm.org
Fri Sep 20 15:52:05 PDT 2024
================
@@ -80,6 +80,17 @@ class InstrInterval {
assert((FromI == ToI || FromI->comesBefore(ToI)) &&
"FromI should come before TopI!");
}
+ InstrInterval(ArrayRef<Instruction *> Instrs) {
+ assert(!Instrs.empty() && "Expected non-empty Instrs!");
+ FromI = Instrs[0];
+ ToI = Instrs[0];
+ for (auto *I : drop_begin(Instrs)) {
+ if (I->comesBefore(FromI))
+ FromI = I;
+ if (ToI->comesBefore(I))
----------------
tmsri wrote:
else if here? Either FromI moves or ToI moves but not both.
https://github.com/llvm/llvm-project/pull/109357
More information about the llvm-commits
mailing list