Skip to content

Commit 04224d1

Browse files
authored
[InferAddressSpaces] Register pass. (#65639)
InferAddressSpaces failed to call its initialization function. It was still called through initializeScalarOpts in llc and opt, but it was skipped entirely in clang. When the initialization function is not called, this results in confusing behavior where the pass appears to run, but not entirely as it should, e.g. the pass is excluded from -print-before-all and -print-after-all.
1 parent 4bba12f commit 04224d1

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

llvm/lib/Transforms/Scalar/InferAddressSpaces.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,8 +165,12 @@ class InferAddressSpaces : public FunctionPass {
165165
static char ID;
166166

167167
InferAddressSpaces()
168-
: FunctionPass(ID), FlatAddrSpace(UninitializedAddressSpace) {}
169-
InferAddressSpaces(unsigned AS) : FunctionPass(ID), FlatAddrSpace(AS) {}
168+
: FunctionPass(ID), FlatAddrSpace(UninitializedAddressSpace) {
169+
initializeInferAddressSpacesPass(*PassRegistry::getPassRegistry());
170+
}
171+
InferAddressSpaces(unsigned AS) : FunctionPass(ID), FlatAddrSpace(AS) {
172+
initializeInferAddressSpacesPass(*PassRegistry::getPassRegistry());
173+
}
170174

171175
void getAnalysisUsage(AnalysisUsage &AU) const override {
172176
AU.setPreservesCFG();

0 commit comments

Comments
 (0)