summaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/HardwareLoops.cpp
diff options
context:
space:
mode:
authorFangrui Song <i@maskray.me>2024-10-11 21:39:06 -0700
committerAmir Ayupov <aaupov@fb.com>2024-10-11 21:39:06 -0700
commit436701d88c1384d3f72c44dd152cd55e47ef2de3 (patch)
treec9825a370f1ba14e5fff19cea1279a0e7a7e9b54 /llvm/lib/CodeGen/HardwareLoops.cpp
parentefa1900174cb940f3750ce9e8cb6f06e69b4f3f0 (diff)
parentdd326b122506421aba2368053103767f4c56e2ba (diff)
[𝘀𝗽𝗿] changes introduced through rebaseusers/aaupov/spr/main.boltnfc-speedup-batwritemaps
Created using spr 1.3.4 [skip ci]
Diffstat (limited to 'llvm/lib/CodeGen/HardwareLoops.cpp')
-rw-r--r--llvm/lib/CodeGen/HardwareLoops.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/llvm/lib/CodeGen/HardwareLoops.cpp b/llvm/lib/CodeGen/HardwareLoops.cpp
index 9205eabcf568..c8a63304a3b6 100644
--- a/llvm/lib/CodeGen/HardwareLoops.cpp
+++ b/llvm/lib/CodeGen/HardwareLoops.cpp
@@ -512,7 +512,7 @@ Value* HardwareLoop::InsertIterationSetup(Value *LoopCountInit) {
: Intrinsic::test_set_loop_iterations)
: (UsePhi ? Intrinsic::start_loop_iterations
: Intrinsic::set_loop_iterations);
- Function *LoopIter = Intrinsic::getDeclaration(M, ID, Ty);
+ Function *LoopIter = Intrinsic::getOrInsertDeclaration(M, ID, Ty);
Value *LoopSetup = Builder.CreateCall(LoopIter, LoopCountInit);
// Use the return value of the intrinsic to control the entry of the loop.
@@ -541,9 +541,8 @@ void HardwareLoop::InsertLoopDec() {
Attribute::StrictFP))
CondBuilder.setIsFPConstrained(true);
- Function *DecFunc =
- Intrinsic::getDeclaration(M, Intrinsic::loop_decrement,
- LoopDecrement->getType());
+ Function *DecFunc = Intrinsic::getOrInsertDeclaration(
+ M, Intrinsic::loop_decrement, LoopDecrement->getType());
Value *Ops[] = { LoopDecrement };
Value *NewCond = CondBuilder.CreateCall(DecFunc, Ops);
Value *OldCond = ExitBranch->getCondition();
@@ -566,9 +565,8 @@ Instruction* HardwareLoop::InsertLoopRegDec(Value *EltsRem) {
Attribute::StrictFP))
CondBuilder.setIsFPConstrained(true);
- Function *DecFunc =
- Intrinsic::getDeclaration(M, Intrinsic::loop_decrement_reg,
- { EltsRem->getType() });
+ Function *DecFunc = Intrinsic::getOrInsertDeclaration(
+ M, Intrinsic::loop_decrement_reg, {EltsRem->getType()});
Value *Ops[] = { EltsRem, LoopDecrement };
Value *Call = CondBuilder.CreateCall(DecFunc, Ops);