mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-12 01:25:10 +00:00
Don't trivially delete unused calls to llvm.invariant.start. This allows
llvm.invariant.start to be used without necessarily being paired with a call to llvm.invariant.end. If you run the entire optimization pipeline then such calls are in fact deleted (adce does it), but that's actually a good thing since we probably do want them to be zapped late in the game. There should really be an integration test that checks that the llvm.invariant.start call lasts long enough that all passes that do interesting things with it get to do their stuff before it is deleted. But since no passes do anything interesting with it yet this will have to wait for later. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86840 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -252,6 +252,9 @@ bool llvm::isInstructionTriviallyDead(Instruction *I) {
|
||||
// We don't want debug info removed by anything this general.
|
||||
if (isa<DbgInfoIntrinsic>(I)) return false;
|
||||
|
||||
// Likewise for memory use markers.
|
||||
if (isa<MemoryUseIntrinsic>(I)) return false;
|
||||
|
||||
if (!I->mayHaveSideEffects()) return true;
|
||||
|
||||
// Special case intrinsics that "may have side effects" but can be deleted
|
||||
|
Reference in New Issue
Block a user