forked from OSchip/llvm-project
[x86] Fix a bug in the auto-upgrade from r276416 where we failed to give
a sufficiently low alignment for the IR load created. There is no test case because we don't have any test cases for the *IR* produced by the autoupgrade, only the x86 assembly, and it happens that the x86 assembly for this intrinsic as it is tested in the autoupgrade path just happens to not produce a separate load instruction where we might have observed the alignment. I'm going to follow up on the original commit to suggest getting IR-level testing in addition to the asm level testing here so that we can see and test these kinds of issues. We might never get an x86 instruction out with an alignment constraint, but we could stil miscompile code by folding against the alignment marked on (or inferred for in this case) the load. llvm-svn: 278203
This commit is contained in:
parent
4c5e8ccf74
commit
0215e76836
|
@ -951,7 +951,7 @@ void llvm::UpgradeIntrinsicCall(CallInst *CI, Function *NewFn) {
|
|||
Type *VT = VectorType::get(EltTy, NumSrcElts);
|
||||
Value *Op = Builder.CreatePointerCast(CI->getArgOperand(0),
|
||||
PointerType::getUnqual(VT));
|
||||
Value *Load = Builder.CreateLoad(VT, Op);
|
||||
Value *Load = Builder.CreateAlignedLoad(Op, 1);
|
||||
if (NumSrcElts == 2)
|
||||
Rep = Builder.CreateShuffleVector(Load, UndefValue::get(Load->getType()),
|
||||
{ 0, 1, 0, 1 });
|
||||
|
|
Loading…
Reference in New Issue