Avoid copying KnownBits objects in some cases where we can move them or
use a slightly simpler constructor instead. NFC.
I found these cases by temporarily deleting KnownBits's copy constructor
and copy assignment operator.
Paths
| Differential D74539
[KnownBits] Avoid copying KnownBits objects AbandonedPublic Authored by foad on Feb 13 2020, 2:47 AM.
Details
Summary Avoid copying KnownBits objects in some cases where we can move them or I found these cases by temporarily deleting KnownBits's copy constructor
Diff Detail
Unit TestsFailed
Event TimelineComment Actions
No, I was just doing it as a kind of drive-by clean-up, since @bjope expressed some concern that we might be copying these objects too much in comments on D74482.
foad marked an inline comment as done. foad added inline comments.
Revision Contents
Diff 244373 llvm/lib/Analysis/ValueTracking.cpp
llvm/lib/CodeGen/GlobalISel/GISelKnownBits.cpp
llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp
|
Not sure about the std::move but using BitWidth makes sense to me.