Skip to content

Commit 1a3a71a

Browse files
svenvhsys-ce-bb
authored andcommitted
Move away from some more insert-before constructors; NFC (#2514)
In preparation for LLVM's deprecation of Instruction constructors and Create methods that accept `Instruction` pointers, upgrade call sites to pass an iterator instead of an `Instruction` pointer. Original commit: KhronosGroup/SPIRV-LLVM-Translator@3c1ff53d6202f02
1 parent f4d4004 commit 1a3a71a

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

llvm-spirv/lib/SPIRV/SPIRVLowerBool.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ void SPIRVLowerBoolBase::visitTruncInst(TruncInst &I) {
7272
I.getIterator());
7373
And->setDebugLoc(I.getDebugLoc());
7474
auto *Zero = getScalarOrVectorConstantInt(Op->getType(), 0, false);
75-
auto *Cmp = new ICmpInst(&I, CmpInst::ICMP_NE, And, Zero);
75+
auto *Cmp = new ICmpInst(I.getIterator(), CmpInst::ICMP_NE, And, Zero);
7676
replace(&I, Cmp);
7777
}
7878
}

llvm-spirv/lib/SPIRV/SPIRVToOCL20.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ void SPIRVToOCL20Base::visitCallSPIRVAtomicCmpExchg(CallInst *CI) {
207207
// instructions returns this new/original value as a resulting value.
208208
AllocaInst *PExpected = new AllocaInst(
209209
MemTy, 0, "expected",
210-
&*CI->getParent()->getParent()->getEntryBlock().getFirstInsertionPt());
210+
CI->getParent()->getParent()->getEntryBlock().getFirstInsertionPt());
211211
PExpected->setAlignment(Align(MemTy->getScalarSizeInBits() / 8));
212212

213213
// Tail call implies that the callee doesn't access alloca from the caller.

llvm-spirv/lib/SPIRV/SPIRVUtil.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2274,7 +2274,7 @@ bool postProcessBuiltinWithArrayArguments(Function *F,
22742274
auto *T = I->getType();
22752275
if (!T->isArrayTy())
22762276
continue;
2277-
auto *Alloca = new AllocaInst(T, 0, "", &(*FBegin));
2277+
auto *Alloca = new AllocaInst(T, 0, "", FBegin);
22782278
new StoreInst(I, Alloca, false, CI->getIterator());
22792279
auto *Zero =
22802280
ConstantInt::getNullValue(Type::getInt32Ty(T->getContext()));

0 commit comments

Comments
 (0)