summaryrefslogtreecommitdiffstats
path: root/lldb/packages/Python/lldbsuite/test/commands/gui/basic/TestGuiBasic.py
diff options
context:
space:
mode:
authorSanjay Patel <spatel@rotateright.com>2019-10-15 15:23:57 +0000
committerSanjay Patel <spatel@rotateright.com>2019-10-15 15:23:57 +0000
commitd545c9056e00988d2d146f8f1440b2dd192f306b (patch)
tree0d688949f278c727605fefed671b867d104b6d8c /lldb/packages/Python/lldbsuite/test/commands/gui/basic/TestGuiBasic.py
parentb18170660e726cc97caa35cb0c406db184d4a8a2 (diff)
downloadbcm5719-llvm-d545c9056e00988d2d146f8f1440b2dd192f306b.tar.gz
bcm5719-llvm-d545c9056e00988d2d146f8f1440b2dd192f306b.zip
[DAGCombiner] fold select-of-constants based on sign-bit test
Examples: i32 X > -1 ? C1 : -1 --> (X >>s 31) | C1 i8 X < 0 ? C1 : 0 --> (X >>s 7) & C1 This is a small generalization of a fold requested in PR43650: https://bugs.llvm.org/show_bug.cgi?id=43650 The sign-bit of the condition operand can be used as a mask for the true operand: https://rise4fun.com/Alive/paT Note that we already handle some of the patterns (isNegative + scalar) because there's an over-specialized, yet over-reaching fold for that in foldSelectCCToShiftAnd(). It doesn't use any TLI hooks, so I can't easily rip out that code even though we're duplicating part of it here. This fold is guarded by TLI.convertSelectOfConstantsToMath(), so it should not cause problems for targets that prefer select over shift. Also worth noting: I thought we could generalize this further to include the case where the true operand of the select is not constant, but Alive says that may allow poison to pass through where it does not in the original select form of the code. Differential Revision: https://reviews.llvm.org/D68949 llvm-svn: 374902
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test/commands/gui/basic/TestGuiBasic.py')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud