1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 19:23:23 +01:00

DataFlowSanitizer: correctly combine labels in the case where they are equal.

llvm-svn: 189133
This commit is contained in:
Peter Collingbourne 2013-08-23 18:45:06 +00:00
parent 760e1c3011
commit a2ec50d21b
2 changed files with 6 additions and 5 deletions

View File

@ -775,7 +775,7 @@ Value *DataFlowSanitizer::combineShadows(Value *V1, Value *V2,
BasicBlock *Tail = BI->getSuccessor(0);
PHINode *Phi = PHINode::Create(ShadowTy, 2, "", Tail->begin());
Phi->addIncoming(Call, Call->getParent());
Phi->addIncoming(ZeroShadow, Head);
Phi->addIncoming(V1, Head);
Pos = Phi;
return Phi;
} else {

View File

@ -3,11 +3,12 @@ target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f3
define i8 @add(i8 %a, i8 %b) {
; CHECK: @"dfs$add"
; CHECK: load{{.*}}__dfsan_arg_tls
; CHECK: load{{.*}}__dfsan_arg_tls
; CHECK: call{{.*}}__dfsan_union
; CHECK-DAG: %[[ALABEL:.*]] = load{{.*}}__dfsan_arg_tls, i64 0, i64 0
; CHECK-DAG: %[[BLABEL:.*]] = load{{.*}}__dfsan_arg_tls, i64 0, i64 1
; CHECK: %[[UNION:.*]] = call{{.*}}__dfsan_union(i16 zeroext %[[ALABEL]], i16 zeroext %[[BLABEL]])
; CHECK: %[[ADDLABEL:.*]] = phi i16 [ %[[UNION]], {{.*}} ], [ %[[ALABEL]], {{.*}} ]
; CHECK: add i8
; CHECK: store{{.*}}__dfsan_retval_tls
; CHECK: store i16 %[[ADDLABEL]], i16* @__dfsan_retval_tls
; CHECK: ret i8
%c = add i8 %a, %b
ret i8 %c