OSDN Git Service

[CGP] Limit distance between overflow math and cmp
authorSam Parker <sam.parker@arm.com>
Mon, 11 Mar 2019 13:19:46 +0000 (13:19 +0000)
committerSam Parker <sam.parker@arm.com>
Mon, 11 Mar 2019 13:19:46 +0000 (13:19 +0000)
commit64ecbb6debdc7023f37f7f0f0b53b98b969a5674
tree5ef36ddab1fa0edd2c284da52e1f875d3ea3e7c4
parentb6c96952b72f8b280b69ca7436303673a6ced8f1
[CGP] Limit distance between overflow math and cmp

Inserting an overflowing arithmetic intrinsic can increase register
pressure by producing two values at a point where only one is needed,
while the second use maybe several blocks away. This increase in
pressure is likely to be more detrimental on performance than
rematerialising one of the original instructions.

So, check that the arithmetic and compare instructions are no further
apart than their immediate successor/predecessor.

Differential Revision: https://reviews.llvm.org/D59024

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355823 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/CodeGenPrepare.cpp
test/Transforms/CodeGenPrepare/ARM/overflow-intrinsics.ll [new file with mode: 0644]