[LLVMdev] poison and select
    Adve, Vikram Sadanand 
    vadve at illinois.edu
       
    Wed Sep 10 13:54:06 PDT 2014
    
    
  
On Sep 10, 2014, at 6:38 PM, <llvmdev-request at cs.uiuc.edu>
 wrote:
>> While the documentation may not match the facts on the ground,?InstructionSimplify does (in my opinion) the
>> right thing; an undef operand doesn't mean the entire SelectInst folds away to undef:
>> http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/InstructionSimplify.cpp?revision=217342&view=m
>> arkup#l2880
> 
> It seems pretty clear that this is the right semantics for select.
> 
> If we believe the documentation, then select is only useful when we can 
> prove that it won't introduce a spurious poison value. This will not often 
> be the case.
> 
> I'll go file a bug against the LLVM instruction reference to remind 
> someone to tweak the doc. My proposed fix would be:
> 
> * Values other than phi nodes and select instructions depend on their 
> operands.
> 
> * Phi nodes depend on the operand corresponding to their dynamic 
> predecessor basic block.
> 
> * Select instructions depend on their selected operand.
Doesn't a select instruction also depend on the predicate (boolean) value?
> 
> John
--Vikram Adve
Professor, Department of Computer Science
University of Illinois at Urbana-Champaign
vadve at illinois.edu
http://llvm.org
    
    
More information about the llvm-dev
mailing list