summaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/CodeGenPrepare.cpp
diff options
context:
space:
mode:
authorJeremy Morse <jeremy.morse@sony.com>2023-09-11 19:56:15 +0100
committerJeremy Morse <jeremy.morse@sony.com>2023-09-11 20:01:19 +0100
commite54277fa109081e0f98a8cd3e0110fb89a5b7d60 (patch)
tree354eedafb831b7f4fcd617ac9591e9310cc0fa79 /llvm/lib/CodeGen/CodeGenPrepare.cpp
parentd7acc6e23f69a22969a9139d6a91e022280c2c37 (diff)
[NFC][RemoveDIs] Use iterators over inst-pointers when using IRBuilder
This patch adds a two-argument SetInsertPoint method to IRBuilder that takes a block/iterator instead of an instruction, and updates many call sites to use it. The motivating reason for doing this is given here [0], we'd like to pass around more information about the position of debug-info in the iterator object. That necessitates passing iterators around most of the time. [0] https://discourse.llvm.org/t/rfc-instruction-api-changes-needed-to-eliminate-debug-intrinsics-from-ir/68939 Differential Revision: https://reviews.llvm.org/D152468
Diffstat (limited to 'llvm/lib/CodeGen/CodeGenPrepare.cpp')
-rw-r--r--llvm/lib/CodeGen/CodeGenPrepare.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/CodeGenPrepare.cpp b/llvm/lib/CodeGen/CodeGenPrepare.cpp
index 3bfcb566a807..f07fc4fc52bf 100644
--- a/llvm/lib/CodeGen/CodeGenPrepare.cpp
+++ b/llvm/lib/CodeGen/CodeGenPrepare.cpp
@@ -2263,7 +2263,7 @@ static bool despeculateCountZeros(IntrinsicInst *CountZeros,
// Create a PHI in the end block to select either the output of the intrinsic
// or the bit width of the operand.
- Builder.SetInsertPoint(&EndBlock->front());
+ Builder.SetInsertPoint(EndBlock, EndBlock->begin());
PHINode *PN = Builder.CreatePHI(Ty, 2, "ctz");
replaceAllUsesWith(CountZeros, PN, FreshBBs, IsHugeFunc);
Value *BitWidth = Builder.getInt(APInt(SizeInBits, SizeInBits));