1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-22 18:54:02 +01:00

After a custom inserter, in a block which has constant instructions,

update the current basic block in addition to the current insert
position, so that they remain consistent. This fixes rdar://8204072.

llvm-svn: 108765
This commit is contained in:
Dan Gohman 2010-07-19 22:48:56 +00:00
parent b2ad0066f5
commit 28f747a608
2 changed files with 17 additions and 0 deletions

View File

@ -276,6 +276,7 @@ std::pair<unsigned, bool> FastISel::getRegForGEPIndex(const Value *Idx) {
void FastISel::recomputeInsertPt() {
if (getLastLocalValue()) {
FuncInfo.InsertPt = getLastLocalValue();
FuncInfo.MBB = FuncInfo.InsertPt->getParent();
++FuncInfo.InsertPt;
} else
FuncInfo.InsertPt = FuncInfo.MBB->getFirstNonPHI();

View File

@ -0,0 +1,16 @@
; RUN: llc < %s -O0 -march=x86-64
; rdar://8204072
@sc = external global i8
@uc = external global i8
declare i8 @llvm.atomic.load.and.i8.p0i8(i8* nocapture, i8) nounwind
define void @test_fetch_and_op() nounwind {
entry:
%tmp40 = call i8 @llvm.atomic.load.and.i8.p0i8(i8* @sc, i8 11) ; <i8> [#uses=1]
store i8 %tmp40, i8* @sc
%tmp41 = call i8 @llvm.atomic.load.and.i8.p0i8(i8* @uc, i8 11) ; <i8> [#uses=1]
store i8 %tmp41, i8* @uc
ret void
}