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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189133 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Peter Collingbourne 2013-08-23 18:45:06 +00:00
parent 003f551912
commit f3c0314310
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