Yingwei Zheng
62e9f40949
[PatternMatch] Use m_SpecificCmp matchers. NFC. ( #100878 )
...
Compile-time improvement:
http://llvm-compile-time-tracker.com/compare.php?from=13996378d81c8fa9a364aeaafd7382abbc1db83a&to=861ffa4ec5f7bde5a194a7715593a1b5359eb581&stat=instructions:u
baseline: 803eaf29267c6aae9162d1a83a4a2ae508b440d3
```
Top 5 improvements:
stockfish/movegen.ll 2541620819 2538599412 -0.12%
minetest/profiler.cpp.ll 431724935 431246500 -0.11%
abc/luckySwap.c.ll 581173720 580581935 -0.10%
abc/kitTruth.c.ll 2521936288 2519445570 -0.10%
abc/extraUtilTruth.c.ll 1216674614 1215495502 -0.10%
Top 5 regressions:
openssl/libcrypto-shlib-sm4.ll 1155054721 1155943201 +0.08%
openssl/libcrypto-lib-sm4.ll 1155054838 1155943063 +0.08%
spike/vsm4r_vv.ll 1296430080 1297039258 +0.05%
spike/vsm4r_vs.ll 1312496906 1313093460 +0.05%
nuttx/lib_rand48.c.ll 126201233 126246692 +0.04%
Overall: -0.02112308%
```
2024-07-29 10:04:06 +08:00
Nikita Popov
9df71d7673
[IR] Add getDataLayout() helpers to Function and GlobalValue ( #96919 )
...
Similar to https://github.com/llvm/llvm-project/pull/96902 , this adds
`getDataLayout()` helpers to Function and GlobalValue, replacing the
current `getParent()->getDataLayout()` pattern.
2024-06-28 08:36:49 +02:00
Stephen Tozer
d75f9dd1d2
Revert "[IR][NFC] Update IRBuilder to use InsertPosition ( #96497 )"
...
Reverts the above commit, as it updates a common header function and
did not update all callsites:
https://lab.llvm.org/buildbot/#/builders/29/builds/382
This reverts commit 6481dc57612671ebe77fe9c34214fba94e1b3b27.
2024-06-24 18:00:22 +01:00
Stephen Tozer
6481dc5761
[IR][NFC] Update IRBuilder to use InsertPosition ( #96497 )
...
Uses the new InsertPosition class (added in #94226 ) to simplify some of
the IRBuilder interface, and removes the need to pass a BasicBlock
alongside a BasicBlock::iterator, using the fact that we can now get the
parent basic block from the iterator even if it points to the sentinel.
This patch removes the BasicBlock argument from each constructor or call
to setInsertPoint.
This has no functional effect, but later on as we look to remove the
`Instruction *InsertBefore` argument from instruction-creation
(discussed
[here](https://discourse.llvm.org/t/psa-instruction-constructors-changing-to-iterator-only-insertion/77845 )),
this will simplify the process by allowing us to deprecate the
InsertPosition constructor directly and catch all the cases where we use
instructions rather than iterators.
2024-06-24 17:27:43 +01:00
Jeremy Morse
e54277fa10
[NFC][RemoveDIs] Use iterators over inst-pointers when using IRBuilder
...
This patch adds a two-argument SetInsertPoint method to IRBuilder that
takes a block/iterator instead of an instruction, and updates many call
sites to use it. The motivating reason for doing this is given here [0],
we'd like to pass around more information about the position of debug-info
in the iterator object. That necessitates passing iterators around most of
the time.
[0] https://discourse.llvm.org/t/rfc-instruction-api-changes-needed-to-eliminate-debug-intrinsics-from-ir/68939
Differential Revision: https://reviews.llvm.org/D152468
2023-09-11 20:01:19 +01:00
serge-sans-paille
ed98c1b376
Cleanup includes: DebugInfo & CodeGen
...
Discourse thread: https://discourse.llvm.org/t/include-what-you-use-include-cleanup
Differential Revision: https://reviews.llvm.org/D121332
2022-03-12 17:26:40 +01:00
serge-sans-paille
59630917d6
Cleanup includes: Transform/Scalar
...
Estimated impact on preprocessor output line:
before: 1062981579
after: 1062494547
Discourse thread: https://discourse.llvm.org/t/include-what-you-use-include-cleanup
Differential Revision: https://reviews.llvm.org/D120817
2022-03-03 07:56:34 +01:00
Kazu Hirata
0b9a610a75
[Transforms] Use default member initialization in ConditionInfo (NFC)
2022-02-13 10:34:00 -08:00
Jingu Kang
4c98070cce
[LoopBoundSplit] Handle the case in which exiting block is loop header
...
Update the incoming value of phi nodes in header of post-loop correctly.
Differential Revision: https://reviews.llvm.org/D110060
2021-10-08 09:13:41 +01:00
Jingu Kang
4288b6520a
[LoopBoundSplit] Use SCEVAddRecExpr instead of SCEV for AddRecSCEV (NFC)
...
Differential Revision: https://reviews.llvm.org/D109682
2021-10-04 10:17:44 +01:00
Jingu Kang
2a26d47a2d
[LoopBoundSplit] Check the start value of split cond AddRec
...
After transformation, we assume the split condition of the pre-loop is always
true. In order to guarantee it, we need to check the start value of the split
cond AddRec satisfies the split condition.
Differential Revision: https://reviews.llvm.org/D109354
2021-09-13 10:32:35 +01:00
Jingu Kang
562521e2d1
[LoopBoundSplit] Update phi node in exit block
...
It fixes https://bugs.llvm.org/show_bug.cgi?id=51700
Differential Revision:
2021-09-03 09:10:50 +01:00
Jingu Kang
8eee02020b
[LoopBoundSplit] Ignore phi node which is not scevable
...
There was a bug in LoopBoundSplit. The pass should ignore phi node which is not
scevable.
Differential Revision: https://reviews.llvm.org/D103913
2021-06-09 09:44:36 +01:00
Jingu Kang
a2a0ac42ab
[SimpleLoopBoundSplit] Split Bound of Loop which has conditional branch with IV
...
This pass transforms loops that contain a conditional branch with induction
variable. For example, it transforms left code to right code:
newbound = min(n, c)
while (iv < n) { while(iv < newbound) {
A A
if (iv < c) B
B C
C }
} if (iv != n) {
while (iv < n) {
A
C
}
}
Differential Revision: https://reviews.llvm.org/D102234
2021-06-07 10:55:25 +01:00