diff options
| author | Yingwei Zheng <dtcxzyw2333@gmail.com> | 2024-02-26 01:53:16 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-02-26 01:53:16 +0800 |
| commit | ac9e67756e0157793d565c2cceaf82e4403f58ba (patch) | |
| tree | c00ff65317aafc7aed184fc3f94d576cc367d865 /mlir/lib/Bytecode/Reader/BytecodeReader.cpp | |
| parent | d99b1481770e4f8454c7f238dcd40c8e977e6b70 (diff) | |
| download | llvm-ac9e67756e0157793d565c2cceaf82e4403f58ba.zip llvm-ac9e67756e0157793d565c2cceaf82e4403f58ba.tar.gz llvm-ac9e67756e0157793d565c2cceaf82e4403f58ba.tar.bz2 | |
[ValueTracking][NFC] Early exit when enumerating guaranteed well-defined/non-poison operands. (#82812)
According to the [coverage
result](https://dtcxzyw.github.io/llvm-opt-benchmark/coverage/home/dtcxzyw/llvm-project/llvm/lib/Analysis/ValueTracking.cpp.html#L7193)
on my benchmark, `llvm::mustTriggerUB` returns true with an average of
35.0M/12.3M=2.85 matches. I think we can stop enumerating when one of
the matches succeeds to avoid filling the temporary buffer
`NonPoisonOps`.
This patch introduces two template functions
`handleGuaranteedWellDefinedOps/handleGuaranteedNonPoisonOps`. They will
pass well-defined/non-poison operands to inlinable callbacks `Handle`.
If the callback returns true, stop processing and return true.
Otherwise, return false.
Compile-time improvement:
https://llvm-compile-time-tracker.com/compare.php?from=13acb3af5ad48e850cf37dcf02270ede3f267bd4&to=2b55f513c1b6dd2732cb79a25f3eaf6c5e4d6619&stat=instructions:u
|stage1-O3|stage1-ReleaseThinLTO|stage1-ReleaseLTO-g|stage1-O0-g|stage2-O3|stage2-O0-g|stage2-clang|
|--|--|--|--|--|--|--|
|-0.03%|-0.04%|-0.06%|-0.03%|-0.05%|+0.03%|-0.02%|
Diffstat (limited to 'mlir/lib/Bytecode/Reader/BytecodeReader.cpp')
0 files changed, 0 insertions, 0 deletions
