diff options
-rw-r--r-- | llvm/lib/CodeGen/MachineInstr.cpp | 2 | ||||
-rw-r--r-- | llvm/test/CodeGen/X86/crash.ll | 16 |
2 files changed, 18 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/MachineInstr.cpp b/llvm/lib/CodeGen/MachineInstr.cpp index 39b7fb507f8..f2ba484e4f0 100644 --- a/llvm/lib/CodeGen/MachineInstr.cpp +++ b/llvm/lib/CodeGen/MachineInstr.cpp @@ -192,6 +192,8 @@ bool MachineOperand::isIdenticalTo(const MachineOperand &Other) const { return getBlockAddress() == Other.getBlockAddress(); case MachineOperand::MO_MCSymbol: return getMCSymbol() == Other.getMCSymbol(); + case MachineOperand::MO_Metadata: + return getMetadata() == Other.getMetadata(); } } diff --git a/llvm/test/CodeGen/X86/crash.ll b/llvm/test/CodeGen/X86/crash.ll index 4b7c8509938..312d15f6d58 100644 --- a/llvm/test/CodeGen/X86/crash.ll +++ b/llvm/test/CodeGen/X86/crash.ll @@ -92,3 +92,19 @@ foo: } +; Crash commoning identical asms. +define void @test6(i1 %C) nounwind optsize ssp { +entry: + br i1 %C, label %do.body55, label %do.body92 + +do.body55: ; preds = %if.else36 + call void asm sideeffect "foo", "~{dirflag},~{fpsr},~{flags}"() nounwind, !srcloc !0 + ret void + +do.body92: ; preds = %if.then66 + call void asm sideeffect "foo", "~{dirflag},~{fpsr},~{flags}"() nounwind, !srcloc !1 + ret void +} + +!0 = metadata !{i32 633550} +!1 = metadata !{i32 634261} |