mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-24 23:28:41 +00:00
GVN: Preserve invariant.load metadata
If both instructions to be replaced are marked invariant the resulting instruction is invariant. rdar://13358910 Fix by Erik Eckstein! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211801 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -1798,6 +1798,10 @@ static void patchReplacementInstruction(Instruction *I, Value *Repl) {
|
||||
case LLVMContext::MD_fpmath:
|
||||
ReplInst->setMetadata(Kind, MDNode::getMostGenericFPMath(IMD, ReplMD));
|
||||
break;
|
||||
case LLVMContext::MD_invariant_load:
|
||||
// Only set the !invariant.load if it is present in both instructions.
|
||||
ReplInst->setMetadata(Kind, IMD);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user