[all-commits] [llvm/llvm-project] aa0b92: [GlobalISel][IRTranslator] Move line zero DebugLoc...
Amara Emerson via All-commits
all-commits at lists.llvm.org
Wed Apr 28 23:54:45 PDT 2021
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: aa0b9200e8c5dea43c9ada2085a3061f4da70802
https://github.com/llvm/llvm-project/commit/aa0b9200e8c5dea43c9ada2085a3061f4da70802
Author: Amara Emerson <amara at apple.com>
Date: 2021-04-28 (Wed, 28 Apr 2021)
Changed paths:
M llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp
Log Message:
-----------
[GlobalISel][IRTranslator] Move line zero DebugLoc creation to constant translation. NFC.
This is a compile time optimization. DILocation:get() is expensive to call, and
we were calling it to create a line zero debug loc for *every* instruction we
translated. We only really need to do this just before we build constants in the
entry block, so I moved this code there. This reduces the LLVM -O0 codegen time
of sqlite3 IR by around 0.7% instructions executed and by about ~2% in CPU time.
We can probably do better with a more involved change, since the reason we need
to create one for each new constant is because we're using the debug scope and
inlined-at loc. If we just use a single instruction's scope and drop the
inlined-at, we can just cache these and have them be free.
More information about the All-commits
mailing list