Skip to content

Commit 0f734eb

Browse files
committed
Revert "fixup! Turn llvm-simdloop into a loop pass"
This reverts commit 0cfa740a5f224ab0de070e0d31c11d7f6ed16669.
1 parent c0cf78d commit 0f734eb

File tree

2 files changed

+9
-23
lines changed

2 files changed

+9
-23
lines changed

src/llvm-simdloop.cpp

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -169,19 +169,8 @@ static bool processLoop(Loop &L, OptimizationRemarkEmitter &ORE) JL_NOTSAFEPOINT
169169
BasicBlock *Lh = L.getHeader();
170170
LLVM_DEBUG(dbgs() << "LSL: loop header: " << *Lh << "\n");
171171

172-
if (LoopID->getNumOperands() <= 1) {
173-
LLVM_DEBUG(dbgs() << "LSL: Returning early due to few operands" << *LoopID << "\n");
174-
return false;
175-
}
176-
MDNode *MDs = dyn_cast<MDNode>(LoopID->getOperand(1));
177-
178-
if (!MDs) {
179-
LLVM_DEBUG(dbgs() << "LSL: Returning early due to no Metadata attached" << *LoopID << "\n");
180-
return false;
181-
}
182-
183-
for (unsigned i = 0, ie = MDs->getNumOperands(); i < ie; ++i) {
184-
Metadata *Op = MDs->getOperand(i);
172+
for (unsigned i = 0, ie = LoopID->getNumOperands(); i < ie; ++i) {
173+
Metadata *Op = LoopID->getOperand(i);
185174
const MDString *S = dyn_cast<MDString>(Op);
186175
if (S) {
187176
LLVM_DEBUG(dbgs() << "LSL: found " << S->getString() << "\n");

test/llvmpasses/simdloop.ll

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ loop:
2121
store double %cval, double *%bptr
2222
%nexti = add i64 %i, 1
2323
%done = icmp sgt i64 %nexti, 500
24-
br i1 %done, label %loopdone, label %loop, !llvm.loop !2
24+
br i1 %done, label %loopdone, label %loop, !llvm.loop !1
2525
loopdone:
2626
ret void
2727
}
@@ -40,7 +40,7 @@ loop:
4040
; CHECK: fsub reassoc contract double %v, %aval
4141
%nexti = add i64 %i, 1
4242
%done = icmp sgt i64 %nexti, 500
43-
br i1 %done, label %loopdone, label %loop, !llvm.loop !2
43+
br i1 %done, label %loopdone, label %loop, !llvm.loop !1
4444
loopdone:
4545
ret double %nextv
4646
}
@@ -79,17 +79,14 @@ for.body: ; preds = %for.body, %entry
7979
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
8080
%exitcond = icmp eq i64 %indvars.iv.next, 48
8181
; CHECK: br {{.*}} !llvm.loop [[LOOP:![0-9]+]]
82-
br i1 %exitcond, label %for.end, label %for.body, !llvm.loop !4
82+
br i1 %exitcond, label %for.end, label %for.body, !llvm.loop !2
8383

8484
for.end: ; preds = %for.body
8585
%1 = load i32, i32* %a, align 4
8686
ret i32 %1
8787
}
8888

89-
!0 = distinct !{!0, !1}
90-
!1 = !{!"julia.simdloop"}
91-
!2 = distinct !{!2, !3}
92-
!3 = !{!"julia.simdloop", !"julia.ivdep"}
93-
!4 = distinct !{!4, !5}
94-
!5 = !{!"julia.simdloop", !"julia.ivdep", !6}
95-
!6 = !{!"llvm.loop.vectorize.disable", i1 0}
89+
!0 = distinct !{!0, !"julia.simdloop"}
90+
!1 = distinct !{!1, !"julia.simdloop", !"julia.ivdep"}
91+
!2 = distinct !{!2, !"julia.simdloop", !"julia.ivdep", !3}
92+
!3 = !{!"llvm.loop.vectorize.disable", i1 0}

0 commit comments

Comments
 (0)