diff options
author | Vedant Kumar <vsk@apple.com> | 2018-08-22 18:15:03 +0000 |
---|---|---|
committer | Vedant Kumar <vsk@apple.com> | 2018-08-22 18:15:03 +0000 |
commit | a85ca3de66e7c52ed96323c6decc16458312042d (patch) | |
tree | ca17f96a5f91270b77de7b21f53996af24a93107 /llvm/lib | |
parent | 9cee1adc1a0f8f40cb3722db07066000ff0c35b4 (diff) | |
download | bcm5719-llvm-a85ca3de66e7c52ed96323c6decc16458312042d.tar.gz bcm5719-llvm-a85ca3de66e7c52ed96323c6decc16458312042d.zip |
[CodeGenPrepare] Set debug locs when folding a comparison into a uadd.with.overflow
CGP can replace a branch + select with a uadd.with.overflow. Teach it to
set debug locations as it does this.
llvm-svn: 340432
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/CodeGen/CodeGenPrepare.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/CodeGenPrepare.cpp b/llvm/lib/CodeGen/CodeGenPrepare.cpp index 37afed449f7..d3cbec736da 100644 --- a/llvm/lib/CodeGen/CodeGenPrepare.cpp +++ b/llvm/lib/CodeGen/CodeGenPrepare.cpp @@ -1164,11 +1164,15 @@ static bool CombineUAddWithOverflow(CmpInst *CI) { auto *InsertPt = AddI->hasOneUse() ? CI : AddI; + DebugLoc Loc = CI->getDebugLoc(); auto *UAddWithOverflow = CallInst::Create(F, {A, B}, "uadd.overflow", InsertPt); + UAddWithOverflow->setDebugLoc(Loc); auto *UAdd = ExtractValueInst::Create(UAddWithOverflow, 0, "uadd", InsertPt); + UAdd->setDebugLoc(Loc); auto *Overflow = ExtractValueInst::Create(UAddWithOverflow, 1, "overflow", InsertPt); + Overflow->setDebugLoc(Loc); CI->replaceAllUsesWith(Overflow); AddI->replaceAllUsesWith(UAdd); |