[PATCH] Fix a bug around truncating vector in const prop

Hal Finkel hfinkel at anl.gov
Wed Aug 20 13:22:14 PDT 2014


LGTM.

 -Hal

----- Original Message -----
> From: "Jiangning Liu" <liujiangning1 at gmail.com>
> To: "llvm-commits at cs.uiuc.edu for LLVM" <llvm-commits at cs.uiuc.edu>
> Sent: Monday, August 18, 2014 12:04:30 AM
> Subject: [PATCH] Fix a bug around truncating vector in const prop
> 
> 
> 
> Hi,
> 
> Attached patch is to fix a bug around truncating vector in const
> prop.
> 
> The problem is quite straightforward as exposed by the test case.
> 
> In constant folding stage, "TRUNC" can't handle vector data type, and
> all other operands like ZExt/SExt/PtrToInt... can't handle vector
> data type either. In theory, I think it can, but it would be a
> separate fix other than current one. If I add comments before the
> fix, it would highlight this TRUNC is different from others, and I
> think it would make code reader even confused.
> 
> For this case, the bitcast can't be optimized away, because it
> depends on endianess. If we want to fix this, it also needs a
> separate fix independent of current one.
> 
> If the operand is not a bitcast, other constant propagation pass
> should have covered it.
> 
> Thanks,
> -Jiangning
> 
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
> 

-- 
Hal Finkel
Assistant Computational Scientist
Leadership Computing Facility
Argonne National Laboratory



More information about the llvm-commits mailing list