llvm.org GIT mirror llvm / 0b4d96b
PR10077: fix fast-isel of extractvalue of aggregate constants. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132676 91177308-0d34-0410-b5e6-96231b3b80d8 Eli Friedman 8 years ago
2 changed file(s) with 14 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
840840 DenseMap::iterator I = FuncInfo.ValueMap.find(Op0);
841841 if (I != FuncInfo.ValueMap.end())
842842 ResultReg = I->second;
843 else if (isa(Op0))
844 ResultReg = FuncInfo.InitializeRegForValue(Op0);
843845 else
844 ResultReg = FuncInfo.InitializeRegForValue(Op0);
846 return false; // fast-isel can't handle aggregate constants at the moment
845847
846848 // Get the actual result register, which is an offset from the base register.
847849 unsigned VTIndex = ComputeLinearIndex(AggTy, EVI->idx_begin(), EVI->idx_end());
0 ; RUN: llc < %s -march=x86-64 -O0 | FileCheck %s
1 ; Make sure fast-isel doesn't screw up aggregate constants.
2 ; (Failing out is okay, as long as we don't miscompile.)
3
4 %bar = type { i32 }
5
6 define i32 @foo() {
7 %tmp = extractvalue %bar { i32 3 }, 0
8 ret i32 %tmp
9 ; CHECK: movl $3, %eax
10 }