<div dir="ltr">I am working on a project that uses integer vectors fairly extensively. Some values in the vectors came from constant pointers cast to 64-bit integers, and the LLVM optimizer would often end up folding values into instructions that looked like this:<div><br></div><div>store <2 x i64> <i64 ptrtoint (... constant_pointer_value ... to i64), i64 0>, <2 x i64>* %f<br></div><div><br></div><div>ExecutionEngine would assert at runtime on all instructions like this because ExecutionEngine::getConstantValue assumes all vector constants are "simple constants" whose values are ConstantInts, not handling the case of ConstantExpr. This patch fixes that issue and works as intended from the limited scope of my project.</div><div><br></div><div>Though it certainly appears that this issue exists for other types besides Integer and for other aggregate constant types, I purposely kept my patch small given my limited exposure to LLVM internals.</div><div><br></div><div>Bret Taylor</div><div><br></div></div>