llvm.org GIT mirror llvm / 4590b8c
[msan] Propagate origin for insertvalue, extractvalue. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194374 91177308-0d34-0410-b5e6-96231b3b80d8 Evgeniy Stepanov 7 years ago
2 changed file(s) with 28 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
20582058 Value *ResShadow = IRB.CreateExtractValue(AggShadow, I.getIndices());
20592059 DEBUG(dbgs() << " ResShadow: " << *ResShadow << "\n");
20602060 setShadow(&I, ResShadow);
2061 setOrigin(&I, getCleanOrigin());
2061 setOriginForNaryOp(I);
20622062 }
20632063
20642064 void visitInsertValueInst(InsertValueInst &I) {
20712071 Value *Res = IRB.CreateInsertValue(AggShadow, InsShadow, I.getIndices());
20722072 DEBUG(dbgs() << " Res: " << *Res << "\n");
20732073 setShadow(&I, Res);
2074 setOrigin(&I, getCleanOrigin());
2074 setOriginForNaryOp(I);
20752075 }
20762076
20772077 void dumpInst(Instruction &I) {
774774 ; CHECK-AA: call void @llvm.memcpy.p0i8.p0i8.i64(i8* {{.*}}, i8* {{.*}}, i64 2, i32 2, i1 false)
775775 ; CHECK-AA: ret i16
776776
777
778 ; Test origin propagation for insertvalue
779
780 define { i64, i32 } @make_pair_64_32(i64 %x, i32 %y) sanitize_memory {
781 entry:
782 %a = insertvalue { i64, i32 } undef, i64 %x, 0
783 %b = insertvalue { i64, i32 } %a, i32 %y, 1
784 ret { i64, i32 } %b
785 }
786
787 ; CHECK-ORIGINS: @make_pair_64_32
788 ; First element shadow
789 ; CHECK-ORIGINS: insertvalue { i64, i32 } { i64 -1, i32 -1 }, i64 {{.*}}, 0
790 ; First element origin
791 ; CHECK-ORIGINS: icmp ne i64
792 ; CHECK-ORIGINS: select i1
793 ; First element app value
794 ; CHECK-ORIGINS: insertvalue { i64, i32 } undef, i64 {{.*}}, 0
795 ; Second element shadow
796 ; CHECK-ORIGINS: insertvalue { i64, i32 } {{.*}}, i32 {{.*}}, 1
797 ; Second element origin
798 ; CHECK-ORIGINS: icmp ne i32
799 ; CHECK-ORIGINS: select i1
800 ; Second element app value
801 ; CHECK-ORIGINS: insertvalue { i64, i32 } {{.*}}, i32 {{.*}}, 1
802 ; CHECK-ORIGINS: ret { i64, i32 }