Displaying 20 results from an estimated 1000 matches similar to: "Understand if a condition was true or false"
2019 Jul 17
2
Help to understand LoadValueFromMemory
Hi all,
I'm trying to print to screen the value read by the fread function. I'm at
the point where source refers to the GetElementPtrInst ( pointer to the
buffer where fread stored the data - %5 in my case ) and the fread() has
been already called.
I thought the correct approach to achieve what I need was:
ExecutionContext& SF = ECStack.back();
GenericValue SRC =
2012 Nov 16
2
[LLVMdev] Assert with getZExtValue()?
Eli,
Thanks for responding. Yes, I read the error message but it seems odd
that it would be trying to use more than 64 bits. It compiles and executes
in gcc on 32 bit arch just fine. I'll probably take your suggestion and
file a bug with a reduced testcase.
Thanks again,
Ryan
On Fri, Nov 16, 2012 at 3:10 PM, Eli Friedman <eli.friedman at gmail.com>wrote:
> On Fri, Nov 16, 2012
2018 Mar 09
2
[SelectionDAG] [TargetOp] How to get sub-half of immediate?
Hi all,
This seems like a dumb question but while setting up a pattern in TD
file, I got stuck on trying to get each half of an immediate as the
half-sized type (ie. i64 imm -> pair of i32 imm's). Is there an existing
way to do it? I've tried the 'EXTRACT_SUBREG' but that seems to error at
the end of scheduling. Looking at Target.td, I'm not sure which opcode
is meant
2020 Jan 03
3
Interpreter crash due to an "Unknown constant pointer type!"
David,
sorry for this email but I noticed I made a mistake in the previous one. So
I managed to compile llvm Debug with asserts release. I have used the
following commands:
cmake -DLLVM_TARGETS_TO_BUILD=X86 -DLLVM_ENABLE_RTTI=ON
-DLLVM_ENABLE_FFI=ON -DCMAKE_BUILD_TYPE=Debug -DLLVM_ENABLE_ASSERTIONS=ON ..
cmake --build . -- -j8 && sudo cmake --build . --target install
Once lli was
2020 Feb 10
2
Interpreter crash due to an "Unknown constant pointer type!"
>
> Hey Lang - does any of this look familiar to you?
I'm afraid not: I know nothing about the interpreter. As far as I'm aware
it's essentially abandonware.
Alberto: The usual recommendation in these circumstances is to use a JIT
class instead of the interpreter. You're using -force-interpreter though,
so I assume you really want to use the interpreter for your use case?
2012 Nov 16
5
[LLVMdev] Assert with getZExtValue()?
Was hoping it might get some help or a better explanation of this:
/ADT/APInt.h:1217: uint64_t llvm::APInt::getZExtValue() const: Assertion
`getActiveBits() <= 64 && "Too many bits for uint64_t"' failed.
Program received signal SIGABRT, Aborted.
0x00007ffff6eb4d05 in raise (sig=6) at
../nptl/sysdeps/unix/sysv/linux/raise.c:64
64
2010 Jun 23
1
[LLVMdev] LLVM help
Sir I am trying to get the constant 2 in instruction y=x+2;
Its intermediate representaton is like %y=add nsw i32 %x , 2
If I use getOperand(2).getName() then I get null string.
How can I get the value 2 ?
Regards
Rahul Goyal
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20100623/21222621/attachment.html>
2018 Mar 09
0
[SelectionDAG] [TargetOp] How to get sub-half of immediate?
Hi Kevin,
To get some portion of a constant immediate you can use SDNodeXForms to
transform constant SDNodes into other values. For a worked example, in the
MIPS backend we use this for constant synthesis by materializing the value into a
register:
(From lib/Target/MipsInstrInfo.td):
// Transformation Function - get the lower 16 bits.
def LO16 : SDNodeXForm<imm, [{
return getImm(N,
2016 Jul 21
2
FreeBSD user willing to try fix a unit test?
Hi all
In unittests/ADT/APIntTest.cpp I came across this test:
// XFAIL this test on FreeBSD where the system gcc-4.2.1 seems to miscompile it.
#if defined(__llvm__) || !defined(__FreeBSD__)
TEST(APIntTest, i33_Count) {
APInt i33minus2(33, static_cast<uint64_t>(-2), true);
EXPECT_EQ(0u, i33minus2.countLeadingZeros());
EXPECT_EQ(32u, i33minus2.countLeadingOnes());
EXPECT_EQ(33u,
2015 Feb 16
2
[LLVMdev] LLVM Backend
I am working on LLVM backend and was wondering if there is any way by which
I can access the value stored SDValue so I can either assign it as a
literal or move it to register in an user defined instruction.
Something like:
SDValue Value = Op->getOperand(2);
intValue = Value.get_integer_value //get Value as an int
and then
if ( intValue > 31)
Thanks,
Ambuj
-------------- next part
2018 May 05
0
Slow IR compilation/JIT, profiling points to LLVM?
Hi,
Could you share how you compile IR and which version of JIT you use (Orc, MCJIT)?
Could it be that you are using interpreter instead of actual JIT?
Cheers,
Alex.
> On 5. May 2018, at 08:04, edA-qa mort-ora-y via llvm-dev <llvm-dev at lists.llvm.org> wrote:
>
> I'm having issues of my compiler, and JIT execution, of LLVM IR being
> rather slow. It's accounting for
2012 Dec 03
0
[LLVMdev] Assert with getZExtValue()?
So the problem here was trying to return MIN_VALUE zero extended, if I
return sign extended than this issue is resolved; however, I still get an
error with getSExtValue when trying to get the value of the const from
Instruction: %mask166 = and i128 %lvar_ins176, -18446462598732840961
On Fri, Nov 16, 2012 at 3:17 PM, Ryan Taylor <ryta1203 at gmail.com> wrote:
> Eli,
>
> Thanks
2019 Dec 24
2
Interpreter crash due to an "Unknown constant pointer type!"
Hi David,
In pretty sure that the crash is due to the instruction I have shared in my
first email. In order to run pngpixel you just need libpng and zlib..
honest I thought that the .bc had Al the necessary. I'm happy to help you
to reproduce it. As a curiosity, why do you think you cannot reproduce it?
Unfortunately I won't be able to modify the interpreter soon.. anyway, I'll
try to
2012 Jan 10
1
[LLVMdev] SelectionDAG
Hello,
I am working on a AVR backend and have a version up and running that will convert LLVM IR code to assembly code for my target. I have written a bunch of instructions from the AVR Instruction Set in AVRInstrInfo.td and not much else. In a simple test case I am attempting to compile (if that is the word you are supposed to use for this operation) test.ll:
define i8 @foo(i8 %a, i8 %b) {
2014 Sep 17
2
[LLVMdev] [cfe-dev] exc_bad_instruction on arm
Both Clang/LLVM 3.4 -> Clang/LLVM 3.5
And i will also try using MCJIT.
2014-09-17 18:56 GMT+06:00 Anton Smirnov <dev at antonsmirnov.name>:
> Hi, Tim.
>
> I've used Clang 3.4 final release and now i'm going to test it with 3.5
> release (since i've read about arm64 improvements).
> I will report my results.
>
> BTW, is it possible to get smth like
2020 Jan 19
3
Instruction arguments
Hello,
I am loop over the arguments of a call instruction :
---->
for (Value *arg: c->args()){
errs() << *arg << "\n";
arg->print(llvm::errs(), false);
errs()<<"\n";
}
----->
How can I convert the arg for binary comparison(== etc.)? If I am correct,
it is not a string. If the argument is "i32 1",
2018 May 05
4
Slow IR compilation/JIT, profiling points to LLVM?
I'm having issues of my compiler, and JIT execution, of LLVM IR being
rather slow. It's accounting for the vast majority of my full
compilation time. I'm trying to figure out why this is happening, since
it's becoming an impediment. (Note: by slow I mean about 3s of time for
only about 2K of my front-end code, 65K lines of LLVM-IR)
Using valgrind I see some functions which seem
2014 Sep 17
2
[LLVMdev] [cfe-dev] exc_bad_instruction on arm
I've also tried the next combination:
true, // ForceInterpreter
false, // UseMCJIT
and ios app just crashed with no output
2014-09-18 0:47 GMT+06:00 Anton Smirnov <dev at antonsmirnov.name>:
> Hey.
>
> I've checked out LLVM/Clang 3.5 and modified my static libs source code to
> use the latest llvm/clang sources.
> Also i'm trying triple
2013 Mar 25
1
[LLVMdev] Backend port: Adding negative immediates
Hi,
I'm doing a backend port and I'm having trouble with adds that have
negative immediates.
My architecture only has instructions for subtracting and adding 8bit
immediate values (they will be zero-extended, thus unsigned).
Bigger immediates have to be moved in a register first.
The problem is:
Expressions like "b - 1" result in "add nsw i32 %b, -1" in LLVM IR.
They
2019 Jan 20
3
(no subject)
Hi all,
I have the following C code:
#include<stdio.h>
int main(int argc, char *argv[]) {
printf("%s\n", argv[0]);
return argc;
}
that generates the following IR for the main function:
; Function Attrs: noinline nounwind optnone uwtable
define i32 @main(i32, i8**) #0 {
%3 = alloca i32, align 4
%4 = alloca i32, align 4
%5 = alloca i8**, align 8
store i32 0, i32*