Skip to content

Commit b42d245

Browse files
authored
[GVNHoist] Replace combineKnownMetadata with combineMetadataForCSE (#92197)
There is no reason to call combineMetadata directly with a list of MD_ nodes. The combineMetadataForCSE function handles all the metadata correctly Partially fixes: #30866
1 parent da116bd commit b42d245

File tree

1 file changed

+1
-13
lines changed

1 file changed

+1
-13
lines changed

llvm/lib/Transforms/Scalar/GVNHoist.cpp

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -238,18 +238,6 @@ class CallInfo {
238238
const VNtoInsns &getStoreVNTable() const { return VNtoCallsStores; }
239239
};
240240

241-
static void combineKnownMetadata(Instruction *ReplInst, Instruction *I) {
242-
static const unsigned KnownIDs[] = {LLVMContext::MD_tbaa,
243-
LLVMContext::MD_alias_scope,
244-
LLVMContext::MD_noalias,
245-
LLVMContext::MD_range,
246-
LLVMContext::MD_fpmath,
247-
LLVMContext::MD_invariant_load,
248-
LLVMContext::MD_invariant_group,
249-
LLVMContext::MD_access_group};
250-
combineMetadata(ReplInst, I, KnownIDs, true);
251-
}
252-
253241
// This pass hoists common computations across branches sharing common
254242
// dominator. The primary goal is to reduce the code size, and in some
255243
// cases reduce critical path (by exposing more ILP).
@@ -996,8 +984,8 @@ unsigned GVNHoist::rauw(const SmallVecInsn &Candidates, Instruction *Repl,
996984
MSSAUpdater->removeMemoryAccess(OldMA);
997985
}
998986

987+
combineMetadataForCSE(Repl, I, true);
999988
Repl->andIRFlags(I);
1000-
combineKnownMetadata(Repl, I);
1001989
I->replaceAllUsesWith(Repl);
1002990
// Also invalidate the Alias Analysis cache.
1003991
MD->removeInstruction(I);

0 commit comments

Comments
 (0)