[PATCH] D30177: [ExecutionDepsFix] Recognize existing dep breaks

Keno Fischer via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 20 11:29:03 PST 2017


loladiro created this revision.

Teach ExecutionDepsFix to recognize instructions that are already
register-dependency breaking. This is done in preparation of being
more conservative in clearance assumptions at function entry/after
function calls. In this situation, this commit gives us two benefits:

1. It reduces the number of inserted dependency breaks, by reusing those that already exist (at the moment we assume all registers have significant clerance at function entry, so basically any unused register can be used for undef reads - this will no longer be the case after the above mentioned change)

2. It provides a simple way to test the clearance calculation code. Right now, those tests assume that all registers have large clearance at function entry. Further, while there is a way to forcably clobber register clearance (e.g. by using inline assembly), without this change, there is no easy way to clear register clearance again. This commit provides a way to do so (since LLVM materializes constant 0s in registers using dependency breaking instructions). E.g. the LLVM IR `fcmp ult double %x, 0.0`, will force such an instruction (assuming that %x is unknown).


https://reviews.llvm.org/D30177

Files:
  include/llvm/Target/TargetInstrInfo.h
  lib/CodeGen/ExecutionDepsFix.cpp
  lib/Target/X86/X86InstrInfo.cpp
  lib/Target/X86/X86InstrInfo.h
  test/CodeGen/X86/break-false-dep.ll
  test/CodeGen/X86/known-bits-vector.ll
  test/CodeGen/X86/vec_int_to_fp.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D30177.89138.patch
Type: text/x-patch
Size: 6634 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170220/d33a8860/attachment.bin>


More information about the llvm-commits mailing list