fix a latent bug my inline asm stuff exposed:
authorChris Lattner <sabre@nondot.org>
Wed, 7 Apr 2010 18:03:19 +0000 (18:03 +0000)
committerChris Lattner <sabre@nondot.org>
Wed, 7 Apr 2010 18:03:19 +0000 (18:03 +0000)
MachineOperand::isIdenticalTo wasn't handling metadata operands.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100636 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/MachineInstr.cpp
test/CodeGen/X86/crash.ll

index 39b7fb507f8b1335b0a6d2e8c2898fc2a1588d98..f2ba484e4f0af5aefacb31469e2afdfb16536136 100644 (file)
@@ -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();
   }
 }
 
index 4b7c85099389b79835e86ad0617834a624793612..312d15f6d58565add68c7a9442bf330bef525c53 100644 (file)
@@ -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}