- User Since
- Aug 6 2019, 8:30 AM (10 w, 1 d)
fix typo of patch description
Rethink about this issue and the root cause should be caused by use_empty. Just resubmitted the patch with "[InlineFunction] Erase use_empty allocas when inline".
- Remove the check for use_empty in the outer loop.
- Add a check for !use_empty in the inner loop.
- Remove the inner loop (i.e only splice one alloca at a time).
Alternative 3 would be the simplest. If there really is a speedup on doing fewer splices, then alternative 2 still moves consequtive !use_empty allocas in batches. The idea with alternative 2 is to split batches on allocas that has no uses (as they are handled in the outer loop). Alternative 1 might work assuming that allocas with no uses are cleaned up somewhere else. But I think this alternative is the least interesting one.
Fri, Oct 11
So the root cause is rather that we treat an alloca being immediately preceeded by another alloca differrently from the case when it is preceeded by another kind of instruction. This happens also when having other instructions in between, and is not specific to dbg intrinsics (could be interesting to add a test case where you replace the dbg intrinsics by something else).
Yes I think so, if the other instruction is not dbg instr which exist between two allocas, the InlineFunction with and without "-strip-debug" will make the same behavior, that should both erase second use_empty alloca. This patch is to fix the issue that debug instr impact InlineFunction generate different output.
Thu, Oct 10
- Use BasicBlock::iterator skipDebugIntrinsics instead of rolling directly. The recommend API BasicBlock:: instructionsWithoutDebug() looks not very suitable to handle llvm::Instruction in this code.
- follow llvm style, condition: break first, then unconditionally execute the code
[inline] skip dbg info when scan allocas
Tue, Oct 8
just added updated test, could some one help to review again? thanks.
Added one more RUN command line with "-debugify-each" in existed call-guard.ll, needn't duplicate another same test case file.
Wed, Sep 25
thanks for review. add test case with --debugify-each based on previous call-guard.ll
Tue, Sep 24
[InstCombine] Fix call guard difference with dbg
Sep 2 2019
update branch-folder-with-debug.mir follow the review comments
- update CHECK block lines before successors check
- Add "CHECK-NEXT" for successors after block
- Simplify address after successors block
- move RUN line to top and add more descriptions.
Aug 27 2019
@djtodoro thanks for review, followed your comments and guide from https://llvm.org/docs/MIRLangRef.html#id14, I have simplified mir test code by removing all unnecessary code for FileCheck.
"llc -o - test.mir -mtriple=x86_64-- -run-pass=branch-folder | FileCheck test.mir"
Simplify MIR test case
Aug 26 2019
add branch-folder-with-debug.mir test
Aug 21 2019
Please allow me to add Hsiangkai and Petar as reviewer, as you had contributed related patches about debug and CFI instruction skipping. Thanks.
thanks for review and comments. While adding test code, found another error about "unnamed alloca" before branch-folder by llc, I'll investigate the issue before submit the test code.