diff options
author | Vedant Kumar <vsk@apple.com> | 2018-08-21 23:43:08 +0000 |
---|---|---|
committer | Vedant Kumar <vsk@apple.com> | 2018-08-21 23:43:08 +0000 |
commit | 30406fd7894e57e2cda9401fad59cc7e8c655e6e (patch) | |
tree | 976022380935b325a859b4d722f65f467c04f8db /llvm/lib/CodeGen/CodeGenPrepare.cpp | |
parent | 8d652b756e33b6deb4e469ac7494d0967a22aab7 (diff) | |
download | bcm5719-llvm-30406fd7894e57e2cda9401fad59cc7e8c655e6e.tar.gz bcm5719-llvm-30406fd7894e57e2cda9401fad59cc7e8c655e6e.zip |
[CodeGenPrepare] Clean up dbg.value use-before-def as late as possible
CodeGenPrepare has a strategy for moving dbg.values so that a value's
definition always dominates its debug users. This cleanup was happening
too early (before certain CGP transforms were run), resulting in some
dbg.value use-before-def errors.
Perform this cleanup as late as possible to avoid use-before-def.
llvm-svn: 340370
Diffstat (limited to 'llvm/lib/CodeGen/CodeGenPrepare.cpp')
-rw-r--r-- | llvm/lib/CodeGen/CodeGenPrepare.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/llvm/lib/CodeGen/CodeGenPrepare.cpp b/llvm/lib/CodeGen/CodeGenPrepare.cpp index 7d7d48b12ce..fd26345b41d 100644 --- a/llvm/lib/CodeGen/CodeGenPrepare.cpp +++ b/llvm/lib/CodeGen/CodeGenPrepare.cpp @@ -426,11 +426,6 @@ bool CodeGenPrepare::runOnFunction(Function &F) { // unconditional branch. EverMadeChange |= eliminateMostlyEmptyBlocks(F); - // llvm.dbg.value is far away from the value then iSel may not be able - // handle it properly. iSel will drop llvm.dbg.value if it can not - // find a node corresponding to the value. - EverMadeChange |= placeDbgValues(F); - if (!DisableBranchOpts) EverMadeChange |= splitBranchCondition(F); @@ -518,6 +513,10 @@ bool CodeGenPrepare::runOnFunction(Function &F) { EverMadeChange |= simplifyOffsetableRelocate(*I); } + // Do this last to clean up use-before-def scenarios introduced by other + // preparatory transforms. + EverMadeChange |= placeDbgValues(F); + return EverMadeChange; } |