forked from llvm-mirror/llvm
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make sure DAGCombiner doesn't introduce multiple loads from the same …
…memory location. PR10747, part 2. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147283 91177308-0d34-0410-b5e6-96231b3b80d8
- Loading branch information
1 parent
c9a1aed
commit d6e2560
Showing
3 changed files
with
44 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
test/CodeGen/X86/2011-12-26-extractelement-duplicate-load.ll
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
; RUN: llc -march=x86-64 -mattr=-sse42,+sse41 < %s | FileCheck %s | ||
; Make sure we don't load from the location pointed to by %p | ||
; twice: it has non-obvious performance implications, and | ||
; the relevant transformation doesn't know how to update | ||
; the chains correctly. | ||
; PR10747 | ||
|
||
; CHECK: test: | ||
; CHECK: pextrd $2, %xmm | ||
define <4 x i32> @test(<4 x i32>* %p) { | ||
%v = load <4 x i32>* %p | ||
%e = extractelement <4 x i32> %v, i32 2 | ||
%cmp = icmp eq i32 %e, 3 | ||
%sel = select i1 %cmp, <4 x i32> %v, <4 x i32> zeroinitializer | ||
ret <4 x i32> %sel | ||
} |