AMDGPU: Check for other defs when folding conditions into s_andn2_b64
authorMatt Arsenault <Matthew.Arsenault@amd.com>
Sat, 25 Jul 2020 00:13:04 +0000 (20:13 -0400)
committerMatt Arsenault <Matthew.Arsenault@amd.com>
Tue, 28 Jul 2020 20:36:23 +0000 (16:36 -0400)
commite9b236f411c5683d270a381bf810ba3c8f3ed12c
tree043af0aa9c195e7f26488d62286e58e51b5a9f9d
parente1dd212c874c2ff01b72e9e60db6dbded9e2e6d1
AMDGPU: Check for other defs when folding conditions into s_andn2_b64

We can't fold the masked compare value through the select if the
select condition is re-defed after the and instruction. Fixes a
verifier error and trying to use the outgoing value defined in the
block.

I'm not sure why this pass is bothering to handle physregs. It's
making this more complex and forces extra liveness computation.
llvm/lib/Target/AMDGPU/SIOptimizeExecMaskingPreRA.cpp
llvm/test/CodeGen/AMDGPU/optimize-exec-mask-pre-ra-loop-phi.mir [new file with mode: 0644]