X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=test%2FCodeGen%2FX86%2F2006-01-19-ISelFoldingBug.ll;h=f6b5b2c103fe448e7b2db65e482f75c000577bde;hb=1e3da044d8926d800ab44bfd8c265c29e2d21752;hp=4dc9165434dd3fb34b087217d9412a0bba6375ba;hpb=52b8b5982f8e795ebf89c289619d1feee13cf63f;p=oota-llvm.git diff --git a/test/CodeGen/X86/2006-01-19-ISelFoldingBug.ll b/test/CodeGen/X86/2006-01-19-ISelFoldingBug.ll index 4dc9165434d..f6b5b2c103f 100644 --- a/test/CodeGen/X86/2006-01-19-ISelFoldingBug.ll +++ b/test/CodeGen/X86/2006-01-19-ISelFoldingBug.ll @@ -1,15 +1,20 @@ -; RUN: llvm-as < %s | llc -march=x86 | grep 'shld' | wc -l | grep 1 +; RUN: llc < %s -march=x86 -mcpu=generic | \ +; RUN: grep shld | count 1 ; ; Check that the isel does not fold the shld, which already folds a load ; and has two uses, into a store. -%A = external global uint -uint %test5(uint %B, ubyte %C) { - %tmp.1 = load uint *%A; - %tmp.2 = shl uint %tmp.1, ubyte %C - %tmp.3 = sub ubyte 32, %C - %tmp.4 = shr uint %B, ubyte %tmp.3 - %tmp.5 = or uint %tmp.4, %tmp.2 - store uint %tmp.5, uint* %A - ret uint %tmp.5 +@A = external global i32 ; [#uses=2] + +define i32 @test5(i32 %B, i8 %C) { + %tmp.1 = load i32, i32* @A ; [#uses=1] + %shift.upgrd.1 = zext i8 %C to i32 ; [#uses=1] + %tmp.2 = shl i32 %tmp.1, %shift.upgrd.1 ; [#uses=1] + %tmp.3 = sub i8 32, %C ; [#uses=1] + %shift.upgrd.2 = zext i8 %tmp.3 to i32 ; [#uses=1] + %tmp.4 = lshr i32 %B, %shift.upgrd.2 ; [#uses=1] + %tmp.5 = or i32 %tmp.4, %tmp.2 ; [#uses=2] + store i32 %tmp.5, i32* @A + ret i32 %tmp.5 } +