diff options
author | Roman Lebedev <lebedev.ri@gmail.com> | 2020-01-04 16:31:18 +0300 |
---|---|---|
committer | Roman Lebedev <lebedev.ri@gmail.com> | 2020-01-04 17:30:51 +0300 |
commit | 4d8e47ca180557e9bb872da0b8a6ad0fc515c4d3 (patch) | |
tree | 86641891351593d9410c876031ab79265b63ab91 /llvm/lib/Transforms/Utils/LoopUtils.cpp | |
parent | 83aa0b6734da6760890012fc0ea08698741541a5 (diff) | |
download | llvm-4d8e47ca180557e9bb872da0b8a6ad0fc515c4d3.zip llvm-4d8e47ca180557e9bb872da0b8a6ad0fc515c4d3.tar.gz llvm-4d8e47ca180557e9bb872da0b8a6ad0fc515c4d3.tar.bz2 |
[InstCombine] Sink sub into hands of select if one hand becomes zero (PR44426)
This decreases use count of %Op1, makes one hand of select to be 0,
and possibly exposes further folding potential.
Name: sub (select %Cond, %Op1, %FalseVal), %Op1 -> select %Cond, 0, (sub %FalseVal, %Op1)
%Op1 = %TrueVal
%o = select i1 %Cond, i8 %Op1, i8 %FalseVal
%r = sub i8 %o, %Op1
=>
%n = sub i8 %FalseVal, %Op1
%r = select i1 %Cond, i8 0, i8 %n
Name: sub (select %Cond, %TrueVal, %Op1), %Op1 -> select %Cond, (sub %TrueVal, %Op1), 0
%Op1 = %FalseVal
%o = select i1 %Cond, i8 %TrueVal, i8 %Op1
%r = sub i8 %o, %Op1
=>
%n = sub i8 %TrueVal, %Op1
%r = select i1 %Cond, i8 %n, i8 0
https://rise4fun.com/Alive/avL
https://bugs.llvm.org/show_bug.cgi?id=44426
Diffstat (limited to 'llvm/lib/Transforms/Utils/LoopUtils.cpp')
0 files changed, 0 insertions, 0 deletions