[PATCH] D78749: [CodeExtractor] Fix extraction of a value used only by intrinsics outside of region
Vedant Kumar via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Apr 23 14:07:48 PDT 2020
vsk added inline comments.
================
Comment at: llvm/lib/Transforms/Utils/CodeExtractor.cpp:454
if (IntrInst) {
if (IntrInst->getIntrinsicID() == Intrinsic::lifetime_start) {
// Do not handle the case where Addr has multiple start markers.
----------------
Could you add a comment: // We don't model addresses with multiple start/end markers, but the markers do not need to be in the region.
================
Comment at: llvm/lib/Transforms/Utils/CodeExtractor.cpp:455
if (IntrInst->getIntrinsicID() == Intrinsic::lifetime_start) {
// Do not handle the case where Addr has multiple start markers.
if (Info.LifeStart)
----------------
^ then we can delete this comment about 'multiple start markers'
================
Comment at: llvm/lib/Transforms/Utils/CodeExtractor.cpp:467
}
- continue;
+ if (isa<DbgInfoIntrinsic>(IntrInst))
+ continue;
----------------
Could you add a comment: // At this point, permit debug uses outside of the region, this is fixed in \ref fixupDebugInfoPostExtraction.
================
Comment at: llvm/test/Transforms/CodeExtractor/LoopExtractor_alloca.ll:2
+; RUN: opt -loop-extract -S < %s | FileCheck %s
+
+; This tests 2 cases:
----------------
It looks like -loop-extract behaves like a ModulePass. If that's right, this test should pass if you add a RUN line like: `RUN: opt -debugify-each -loop-extract ... | FileCheck %s`.
This would just add synthetic debug uses before -loop-extract and strip them away afterwards, the final IR should look identical (if there are no bugs w.r.t handling debug uses).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D78749/new/
https://reviews.llvm.org/D78749
More information about the llvm-commits
mailing list