[llvm-commits] [llvm] r155682 - in /llvm/trunk: lib/Analysis/ConstantFolding.cpp lib/VMCore/ConstantFold.cpp test/Other/constant-fold-gep.ll test/Transforms/SCCP/vector-bitcast.ll
NAKAMURA Takumi
geek4civic at gmail.com
Fri Apr 27 01:05:06 PDT 2012
Dan, excuse me, I have reverted it in r155699. stage1 clang crashes.
I will investigate and try generating minimal case later.
...Takumi
* x86_64-linux
Stack dump:
0. Program arguments:
/home/bb/buildslave/clang-3stage-x86_64-linux/builds/install/stage1/bin/clang-3.1
-cc1 -triple x86_64-unknown-linux-gnu -emit-obj -disable-free
-disable-llvm-verifier -main-file-name InlineSpiller.cpp -pic-level 2
-fmath-errno -masm-verbose -mconstructor-aliases -munwind-tables
-target-cpu x86-64 -momit-leaf-frame-pointer -coverage-file
/home/bb/buildslave/clang-3stage-x86_64-linux/builds/stagen/lib/CodeGen/Release/InlineSpiller.o
-resource-dir /home/bb/buildslave/clang-3stage-x86_64-linux/builds/install/stage1/bin/../lib/clang/3.2
-dependency-file
/home/bb/buildslave/clang-3stage-x86_64-linux/builds/stagen/lib/CodeGen/Release/InlineSpiller.d.tmp
-MP -MT /home/bb/buildslave/clang-3stage-x86_64-linux/builds/stagen/lib/CodeGen/Release/InlineSpiller.o
-MT /home/bb/buildslave/clang-3stage-x86_64-linux/builds/stagen/lib/CodeGen/Release/InlineSpiller.d
-D NDEBUG -D _GNU_SOURCE -D __STDC_CONSTANT_MACROS -D
__STDC_FORMAT_MACROS -D __STDC_LIMIT_MACROS -I
/home/bb/buildslave/clang-3stage-x86_64-linux/builds/stagen/include -I
/home/bb/buildslave/clang-3stage-x86_64-linux/builds/stagen/lib/CodeGen
-I /home/bb/buildslave/clang-3stage-x86_64-linux/llvm-project/llvm/include
-I /home/bb/buildslave/clang-3stage-x86_64-linux/llvm-project/llvm/lib/CodeGen
-fmodule-cache-path /var/tmp/clang-module-cache -internal-isystem
/usr/lib/gcc/x86_64-redhat-linux6E/4.4.6/../../../../include/c++/4.4.6
-internal-isystem
/usr/lib/gcc/x86_64-redhat-linux6E/4.4.6/../../../../include/c++/4.4.6/x86_64-redhat-linux6E
-internal-isystem
/usr/lib/gcc/x86_64-redhat-linux6E/4.4.6/../../../../include/c++/4.4.6/backward
-internal-isystem /usr/local/include -internal-isystem
/home/bb/buildslave/clang-3stage-x86_64-linux/builds/install/stage1/bin/../lib/clang/3.2/include
-internal-externc-isystem /include -internal-externc-isystem
/usr/include -O3 -Woverloaded-virtual -Wcast-qual -Wno-long-long -Wall
-W -Wno-unused-parameter -Wwrite-strings -Wcovered-switch-default
-pedantic -fconst-strings -fdeprecated-macro -fdebug-compilation-dir
/home/bb/buildslave/clang-3stage-x86_64-linux/builds/stagen/lib/CodeGen
-ferror-limit 19 -fmessage-length 0 -fvisibility-inlines-hidden
-mstackrealign -fno-rtti -fgnu-runtime -fobjc-runtime-has-arc
-fobjc-runtime-has-weak -fobjc-fragile-abi -fdiagnostics-show-option
-o /home/bb/buildslave/clang-3stage-x86_64-linux/builds/stagen/lib/CodeGen/Release/InlineSpiller.o
-x c++ /home/bb/buildslave/clang-3stage-x86_64-linux/llvm-project/llvm/lib/CodeGen/InlineSpiller.cpp
1. <eof> parser at end of file
2. Per-module optimization passes
3. Running pass 'CallGraph Pass Manager' on module
'/home/bb/buildslave/clang-3stage-x86_64-linux/llvm-project/llvm/lib/CodeGen/InlineSpiller.cpp'.
4. Running pass 'Combine redundant instructions' on function
'@_ZN12_GLOBAL__N_113InlineSpiller17traceSiblingValueEjPN4llvm6VNInfoES3_'
clang-3: error: unable to execute command: Segmentation fault
clang-3: error: clang frontend command failed due to signal (use -v to
see invocation)
clang-3: note: diagnostic msg: Please submit a bug report to
http://llvm.org/bugs/ and include command line arguments and all
diagnostic information.
clang-3: note: diagnostic msg: Preprocessed source(s) and associated
run script(s) are located at:
clang-3: note: diagnostic msg: /tmp/InlineSpiller-dKzUYP.ii
clang-3: note: diagnostic msg: /tmp/InlineSpiller-dKzUYP.sh
/bin/rm: cannot remove
`/home/bb/buildslave/clang-3stage-x86_64-linux/builds/stagen/lib/CodeGen/Release/InlineSpiller.d.tmp':
No such file or directory
make[2]: *** [/home/bb/buildslave/clang-3stage-x86_64-linux/builds/stagen/lib/CodeGen/Release/InlineSpiller.o]
Error 1
*i686-cygwin
if /cygdrive/e/bb-cygwin/clang-3stage-cygwin/builds/install/stage1/bin/clang++
-I/cygdrive/e/bb-cygwin/clang-3stage-cygwin/builds/stagen/include
-I/cygdrive/e/bb-cygwin/clang-3stage-cygwin/builds/stagen/tools/clang/lib/StaticAnalyzer/Checkers
-I/cygdrive/e/bb-cygwin/clang-3stage-cygwin/llvm-project/clang/lib/StaticAnalyzer/Checkers
-I/cygdrive/e/bb-cygwin/clang-3stage-cygwin/llvm-project/llvm/include
-DNDEBUG -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS
-D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS
-I/cygdrive/e/bb-cygwin/clang-3stage-cygwin/llvm-project/clang/lib/StaticAnalyzer/Checkers/../../../include
-I/cygdrive/e/bb-cygwin/clang-3stage-cygwin/builds/stagen/tools/clang/lib/StaticAnalyzer/Checkers/../../../include
-O3 -fomit-frame-pointer -fvisibility-inlines-hidden -fno-exceptions
-fno-rtti -Woverloaded-virtual -Wcast-qual -fno-strict-aliasing
-pedantic -Wno-long-long -Wall -W -Wno-unused-parameter
-Wwrite-strings -Wcovered-switch-default -c -MMD -MP -MF
"/cygdrive/e/bb-cygwin/clang-3stage-cygwin/builds/stagen/tools/clang/lib/StaticAnalyzer/Checkers/Release/OSAtomicChecker.d.tmp"
-MT "/cygdrive/e/bb-cygwin/clang-3stage-cygwin/builds/stagen/tools/clang/lib/StaticAnalyzer/Checkers/Release/OSAtomicChecker.o"
-MT "/cygdrive/e/bb-cygwin/clang-3stage-cygwin/builds/stagen/tools/clang/lib/StaticAnalyzer/Checkers/Release/OSAtomicChecker.d"
/cygdrive/e/bb-cygwin/clang-3stage-cygwin/llvm-project/clang/lib/StaticAnalyzer/Checkers/OSAtomicChecker.cpp
-o /cygdrive/e/bb-cygwin/clang-3stage-cygwin/builds/stagen/tools/clang/lib/StaticAnalyzer/Checkers/Release/OSAtomicChecker.o
; \
then /usr/bin/mv -f
"/cygdrive/e/bb-cygwin/clang-3stage-cygwin/builds/stagen/tools/clang/lib/StaticAnalyzer/Checkers/Release/OSAtomicChecker.d.tmp"
"/cygdrive/e/bb-cygwin/clang-3stage-cygwin/builds/stagen/tools/clang/lib/StaticAnalyzer/Checkers/Release/OSAtomicChecker.d";
else /usr/bin/rm
"/cygdrive/e/bb-cygwin/clang-3stage-cygwin/builds/stagen/tools/clang/lib/StaticAnalyzer/Checkers/Release/OSAtomicChecker.d.tmp";
exit 1; fi
g++: /tmp/OSAtomicChecker-h45xIp.s: No such file or directory
g++: warning: '-x assembler' after last input file has no effect
g++: no input files
clang: error: assembler (via gcc) command failed with exit code 1 (use
-v to see invocation)
/usr/bin/rm: cannot remove
`/cygdrive/e/bb-cygwin/clang-3stage-cygwin/builds/stagen/tools/clang/lib/StaticAnalyzer/Checkers/Release/OSAtomicChecker.d.tmp':
No such file or directory
/cygdrive/e/bb-cygwin/clang-3stage-cygwin/llvm-project/llvm/Makefile.rules:1588:
recipe for target
`/cygdrive/e/bb-cygwin/clang-3stage-cygwin/builds/stagen/tools/clang/lib/StaticAnalyzer/Checkers/Release/OSAtomicChecker.o'
failed
make[5]: *** [/cygdrive/e/bb-cygwin/clang-3stage-cygwin/builds/stagen/tools/clang/lib/StaticAnalyzer/Checkers/Release/OSAtomicChecker.o]
Error 1
if /cygdrive/e/bb-cygwin/clang-3stage-cygwin/builds/install/stage1/bin/clang++
-I/cygdrive/e/bb-cygwin/clang-3stage-cygwin/builds/stagen/include
-I/cygdrive/e/bb-cygwin/clang-3stage-cygwin/builds/stagen/tools/clang/lib/StaticAnalyzer/Core
-I/cygdrive/e/bb-cygwin/clang-3stage-cygwin/llvm-project/clang/lib/StaticAnalyzer/Core
-I/cygdrive/e/bb-cygwin/clang-3stage-cygwin/llvm-project/llvm/include
-DNDEBUG -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS
-D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS
-I/cygdrive/e/bb-cygwin/clang-3stage-cygwin/llvm-project/clang/lib/StaticAnalyzer/Core/../../../include
-I/cygdrive/e/bb-cygwin/clang-3stage-cygwin/builds/stagen/tools/clang/lib/StaticAnalyzer/Core/../../../include
-O3 -fomit-frame-pointer -fvisibility-inlines-hidden -fno-exceptions
-fno-rtti -Woverloaded-virtual -Wcast-qual -fno-strict-aliasing
-pedantic -Wno-long-long -Wall -W -Wno-unused-parameter
-Wwrite-strings -Wcovered-switch-default -c -MMD -MP -MF
"/cygdrive/e/bb-cygwin/clang-3stage-cygwin/builds/stagen/tools/clang/lib/StaticAnalyzer/Core/Release/ExprEngine.d.tmp"
-MT "/cygdrive/e/bb-cygwin/clang-3stage-cygwin/builds/stagen/tools/clang/lib/StaticAnalyzer/Core/Release/ExprEngine.o"
-MT "/cygdrive/e/bb-cygwin/clang-3stage-cygwin/builds/stagen/tools/clang/lib/StaticAnalyzer/Core/Release/ExprEngine.d"
/cygdrive/e/bb-cygwin/clang-3stage-cygwin/llvm-project/clang/lib/StaticAnalyzer/Core/ExprEngine.cpp
-o /cygdrive/e/bb-cygwin/clang-3stage-cygwin/builds/stagen/tools/clang/lib/StaticAnalyzer/Core/Release/ExprEngine.o
; \
then /usr/bin/mv -f
"/cygdrive/e/bb-cygwin/clang-3stage-cygwin/builds/stagen/tools/clang/lib/StaticAnalyzer/Core/Release/ExprEngine.d.tmp"
"/cygdrive/e/bb-cygwin/clang-3stage-cygwin/builds/stagen/tools/clang/lib/StaticAnalyzer/Core/Release/ExprEngine.d";
else /usr/bin/rm
"/cygdrive/e/bb-cygwin/clang-3stage-cygwin/builds/stagen/tools/clang/lib/StaticAnalyzer/Core/Release/ExprEngine.d.tmp";
exit 1; fi
g++: /tmp/ExprEngine-OxZ1UZ.s: No such file or directory
g++: warning: '-x assembler' after last input file has no effect
g++: no input files
clang: error: assembler (via gcc) command failed with exit code 1 (use
-v to see invocation)
/usr/bin/rm: cannot remove
`/cygdrive/e/bb-cygwin/clang-3stage-cygwin/builds/stagen/tools/clang/lib/StaticAnalyzer/Core/Release/ExprEngine.d.tmp':
No such file or directory
/cygdrive/e/bb-cygwin/clang-3stage-cygwin/llvm-project/llvm/Makefile.rules:1588:
recipe for target
`/cygdrive/e/bb-cygwin/clang-3stage-cygwin/builds/stagen/tools/clang/lib/StaticAnalyzer/Core/Release/ExprEngine.o'
failed
make[5]: *** [/cygdrive/e/bb-cygwin/clang-3stage-cygwin/builds/stagen/tools/clang/lib/StaticAnalyzer/Core/Release/ExprEngine.o]
Error 1
2012/4/27 Dan Gohman <gohman at apple.com>:
> Author: djg
> Date: Thu Apr 26 19:54:36 2012
> New Revision: 155682
>
> URL: http://llvm.org/viewvc/llvm-project?rev=155682&view=rev
> Log:
> Use ConstantExpr::getExtractElement when constant-folding vectors
> instead of getAggregateElement. This has the advantage of being
> more consistent and allowing higher-level constant folding to
> procede even if an inner extract element cannot be folded.
>
> Make ConstantFoldInstruction call ConstantFoldConstantExpression
> on the instruction's operands, making it more consistent with
> ConstantFoldConstantExpression itself. This makes sure that
> ConstantExprs get TargetData-aware folding before being handed
> off as operands for further folding.
>
> This causes more expressions to be folded, but due to a known
> shortcoming in constant folding, this currently has the side effect
> of stripping a few more nuw and inbounds flags in the non-targetdata
> side of constant-fold-gep.ll. This is mostly harmless.
>
> This fixes rdar://11324230.
>
> Added:
> llvm/trunk/test/Transforms/SCCP/vector-bitcast.ll
> Modified:
> llvm/trunk/lib/Analysis/ConstantFolding.cpp
> llvm/trunk/lib/VMCore/ConstantFold.cpp
> llvm/trunk/test/Other/constant-fold-gep.ll
>
> Modified: llvm/trunk/lib/Analysis/ConstantFolding.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ConstantFolding.cpp?rev=155682&r1=155681&r2=155682&view=diff
> ==============================================================================
> --- llvm/trunk/lib/Analysis/ConstantFolding.cpp (original)
> +++ llvm/trunk/lib/Analysis/ConstantFolding.cpp Thu Apr 26 19:54:36 2012
> @@ -788,6 +788,10 @@
> CommonValue = C;
> }
>
> + // Fold the PHI's operands.
> + if (ConstantExpr *NewCE = dyn_cast<ConstantExpr>(CommonValue))
> + CommonValue = ConstantFoldConstantExpression(NewCE, TD, TLI);
> +
> // If we reach here, all incoming values are the same constant or undef.
> return CommonValue ? CommonValue : UndefValue::get(PN->getType());
> }
> @@ -795,12 +799,18 @@
> // Scan the operand list, checking to see if they are all constants, if so,
> // hand off to ConstantFoldInstOperands.
> SmallVector<Constant*, 8> Ops;
> - for (User::op_iterator i = I->op_begin(), e = I->op_end(); i != e; ++i)
> - if (Constant *Op = dyn_cast<Constant>(*i))
> - Ops.push_back(Op);
> - else
> + for (User::op_iterator i = I->op_begin(), e = I->op_end(); i != e; ++i) {
> + Constant *Op = dyn_cast<Constant>(*i);
> + if (!Op)
> return 0; // All operands not constant!
>
> + // Fold the Instruction's operands.
> + if (ConstantExpr *NewCE = dyn_cast<ConstantExpr>(Op))
> + Op = ConstantFoldConstantExpression(NewCE, TD, TLI);
> +
> + Ops.push_back(Op);
> + }
> +
> if (const CmpInst *CI = dyn_cast<CmpInst>(I))
> return ConstantFoldCompareInstOperands(CI->getPredicate(), Ops[0], Ops[1],
> TD, TLI);
>
> Modified: llvm/trunk/lib/VMCore/ConstantFold.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/ConstantFold.cpp?rev=155682&r1=155681&r2=155682&view=diff
> ==============================================================================
> --- llvm/trunk/lib/VMCore/ConstantFold.cpp (original)
> +++ llvm/trunk/lib/VMCore/ConstantFold.cpp Thu Apr 26 19:54:36 2012
> @@ -55,13 +55,12 @@
>
> Type *DstEltTy = DstTy->getElementType();
>
> - // Check to verify that all elements of the input are simple.
> SmallVector<Constant*, 16> Result;
> + Type *Ty = IntegerType::get(CV->getContext(), 32);
> for (unsigned i = 0; i != NumElts; ++i) {
> - Constant *C = CV->getAggregateElement(i);
> - if (C == 0) return 0;
> + Constant *C =
> + ConstantExpr::getExtractElement(CV, ConstantInt::get(Ty, i));
> C = ConstantExpr::getBitCast(C, DstEltTy);
> - if (isa<ConstantExpr>(C)) return 0;
> Result.push_back(C);
> }
>
> @@ -553,9 +552,12 @@
> SmallVector<Constant*, 16> res;
> VectorType *DestVecTy = cast<VectorType>(DestTy);
> Type *DstEltTy = DestVecTy->getElementType();
> - for (unsigned i = 0, e = V->getType()->getVectorNumElements(); i != e; ++i)
> - res.push_back(ConstantExpr::getCast(opc,
> - V->getAggregateElement(i), DstEltTy));
> + Type *Ty = IntegerType::get(V->getContext(), 32);
> + for (unsigned i = 0, e = V->getType()->getVectorNumElements(); i != e; ++i) {
> + Constant *C =
> + ConstantExpr::getExtractElement(V, ConstantInt::get(Ty, i));
> + res.push_back(ConstantExpr::getCast(opc, C, DstEltTy));
> + }
> return ConstantVector::get(res);
> }
>
> @@ -696,12 +698,13 @@
> // If the condition is a vector constant, fold the result elementwise.
> if (ConstantVector *CondV = dyn_cast<ConstantVector>(Cond)) {
> SmallVector<Constant*, 16> Result;
> + Type *Ty = IntegerType::get(CondV->getContext(), 32);
> for (unsigned i = 0, e = V1->getType()->getVectorNumElements(); i != e;++i){
> ConstantInt *Cond = dyn_cast<ConstantInt>(CondV->getOperand(i));
> if (Cond == 0) break;
>
> - Constant *Res = (Cond->getZExtValue() ? V1 : V2)->getAggregateElement(i);
> - if (Res == 0) break;
> + Constant *V = Cond->isNullValue() ? V2 : V1;
> + Constant *Res = ConstantExpr::getExtractElement(V, ConstantInt::get(Ty, i));
> Result.push_back(Res);
> }
>
> @@ -760,16 +763,16 @@
> const APInt &IdxVal = CIdx->getValue();
>
> SmallVector<Constant*, 16> Result;
> + Type *Ty = IntegerType::get(Val->getContext(), 32);
> for (unsigned i = 0, e = Val->getType()->getVectorNumElements(); i != e; ++i){
> if (i == IdxVal) {
> Result.push_back(Elt);
> continue;
> }
>
> - if (Constant *C = Val->getAggregateElement(i))
> - Result.push_back(C);
> - else
> - return 0;
> + Constant *C =
> + ConstantExpr::getExtractElement(Val, ConstantInt::get(Ty, i));
> + Result.push_back(C);
> }
>
> return ConstantVector::get(Result);
> @@ -801,11 +804,15 @@
> Constant *InElt;
> if (unsigned(Elt) >= SrcNumElts*2)
> InElt = UndefValue::get(EltTy);
> - else if (unsigned(Elt) >= SrcNumElts)
> - InElt = V2->getAggregateElement(Elt - SrcNumElts);
> - else
> - InElt = V1->getAggregateElement(Elt);
> - if (InElt == 0) return 0;
> + else if (unsigned(Elt) >= SrcNumElts) {
> + Type *Ty = IntegerType::get(V2->getContext(), 32);
> + InElt =
> + ConstantExpr::getExtractElement(V2,
> + ConstantInt::get(Ty, Elt - SrcNumElts));
> + } else {
> + Type *Ty = IntegerType::get(V1->getContext(), 32);
> + InElt = ConstantExpr::getExtractElement(V1, ConstantInt::get(Ty, Elt));
> + }
> Result.push_back(InElt);
> }
>
> @@ -1130,16 +1137,17 @@
> } else if (VectorType *VTy = dyn_cast<VectorType>(C1->getType())) {
> // Perform elementwise folding.
> SmallVector<Constant*, 16> Result;
> + Type *Ty = IntegerType::get(VTy->getContext(), 32);
> for (unsigned i = 0, e = VTy->getNumElements(); i != e; ++i) {
> - Constant *LHS = C1->getAggregateElement(i);
> - Constant *RHS = C2->getAggregateElement(i);
> - if (LHS == 0 || RHS == 0) break;
> + Constant *LHS =
> + ConstantExpr::getExtractElement(C1, ConstantInt::get(Ty, i));
> + Constant *RHS =
> + ConstantExpr::getExtractElement(C2, ConstantInt::get(Ty, i));
>
> Result.push_back(ConstantExpr::get(Opcode, LHS, RHS));
> }
>
> - if (Result.size() == VTy->getNumElements())
> - return ConstantVector::get(Result);
> + return ConstantVector::get(Result);
> }
>
> if (ConstantExpr *CE1 = dyn_cast<ConstantExpr>(C1)) {
> @@ -1697,17 +1705,18 @@
> // If we can constant fold the comparison of each element, constant fold
> // the whole vector comparison.
> SmallVector<Constant*, 4> ResElts;
> + Type *Ty = IntegerType::get(C1->getContext(), 32);
> // Compare the elements, producing an i1 result or constant expr.
> for (unsigned i = 0, e = C1->getType()->getVectorNumElements(); i != e;++i){
> - Constant *C1E = C1->getAggregateElement(i);
> - Constant *C2E = C2->getAggregateElement(i);
> - if (C1E == 0 || C2E == 0) break;
> + Constant *C1E =
> + ConstantExpr::getExtractElement(C1, ConstantInt::get(Ty, i));
> + Constant *C2E =
> + ConstantExpr::getExtractElement(C2, ConstantInt::get(Ty, i));
>
> ResElts.push_back(ConstantExpr::getCompare(pred, C1E, C2E));
> }
>
> - if (ResElts.size() == C1->getType()->getVectorNumElements())
> - return ConstantVector::get(ResElts);
> + return ConstantVector::get(ResElts);
> }
>
> if (C1->getType()->isFloatingPointTy()) {
>
> Modified: llvm/trunk/test/Other/constant-fold-gep.ll
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Other/constant-fold-gep.ll?rev=155682&r1=155681&r2=155682&view=diff
> ==============================================================================
> --- llvm/trunk/test/Other/constant-fold-gep.ll (original)
> +++ llvm/trunk/test/Other/constant-fold-gep.ll Thu Apr 26 19:54:36 2012
> @@ -263,10 +263,10 @@
> ; OPT: ret i64 ptrtoint (double* getelementptr ({ i1, double }* null, i64 0, i32 1) to i64)
> ; OPT: }
> ; OPT: define i64 @fc() nounwind {
> -; OPT: ret i64 mul nuw (i64 ptrtoint (double* getelementptr (double* null, i32 1) to i64), i64 2)
> +; OPT: ret i64 mul (i64 ptrtoint (double* getelementptr (double* null, i32 1) to i64), i64 2)
> ; OPT: }
> ; OPT: define i64 @fd() nounwind {
> -; OPT: ret i64 mul nuw (i64 ptrtoint (double* getelementptr (double* null, i32 1) to i64), i64 11)
> +; OPT: ret i64 mul (i64 ptrtoint (double* getelementptr (double* null, i32 1) to i64), i64 11)
> ; OPT: }
> ; OPT: define i64 @fe() nounwind {
> ; OPT: ret i64 ptrtoint (double* getelementptr ({ double, float, double, double }* null, i64 0, i32 2) to i64)
> @@ -433,7 +433,7 @@
> ; PLAIN: ret i32* %t
> ; PLAIN: }
> ; OPT: define i32* @fZ() nounwind {
> -; OPT: ret i32* getelementptr inbounds (i32* getelementptr inbounds ([3 x { i32, i32 }]* @ext, i64 0, i64 1, i32 0), i64 1)
> +; OPT: ret i32* getelementptr (i32* getelementptr inbounds ([3 x { i32, i32 }]* @ext, i64 0, i64 1, i32 0), i64 1)
> ; OPT: }
> ; TO: define i32* @fZ() nounwind {
> ; TO: ret i32* getelementptr inbounds ([3 x { i32, i32 }]* @ext, i64 0, i64 1, i32 1)
>
> Added: llvm/trunk/test/Transforms/SCCP/vector-bitcast.ll
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/SCCP/vector-bitcast.ll?rev=155682&view=auto
> ==============================================================================
> --- llvm/trunk/test/Transforms/SCCP/vector-bitcast.ll (added)
> +++ llvm/trunk/test/Transforms/SCCP/vector-bitcast.ll Thu Apr 26 19:54:36 2012
> @@ -0,0 +1,20 @@
> +; RUN: opt -sccp -S < %s | FileCheck %s
> +
> +target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128-n8:16:32-S128"
> +
> +; CHECK: store volatile <2 x i64> zeroinitializer, <2 x i64>* %p
> +; rdar://11324230
> +
> +define void @foo(<2 x i64>* %p) nounwind {
> +entry:
> + br label %while.body.i
> +
> +while.body.i: ; preds = %while.body.i, %entry
> + %vWorkExponent.i.033 = phi <4 x i32> [ %sub.i.i, %while.body.i ], [ <i32 939524096, i32 939524096, i32 939524096, i32 939524096>, %entry ]
> + %sub.i.i = add <4 x i32> %vWorkExponent.i.033, <i32 -8388608, i32 -8388608, i32 -8388608, i32 -8388608>
> + %0 = bitcast <4 x i32> %sub.i.i to <2 x i64>
> + %and.i119.i = and <2 x i64> %0, zeroinitializer
> + store volatile <2 x i64> %and.i119.i, <2 x i64>* %p
> + br label %while.body.i
> +}
> +
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
More information about the llvm-commits
mailing list